You are not logged in.

paserra

Unregistered

1

Monday, February 2nd 2009, 9:40pm

Serial Port

Hi,
many compliments for this excellent work.
Could be possible to control a serial port directly from Jabaco?
Pier Andrea.

maXim

Trainee

  • "maXim" is male

Posts: 53

Date of registration: Jan 5th 2009

Location: Sesto Fiorentino, Florence (ITALY)

Occupation: design & development (HW, SW & FW)

Hobbies: chess, fly fishing, good wine and beautiful women!

  • Send private message

2

Tuesday, February 3rd 2009, 9:46am

Hi Pier Andrea,

I found the RXTX library (http://rxtx.qbang.org/wiki/index.php/Main_Page), there are many functions and commands to manage any port... Unfortunately I do not know well Java for make integration in Jabaco and thus are not able to obtain excellent results ;(. However, the testing continues ;)...

Massimo

P.S. please excuse my bad english :S.

paserra

Unregistered

3

Thursday, February 5th 2009, 5:22am

Hi Massimo,
no problems for your english it is great ("del resto anche il mio non eccelle!!!").
I know the java serial libraries (JavaComm). I'm interested in a hardware implementation using PIC or AVR microprocessors using JABACO and I need a RS232 starting point for interfacing Firefox directly with my microcontroller.
Thank you again.
Pier Andrea.

maXim

Trainee

  • "maXim" is male

Posts: 53

Date of registration: Jan 5th 2009

Location: Sesto Fiorentino, Florence (ITALY)

Occupation: design & development (HW, SW & FW)

Hobbies: chess, fly fishing, good wine and beautiful women!

  • Send private message

4

Thursday, February 5th 2009, 10:05am

Hi Pier Andrea,

I too have the same Your needs (I design and develop hw and fw). I was directed to the RXTX wrapper because it is more "extended" the Java Communications API, so it seems to me. In RXTX there are classes already prepared for the management of RS485 serial ports and also for communication on I2C bus. In internet there are several projects (some with source included) that use the RXTX wrapper (http://rxtx.qbang.org/wiki/index.php/Projects, http://users.frii.com/jarvi/rxtx/projects.html). Unfortunately I do not know Java, but it would be enough that someone show me a small example of how you can successfully integrate the RXTX wrapper in Jabaco. We hope that some "good soul" will meet our needs... ;)

Best Regards,

Massimo

P.S. two questions for You:
  1. why do not You sign up to the community?
  2. sei un italiano?

paserra

Beginner

Posts: 2

Date of registration: Feb 5th 2009

  • Send private message

5

Thursday, February 5th 2009, 8:42pm

OK

Hi Massimo,
I've completed the registration today and I'm now a member of this community.
I'm a HW, SW and FW developer and I think cold be great to have an"indirect Java tool" as Jabaco in my toolbox. Basically I'm a VB developer with a C/C++ expertise (DLLs etc).
Yes, I'm italian, of course! I'm from Sassari, Sardinia.
The idea of extending Jabaco with ActiveX is very good for Windows platforms, but I think could be better (for me) to have an interface to the real world (RS232, USB etc) end extend the capabilities of this great tool in HW interfacing, graphing, plotting, data logging, controlling periherals directly from Firefox Browser and so on.
Regards.
Pier Andrea.

maXim

Trainee

  • "maXim" is male

Posts: 53

Date of registration: Jan 5th 2009

Location: Sesto Fiorentino, Florence (ITALY)

Occupation: design & development (HW, SW & FW)

Hobbies: chess, fly fishing, good wine and beautiful women!

  • Send private message

6

Friday, February 6th 2009, 8:59am


Ciao Pier Andrea,

allora, visto che anche tu lo sei, mi permetto di darti il benvenuto in Italiano! :)

Anche io progetto HW e sviluppo FW e SW con diversi compilatori per diverse piattaforme (sia HW che SW, leggi anche SO diversi), per questo sono interressato a Jabaco visto che offre la possibilità di generare dei .jar che, se "modellati" secondo gli standard Sun, sono multi-piattaforma. Purtroppo mi "affaccio" solo ora al mondo Java e quindi le mie conoscenze in merito sono molto limitate ma, grazie all'aiuto di Manuel, ho già ottenuto degli ottimi risultati e i test mi convincono che tra non molto potrei cominciare la "conversione" di qualche mio "vecchio" progetto VB per renderlo veramente portatile e quindi "nuovo". Che dire poi della possibilità di generare anche delle applet, il tutto si farà con un unico strumento! Come ho già accennato in altri post in inglese, basterebbe avere a disposizione la documentazione adeguata per procedere allo studio e alla sperimentazione (ma questa, al momento, è l'unica grande pecca) o degli esempi pratici dove viene mostrato come integrare in Jabaco le classi di qualche wrapper Java per poter cominciare a "divertirci". Per quanto riguarda il wrapper RXTXche ho proposto, anche in questo caso sarebbe sufficiente un piccolo esempio per permetterere a chiunque di iniziare a sperimentare con i propri dispositivi di I/O, un caso simile è stato l'esempio fornito da Manuel per l'uso del driver per i database SQLite (vedi il post). Comunque va detto che Manuel sta lavorando sodo e sono sicuro che molto presto ci saranno delle piacevoli sorprese.

Saluti da Firenze a Tàtari,

Massimo

This post has been edited 6 times, last edit by "maXim" (Feb 6th 2009, 3:57pm)


paserra

Beginner

Posts: 2

Date of registration: Feb 5th 2009

  • Send private message

7

Friday, February 6th 2009, 8:38pm

Ciao

Ciao Massimo,
grazie per il caloroso benvenuto.
Che dire, hai pienamente ragione sulle straordinarie potenzialità di questo progetto.
Generalmente mi aspetterei una tiratina d'orecchi per l'italiano,speriamo il moderatore sia permissivo.
Che tipo di esperienza hai come sviluppatore?, magari parte di questa conversazione la possiamo fare per email (paserra@gmail.com).
Saluti a te ed alla tua meravigliosa città.
Pier Andrea.

Quiepo

Beginner

  • "Quiepo" is male

Posts: 3

Date of registration: Apr 29th 2009

Location: São Paulo - Brazil

  • Send private message

8

Wednesday, April 29th 2009, 9:49pm

Serial Port

Hi all ! My name's Marcos and I from Brazil...I would like to know if someone has success to comunicate with the serial port using Jabaco !

Best Regards

Marcos

  • "santiago.barreiro" is male

Posts: 14

Date of registration: Jan 29th 2010

Location: Guayaquil, Ecuador

Occupation: Manager of a software company

Hobbies: Music player

  • Send private message

9

Sunday, January 31st 2010, 2:01am

Hello all..

Is there possible to include inline Java code?
It will be a simple way for adding serial port support.

Regards

Regards

Santiago

  • "santiago.barreiro" is male

Posts: 14

Date of registration: Jan 29th 2010

Location: Guayaquil, Ecuador

Occupation: Manager of a software company

Hobbies: Music player

  • Send private message

10

Sunday, January 31st 2010, 2:14am

Hello
Perhaps placing inline something like the code in the link.
This link show a java pure code for serial and parallel port:
http://java.sun.com/developer/Books/java…cookbook/11.pdf
Regards

A1880

Intermediate

  • "A1880" is male

Posts: 500

Date of registration: Jan 1st 2009

Location: Hanover, Germany

Occupation: Software Engineer

Hobbies: Hilbert Curves

  • Send private message

11

Sunday, January 31st 2010, 6:54pm

Inline code via "emit" or similar statements is not supported.
This would be a very powerful but also dangerous feature.
People who know how to deal with binary Java code could probably generate
an apropriate Java class outside of Jabaco, pack it into a Jar library and add it to
the Jabaco classpath.

Inlining would probably depend on the Java implementation.
Another problem could be to prevent debugger crashes.

Greetings

A1880

  • "santiago.barreiro" is male

Posts: 14

Date of registration: Jan 29th 2010

Location: Guayaquil, Ecuador

Occupation: Manager of a software company

Hobbies: Music player

  • Send private message

12

Sunday, January 31st 2010, 9:12pm

Hello A1880

Sorry for the slow understanding, but would you care to explain me how do I include a JAR CLASS into a JABACO proyect. The jar might as simple a "Jar say Hello" sample code, that can be called from Jabaco.

Regards

Santiago

A1880

Intermediate

  • "A1880" is male

Posts: 500

Date of registration: Jan 1st 2009

Location: Hanover, Germany

Occupation: Software Engineer

Hobbies: Hilbert Curves

  • Send private message

13

Monday, February 1st 2010, 9:10am

Simply press function key F1 to open the dialog for project references.
There you see the external libraries referenced by your project.
It also allows you to add/remove jar libraries.
Another feature is to find out details about the various Java classes.

Have you tried to use the search facility of this forum?
It will show you many posts to answer your questions.

Greetings!

A1880

  • "santiago.barreiro" is male

Posts: 14

Date of registration: Jan 29th 2010

Location: Guayaquil, Ecuador

Occupation: Manager of a software company

Hobbies: Music player

  • Send private message

14

Monday, February 1st 2010, 5:33pm

You are right.... I was looking for HELP (usually on F1) and the windows pop up... thank you!

  • "santiago.barreiro" is male

Posts: 14

Date of registration: Jan 29th 2010

Location: Guayaquil, Ecuador

Occupation: Manager of a software company

Hobbies: Music player

  • Send private message

15

Monday, February 1st 2010, 7:14pm

Hello A1880

Kind of mixing two question, in order to solve this one.
I found comm.jar that is supposed to be generic (cross-plataform), I downloaded, and I just integrated with F1 into a project. It shows the class and describes the functions properly...
How do I call this functions within Jabaco?
Regards
Santiago

A1880

Intermediate

  • "A1880" is male

Posts: 500

Date of registration: Jan 1st 2009

Location: Hanover, Germany

Occupation: Software Engineer

Hobbies: Hilbert Curves

  • Send private message

16

Monday, February 1st 2010, 10:30pm

Here is a sample:

Jabaco Source

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Option Explicit

Import javax#comm

Public Sub Command1_Click()
   Dim cpi As CommPortIdentifier 
   Dim ty As Integer  
   Dim s As String = ""
   Dim en As java#util#Enumeration = CommPortIdentifier.getPortIdentifiers()
   
   Do While en.hasMoreElements()  
     cpi = Cast(en.nextElement(), CommPortIdentifier)
   
     ty = cpi.getPortType()
       
     If ty = CommPortIdentifier.PORT_PARALLEL Then
       s = s & "parallel port: "  
     Elseif ty = CommPortIdentifier.PORT_SERIAL Then
       s = s & "serial port: "
     Else
       s = s & "??? port: "
     End If
     
     s = s & cpi.getName() & vbCrLf
   Loop
   
   If s = "" Then
      s = "no port found!"
   End If
   
   MsgBox s
End Sub


The sample shows how to access the Java classes.
Javax.comm has not received too many positive comments in various forums.
You might want to follow one of the javax.comm tutorials (ask Google for "javax.comm sample").

Please report your findings here.

Success!

A1880

  • "santiago.barreiro" is male

Posts: 14

Date of registration: Jan 29th 2010

Location: Guayaquil, Ecuador

Occupation: Manager of a software company

Hobbies: Music player

  • Send private message

17

Tuesday, February 2nd 2010, 12:31am

Hello A1880...

Thank you... :thumbsup: good enough to test it... I understand that RXTX only changes
the import statement... something like the following quote, but I will
begin testing with the more universar comm..

Regards

Santiago


"REMEMBER !! for the newbies
Change the all occurences of the import javax.comm.*; in
MyApps.java
TO import gnu.io.*;
I did not even have to recompile as suggested the rxtxSerial.dll"

from
http://rxtx.qbang.org/wiki/index.php/Using_RXTX



"

  • "santiago.barreiro" is male

Posts: 14

Date of registration: Jan 29th 2010

Location: Guayaquil, Ecuador

Occupation: Manager of a software company

Hobbies: Music player

  • Send private message

18

Tuesday, February 2nd 2010, 2:15am

Hello!



I just test the code... at the general - declarations the following was placed:

Jabaco Source

1
Import javax#comm


The button code was moved to Command2, and a list box was added to
send the result

Jabaco Source

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Public Sub Command2_Click()
   Dim cpi As CommPortIdentifier 
   Dim ty As Integer  
   Dim s As String = ""
   Dim t As String   
   Dim en As java#util#Enumeration = CommPortIdentifier.getPortIdentifiers()
   
   Do While en.hasMoreElements()  
 	cpi = Cast(en.nextElement(), CommPortIdentifier)
   
 	ty = cpi.getPortType()
   	
 	If ty = CommPortIdentifier.PORT_PARALLEL Then
   	lstCommPorts.AddItem "parallel port: "     	
   	s = s & "parallel port: "  
 	ElseIf ty = CommPortIdentifier.PORT_SERIAL Then
  	lstCommPorts.AddItem "serial port: "  
   	s = s & "serial port: "
 	Else
  	lstCommPorts.AddItem "??? port: "  
   	s = s & "??? port: "
 	End If
 	
 	t=cpi.getName()
 	lstCommPorts.AddItem t
 	s = s & t & vbCrLf
   Loop
   
   If s = "" Then
  	lstCommPorts.AddItem "no port found!"
  	s = "no port found!"
   End If
   MsgBox s
   
End Sub


The pc has several COM ports...



but when clic, no serial o parallel port shows.


Regards

Santiago

A1880

Intermediate

  • "A1880" is male

Posts: 500

Date of registration: Jan 1st 2009

Location: Hanover, Germany

Occupation: Software Engineer

Hobbies: Hilbert Curves

  • Send private message

19

Tuesday, February 2nd 2010, 8:54am

Access to hardware resources is a matter of various components.
Sorry, but I can't diagnose this problem any further.
The sample works OK on my system (Windows XP SP3, Java 1.6).
It might be an installation problem. Do you have all platform specific libraries in place?
As mentioned before, Javax.comm seems to cause a lot of trouble.
I'd welcome any reports on communication packages that work seemlessly.

Greetings

A1880

htillmann

Beginner

  • "htillmann" is male

Posts: 30

Date of registration: Feb 25th 2009

Location: Beverungen / Weser

Occupation: Softwareentwicklung

  • Send private message

20

Monday, October 4th 2010, 6:07pm

rxtx with Jabaco

Hi Santiago and A1880,

I made your example run with javax.comm on XP/SP3 but could not make it run on linux.
Now I'd like to test with rxtx but compiling the prog below throws an error
at line 12 "converting from java/util/Enumeration to gnu/io/Enumerator is impossible".

Why that? Got no idea! ?( I'm thankful for some hints.
regards Hubertus

Jabaco Source

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Option Explicit

'Import javax#comm
Import gnu#io

Public Sub Command1_Click()
   Dim cpi As gnu#io#CommPortIdentifier 
   Dim ty As Integer  
   Dim s As String = ""
   Dim en As gnu#io#CommPortEnumerator '= gnu#io#CommPortIdentifier.getPortIdentifiers()
   
   en = gnu#io#CommPortIdentifier.getPortIdentifiers()
   
   Do While en.hasMoreElements()  
 	cpi = Cast(en.nextElement(), CommPortIdentifier)
    	
 	ty = cpi.getPortType()
   	
 	If ty = CommPortIdentifier.PORT_PARALLEL Then
   	s = s & "parallel port: "  
 	Elseif ty = CommPortIdentifier.PORT_SERIAL Then
   	s = s & "serial port: "
 	Else
   	s = s & "??? port: "
 	End If
 	
 	s = s & cpi.getName() & vbCrLf
   Loop
   
   If s = "" Then
  	s = "no port found!"
   End If
   
   MsgBox s
End Sub

Rate this thread
WoltLab Burning Board