Problem in reading a serial port
Hi,
I am working on a program about serial communication, my problem is when reading the response of the other serial port, my program always throws the "PortInUseException" and prints the error "Unknown Application". Yes, the port was use by that application but I want to read its response because I can already write to it.
Any ideas would be much appreciated.
Thanks!
Try the "Serial Read with Timeout.vi" (in Serial Comm examples). Do remember to specifiy no. of bytes you are expecting from the Serial Port.
ian.
Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010
依恩与LabVIEW
LVVILIB.blogspot.com
Similar Messages
-
A problem about reading from serial port
Hi,
I just sent '0x03' from MCU to PC continuously, and then sent '/n' as a stop character after every '0x03'. I use labview to read the data. The problem is when it get two '03' it get a '0', another two '03' and another a '0'. I don't know where is the '0' from?
PS: Hyper terminal can display natrually.
Thank you!
帖子被hengfo在08-08-2007 10:14 PM时编辑过了
Attachments:
serial read.vi 36 KBI think the problem may be the loop reading the serial port is running too fast. There is no timing delay in the loop, so you are reading it as fast as you can, and probably faster than the device is sending data. So sometimes the buffer is empty, and then the empty string gets converted to a numeric zero. The way to know for sure is to put an indicator on the error wire coming out of the serial port read. I bet you will see errors about the read buffer being empty.
Put a wait timer in the loop to slow down the execution just slightly. This is a good idea so that LV doesn't eat up all the CPU resources. Look at the example for Basic Serial Write and Read. You may want to have a loop ahead of the read that waits until there are a certain number of bytes at the port before it reads the serial port. You may want to put a loop around the serial port that waits until a valid number is read in before it exits the loop and goes to the numeric conversion.
Message Edited by Ravens Fan on 08-09-2007 08:50 AM -
Reading form serial port problem
I'm using javax.comm for communicating with a microcontroller (the uc just sends data ->"data from uc"). Here is what is read from the serial port. Where is the problem?
the code:
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import javax.comm.*;
public class ss extends Frame implements WindowListener,ActionListener,KeyListener {
TextField text = new TextField(20);
Button inainte;
Button inapoi;
Button stanga;
Button dreapta;
Button stop;
SerialPort serialPort1, serialPort2;
test2 df=new test2();
Label msg_stop=new Label("am un obiect in fata! ");
TextArea displayArea;
Panel panel;
Panel displayPanel;
Integer i;
/* public static void main(String[] args)
test df=new test();
// df.dumpFrame();
df.sendCommand("a");
System.out.println("serial port successfully opened!");
CommPortIdentifier portId1;
CommPortIdentifier portId2;
class test2 extends Thread
serialComm mySerial;
char var_ser,a;
public String misc;
test2()
try {
portId1 = CommPortIdentifier.getPortIdentifier("COM1");
portId2 = CommPortIdentifier.getPortIdentifier("COM2");
// cs a=new cs();
catch
(Exception e) {
// TimeStamp = new java.util.Date().toString();
// System.out.println(TimeStamp + ": COM1 " + portId1);
// System.out.println(TimeStamp + ": COM2 " + portId2);
// System.out.println(TimeStamp + ": msg1 - " + e);}
try{
// serialPort1 = (SerialPort) portId1.open("ss", 2000);
catch
(Exception e2){};
mySerial=new serialComm("1");
// serialPort1=(SerialPort)mySerial;
public void run()
while(true) {
// var_ser=mySerial.readByte();
// mySerial.writeStr("!andi");
//try{
// sleep(200);
// }catch(InterruptedException e){};
a=mySerial.readByte();
System.out.println(a);
// if(var_ser=='r') {
// System.out.println("dsadsa");
// mySerial.writeStr(misc);
// misc="id";
// if(var_ser=='o'&& misc=="sp"){
// misc="id";
// msg_stop.setVisible(true);
// System.out.println("Sunt in task1 "+misc+" "+var_ser+" end ");
try{
sleep(200);
}catch(InterruptedException e){};
Flushes all data out of the serial file buffer
int pixels[];
public void dumpFrame()
char a,c,k,r;
int data=1, pix;
int row,col=0;
int count=0;
// pixels=new int[900];
// MemoryImageSource source;
// Image image;
// source = new MemoryImageSource(30,30,pixels,0,30);
// source.setAnimated(true);
// image=createImage(source);
// source.newPixels(0,0,30,30);
// mySerial.writeStr("DF\r");
while(col==0){
data=mySerial.readNonBlock();
System.out.println(data);
if(data==1) // New frame
System.out.println("este 1 ! !");
else
if(data==2) // New col
System.out.println("este 2 ! !");
System.out.println("count este : "+count);
count=0;
else
count++;
/* else{
if (data==0) {
'System.out.println("count este"+count);
// if(!sendCommand("DF\r")) return 0;
/* sendCommand("L1 1");
//data=mySerial.readNonBlock();
while(data!=0)
sendCommand("L1 1");
if(data==1) // New frame
col=0;
row=0;
else if(data==2) // New col
col+=2;
row=0;
else if(data==3) // End frame
row=0;
col=0;
// return 0;
else
{ // A pixel!
int red,green,blue,green2;
red=data;
green=mySerial.readByte();
blue=mySerial.readByte();
green2=green;
pix=0;
pix+=blue;
pix+=green<<8;
pix+=red<<16;
Color pixColor= new Color(pix);
pix=0;
pix+=blue;
pix+=green2<<8;
pix+=red<<16;
Color pixColor2= new Color(pix);
// data=mySerial.readNonBlock();
public void sendCommand(String command)
char a,c,k,r;
a=0;
// mySerial.writeStr("DF\r");
//mySerial.writeStr("1");
while(true){
try
a=mySerial.readByte();
// if (a=='r') {
//mySerial.writeStr("!and");
// 'a=0;
// System.out.println(trimit !!!");
// mySerial.writeStr(command);
// a=mySerial.readByte();
// c=mySerial.readByte();
// k=mySerial.readByte();
// r=mySerial.readByte();
// if(a=='A' && c=='C' && k=='K' && r=='\r' )
//return true;
// else
// return false;
}catch(Exception e) {System.out.println(e);}
//return false;
System.out.println(a);
private int numClicks = 0;
public void keyTyped(KeyEvent e) {
int keyCode = e.getKeyCode();
System.out.println("Buton Apasat !"+keyCode);
/** Handle the key pressed event from the text field. */
public void keyPressed(KeyEvent e) {
int keyCode = e.getKeyCode();
System.out.println("Buton Apasat !"+keyCode);
switch(keyCode){
case 38: df.misc="fa";
/** Handle the key released event from the text field. */
public void keyReleased(KeyEvent e) {
public ss(String title) {
super(title);
// df.dumpFrame();
// df.sendCommand("a");
//df.start();
// df.misc="id";
// test2 df=new test2();
// df.dumpFrame();
// df.sendCommand("a");
Panel panel = new Panel();
Panel displayPanel = new Panel();
addWindowListener(this);
// displayPanel
displayPanel.add(panel);
// text.addKeyListener(this);
inainte = new Button("Inainte");
inapoi = new Button("Inapoi");
stanga = new Button("Stanga");
dreapta = new Button("Dreapta");
stop = new Button("Stop");
panel.setLayout(new BorderLayout());
msg_stop.setBackground(Color.red);
msg_stop.setFont( new Font ( "Dialog", 30, Font.ROMAN_BASELINE ));
msg_stop.setVisible(false);
displayArea = new TextArea(5, 20);
//panel.add(displayArea);
panel.setLayout(new BorderLayout());
panel.add(inainte,BorderLayout.NORTH);
panel.add(inapoi,BorderLayout.SOUTH);
panel.add(stanga,BorderLayout.WEST);
panel.add(dreapta,BorderLayout.EAST);
panel.add(stop);
//panel.add(msg_stop,BorderLayout.EAST);
//panel.add(text);
this.add("Center",displayPanel);
inainte.addActionListener(this);
inapoi.addActionListener(this);
stanga.addActionListener(this);
dreapta.addActionListener(this);
stop.addActionListener(this);
this.setVisible(true);
inainte.addKeyListener(this);
inapoi.addKeyListener(this);
stanga.addKeyListener(this);
dreapta.addKeyListener(this);
stop.addKeyListener(this);
// addKeyListener(this);
// displayArea.addKeyListener(this);
public static void main(String[] args) {
ss myWindow = new ss("Boe Bot " +
"Control");
//myWindow.setSize(300,300);
myWindow.setLocation(400, 200);
myWindow.setSize(200,300);
myWindow.setVisible(true);
public void actionPerformed(ActionEvent e) {
String command=e.getActionCommand();
if(command.equals("Inainte")){
System.out.println("Inaite !!! ");
df.misc="fa";}
if(command.equals("Inapoi")){
System.out.println("Inapoi !!! ");
df.misc="sp";}
if(command.equals("Stanga")){
System.out.println("Inapoi !!! ");
df.misc="st";}
if(command.equals("Dreapta")){
System.out.println("Dreapta !!! ");
df.misc="dr";}
if(command.equals("Stop")){
System.out.println("Stop !!! ");
df.misc="id";}
// numClicks++;
// text.setText("Button Clicked " + numClicks + " times");
public void windowClosing(WindowEvent e) {
dispose();
System.exit(0);
public void windowOpened(WindowEvent e) {}
public void windowActivated(WindowEvent e) {}
public void windowIconified(WindowEvent e) {}
public void windowDeiconified(WindowEvent e) {}
public void windowDeactivated(WindowEvent e) {}
public void windowClosed(WindowEvent e) {}
thanks,
andifrom the screenshot it looks like there is 2 bytes of "noise" after every 8 bytes?
print the char array next to the String. are the 2 bytes of noise the same every time? -
Problems reading the serial port with labview 5.1.
I open the example serial.vi , I select write to serial port, run the programm, I don`t have any problem. But when I select read serial port, I get the error code 16392and hex code error x4008. I need to know what can I do? Thanks a lot
Any time you get an error in LV you can right click on the error cluster indicator and do a "Explain Error".
If you do this for the error code you reported, the explanation says that it was a framing error.
In serial communications, a framing error indicates that the hardware was not able to detect a start bit, data then the stop bits that comprise a frame.
This prompts me to suggest that you check you port setting on the serial port. You want to make sure you are setting the port for the correct;
Number of start/stop bits,
Baud rate
data bits
parity (just for good measure)
and hardware handshaking.
I hope this helps,
Ben
Ben Rayner
I am currently active on.. MainStream Preppers
Rayner's Ridge is under construction -
I have problem with delay in serial port
I have problem with serial port. I have connected two computers by serial port and I need to create program in Labview for transfer strings using start bits and stop bits. My problem is that my program is working quite well ...when I press start bit it starts to concatenate strings and if i press stop bits it stops...this is the purpose of this program...but problem is that it working only with delay...and need that this program dont need delay, because it can only concatenating data depends on delay from start bit....I wana solved problem with delay...I dont want using delay process in my program, but allways when I try to delete this delay it stop works correct
here is my programOk this should be simple - if I understand you correctly.
You have the VISA session initialized with read termination character enabled. So reading the number of bytes at port is NOT the correct way to read from the port. Set the read number of bytes to something large (say 4096) and the read will return as soon as a termination character is received (or timeout).
You'll need to make sure the sending device is configured to send termination character on writes (you can set that with a VISA property node) and that you are sending the correct termination character. The default is 0x0A (newline).
Jeff -
Efficient optimized way to read from serial port and GPS data display using map
Hi,
I have a custom h/w which reads the data from GPS Rx and after parsing send it to PC over RS232.
Each second it sends 201 bytes to PC. I have developed a VI to read the GPS data and display it. Project file is attached.
Fulctionality of different loops are as following:
1. LOOP 1: 1.1 Reads the serial data from com port.
1.2 Synclonize the frame using start bytes "a" and "z".
1.3 Reads next 4 bytes containg receiving error information.
1.4 Reads next 195 bytes. in which initial 80 byes are GPS data. rest are others.
2. LOOP 2: 2.1 Extarcts the GPS information and put them in an array.
2.2 Extarcts the receive error infor and counts the total error by incrimenting the variable using shift reg.
3. LOOP 3:3: 3.1 Displays the GPS data in chart and log the data in a file.
4. FLOW : Uses the GMAP .NET based API to creat a MAP and display.
Problem statement:
1. Functionality acheived.
2. However in between data set is being missed by the programm.
Quesitions:
1. Is the developed VI is efficient in terms of using queue loacl variables etc.
2. What are the improvments I can do to solve the problem.
Any other suggestions|
Thank you
jayant
jayant
Attachments:
Telemetry_Receiver_v2.zip 3075 KBOne of the most common problems in serial communication is the need for an adequate timing: how much time is expected your device to spend before answering? Have you put and adequate pause in your code before reading from the serial port?
Hope this helps
Roberto
Proud to use LW/CVI from 3.1 on.
My contributions to the Developer Zone Community
If I have helped you, why not giving me a kudos? -
Reading 2 serial port in a same time
i want to monitor 2 type of data in a same time
1- i have 6 sensor and i send them from micro avr and packed in this format >>
printf("%4d%4d%4d%4d%4d%2d@%4.2f\r\n",a,b,d,c,e,p,f);
i want to recive all 30 data bytes in one port then unpacked them...
2- i have a gyro sensor that sends data very slow every 500ms thats data like this >>
x+40.2\s\s\Y+42.3\r\n
i want recive all 16 data byte in another port and send feed back (write serial) too.
i recive gyro sensor data recive in fix 16 byte and dont have any problem .
but i have problem that i dont recive fix data from 30 data(from micro) its hangs or recive lower.
its becuse i use 2port in same time if i use it alone there is no problem.i recive it fix.
plz help me.
also im sory im not good at english.
Attachments:
8-28-2012 8-07-41 PM.jpg 289 KB
read and write in 2 serial port.vi 28 KBHey,
I would first add some error handling to your loops. The way you have it setup, the loops could be running in error and you will never know about it. The code I have attached will stop the loop if an error occurs.
Does it throw any errors when you run it?
Lewis Gear CLD
Check out my LabVIEW UAV
Attachments:
read and write in 2 serial portv2.vi 28 KB -
Computer freezes while reading from serial port
My computer freezes when i tried to read from a serial port for a longer period of time such as 10 hours. I always close the serial port after reading. please, help me solve this problem
I too experienced a similar problem twice on my machine and I have no idea how to stop it because it is so intermittent and I cannot replicate it.
Perhaps I can offer some clues.
The Labview screen cannot be stopped and some parts of Windows appears frozen. Oddly enough I can switch to the block diagram but thats about all I can do. The LV stop button will indicate a mouse click on it but the VI does not stop. iT also cannot be closed.
Even the reset button and power button on the PC does not work. I am forced to power down the PC (pull the plug) to get back control.
I believe it is related to a visa call to my serial Balance.
ANyway no solution but hopefully some clues.
Dell Optiplex GX260 w/ 500MB RAM
Win2K 500.2195 w service pak 4,
NI
serial Hardware and NI serial ver1.45 (16 com ports)
Labview 6.1 and 7 -
Function for reading from serial port
Hi experts,
We are trying to read data from the serial port with the following function we got from internet.
The problem is when creating the object with the sentence CREATE OBJECT o_obj '"MSCOMMLib.MSComm.1"'.
This returns a sy-subrc = 2 and shows the exception NO_CREATE_OBJECT.
We already copied the file MSCOMM32.OCX in c:\windows\system32 and we successfuly registered it, with regsvr32.exe.
We tried it with Windows XP and Vista.
Anybody has any idea?
Thanks in advance
FUNCTION ZSERIALCOM.
""Interfase local
*" IMPORTING
*" REFERENCE(MODE) TYPE I DEFAULT 0
*" REFERENCE(COMMPORT) TYPE I DEFAULT 1
*" REFERENCE(SETTINGS) TYPE C DEFAULT '2400,N,8,1'
*" REFERENCE(OUTPUT) TYPE C OPTIONAL
*" EXPORTING
*" REFERENCE(INPUT) TYPE C
*" EXCEPTIONS
*" NO_CREATE_OBJECT
TYPE-POOLS: sabc.
INCLUDE ole2incl.
PERFORM init.
PERFORM open_port USING commport settings.
IF mode = 0.
PERFORM read_port
CHANGING input.
ENDIF.
IF mode = 1.
PERFORM write_port
USING output
CHANGING input.
ENDIF.
PERFORM final.
ENDFUNCTION.
DATA: o_obj TYPE ole2_object.
*& Form Init
text
--> p1 text
<-- p2 text
FORM init.
DATA:
wa_repid LIKE sy-repid.
wa_repid = sy-repid.
CALL FUNCTION 'AUTHORITY_CHECK_OLE'
EXPORTING
program = wa_repid
activity = sabc_act_call
application = 'MSCOMMLib.MSComm.1'
EXCEPTIONS
no_authority = 1
activity_unknown = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CREATE OBJECT o_obj '"MSCOMMLib.MSComm.1"'.
IF sy-subrc <> 0.
RAISE no_create_object.
ENDIF.
ENDFORM. " Init
FORM open_port *
--> COMMPORT *
--> SETTINGS *
FORM open_port USING commport settings.
SET PROPERTY OF o_obj 'CommPort' = commport.
SET PROPERTY OF o_obj 'Settings' = settings.
SET PROPERTY OF o_obj 'InputLen' = 0.
SET PROPERTY OF o_obj 'PortOpen' = 1.
ENDFORM. "open_port
FORM read_port *
--> INPUT *
FORM read_port
CHANGING input.
DATA:
wa_buffer TYPE i.
DO 10 TIMES.
GET PROPERTY OF o_obj 'InBufferCount' = wa_buffer.
IF wa_buffer > 0.
GET PROPERTY OF o_obj 'Input' = input.
EXIT.
ENDIF.
ENDDO.
ENDFORM. " read_port
FORM write_port *
--> OUTPUT *
FORM write_port
USING output
CHANGING input.
DATA:
wa_buffer TYPE i.
SET PROPERTY OF o_obj 'Output' = output.
DO 10 TIMES.
GET PROPERTY OF o_obj 'InBufferCount' = wa_buffer.
IF wa_buffer > 0.
GET PROPERTY OF o_obj 'Input' = input.
EXIT.
ENDIF.
ENDDO.
ENDFORM.
*& Form final
text
--> p1 text
<-- p2 text
FORM final.
SET PROPERTY OF o_obj 'PortOpen' = 0.
FREE OBJECT o_obj.
ENDFORM. " finalbligwHi ,
I want to read value form weigh bridge through COMM port. I have developed the FM and done the setting as mentioned in the below link
Read COMM port using ABAP w/o third party software
but while executing the FM independently I am able to get the value from the COMM port,but when I call the FM from a program I am not able to get the output value from the FM.I am calling the FM from the report program.please find the code below.
report test.
data : lv_input TYPE c.
CALL FUNCTION 'ZFM_WEIGHINTERFACE'
EXPORTING
MODE = 0
COMMPORT = 1
SETTINGS = '1200,N,8,1'
OUTPUT = ''
IMPORTING
INPUT = lv_input
EXCEPTIONS
NO_CREATE_OBJECT = 1
OTHERS = 2
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
if I execute the FM independently the output is getting perfectly.but while calling from a program i am facing the issue..
any suggestion is appreciated.
Thanks
Vivek -
How can I read a serial port using XCode?
Hello,
I'm using an iMac 2009 with Mac OS X 10.6.7. I have a USB to Serial cable and I want to connect a hardware I made using a microprocessor Microchip PIC to my mac. I'd like to read values from the serial port and also write values to it. I'm already able to do this using the Terminal with the following command:
screen /dev/tty.usbserial 9600
I'd like to build my own application now. Does anyone could send me any sample code?
I'm using XCode 3.2.5 and I'm a beginner on XCode.I looked at Dev Center for sample code, and I found this link:
http://developer.apple.com/library/mac/#samplecode/SerialPortSample/Introduction /Intro.html%23//apple_ref/doc/uid/DTS10000454-Intro-DontLinkElementID_2
I downloaded the sample Xcode project and, when I click on "Build and Run" button, it generates an error with the following message:
"GCC 4.2 is not compatible with the Mac OS X 10.4 SDK (file SerialPortSample.c)"
Maybe, it occurs because the code is too old (2005). I didn't find any newer sample.
Could you help me?
Thank you. -
Problems with access to serial port using reentrant code
Hi,
I have a VI that send commands and receive answers from an instrument using
de serial port.
This VI runs perfectly when used alone.
However I'm trying run two instances of that VI simultaneously using
reentrant code and I'm facing some problems.
Sometimes everything is OK but sometimes, in the process of writing to
serial port the following error happen:
Error code 36.
Invalid refnum device.
What is this?
Does someone know how to prevent this?
Thanks in advance for any help."Paro, Paula [CMPS:2721:EXCH]" wrote:
>
> Hi,
>
> I have a VI that send commands and receive answers from an instrument using
> de serial port.
> This VI runs perfectly when used alone.
> However I'm trying run two instances of that VI simultaneously using
> reentrant code and I'm facing some problems.
> Sometimes everything is OK but sometimes, in the process of writing to
> serial port the following error happen:
> Error code 36.
> Invalid refnum device.
>
> What is this?
> Does someone know how to prevent this?
>
> Thanks in advance for any help.
You can't use reentrant vi's vith serial vi calls without supervising of
driver.
Use VISA instead and you have to control the VISA session opening and
closing. Another word is that the only one serial port sess
ion should be
opened at a time.
Reentrant vi's for serial port without checking serial port session is a
mistake of program algorithm. Change it in any convenient way.
Sergey Krasnishov
Automated Control Systems
National Instruments Alliance Member
Moscow, Russia
[email protected]
http://acs.levsha.ru -
Plot more than one analog value to a waveform chart by reading from Serial Port
I have 4 LDRs and I want to plot their values to a waveform chart by reading them from the serial port. I have looked around and found an example of a VI plotting one value to a waveform chart (attached below) but I am unsure about how to expand this for 4 different waveforms, mostly because I don't particularly understand the way is being read currently. If someone could either point me in the way of a relevant example or explain/show me a solution, or explain howthe current VI I have works, that would be greatly appreciated.
Attachments:
LDRread.vi 20 KBSince I assume each LDR (whatever that is) has its own serial connection, you will need to read from 4 different serial ports. From there, just form an array of all the data and write to the chart.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions -
Controlled reading from serial port
I'm trying to establish a connection to an external device through the serial port. This is done in a while-loop which sends an association request tries to get a response if a response is not recieved a new rewuest is sent, etc. At the moment this procedure does not work. I am considering two explanations for this. The first is that the loop does not wait long enough for a response to come and simply keeps pumping out requests, the other is that there is something wrong with the reading algorithm, that doesn't let it properly take in information from the serial port.
Solved!
Go to Solution.
Attachments:
association_loop.GIF 5 KB
read_visa.GIF 8 KBI made a new version of the read case. The old version was a while loop, the new version is a while loop which will go on until it encounters an EOF character. In this case it is
0xC1 or 'Á'. I thought the old version would break before getting any message. This doesnt get any signal either. I have probed it, and it doesn't get a string from which to take the length.
Attachments:
read_visa2.GIF 10 KB -
Problem connecting N79 to serial port using blueso...
Greeetings to All,
I have a big problem, when i connect my n79 using bluesoleil v3.0, i got File transfer, dialup networking and object push services only.
If i try to start serial port service to connect my n79 to a serial port it displayes error "can not start service".
i have tried various bluesoleil versions but the problem remains same everytime. on the other hand i can connect my sony k750i to a serial port without any problem.
can someone tell me how to connect n79 to a serial port using bluesoleil
OR
Does N79 not support bluetooth serial port connectivity?
or is there any other way to connect n79 to a serial port using blesoleil and my bluetooth dongle on a WINXP SP2 system?
Thanks in AdvanceYes, PCSuite supports a great deal of Bluetooth drivers. These are all built in so, give it a try.
Windows Vista x32 en x64 editions:
Microsoft Windows Bluetooth stack
Toshiba Bluetooth stack, driver versie 5.10.12
IVT BlueSoleil Bluetooth stack, driver versie 5.0.5
Windows XP x64:
Microsoft Windows Bluetooth stack
Toshiba Bluetooth stack, driver versie 5.10.12
IVT BlueSoleil Bluetooth stack, driver versie 5.0.5
Windows XP:
Microsoft Windows Bluetooth (enkel in Service Pack 2)
Toshiba Bluetooth stack, driver versie 4.0, 5.0 and 5.10.12
WIDCOMM Bluetooth stack, driver versie 1.4.2, 3.x, 4.x and 5.x
IVT BlueSoleil Bluetooth stack, driver versie 2.x, 3.x and 5.0.5
‡Thank you for hitting the Blue/Green Star button‡
N8-00 RM 596 V:111.030.0609; E71-1(05) RM 346 V: 500.21.009 -
HI,
I need to read data from virtual serial (rfcomm - BT GPS receiver). I connect to my gps using system command:
[root@localhost ~]# rfcomm connect /dev/rfcomm0 XX:XX:XX:XX:XX:XX
and this creates port at /dev/rfcomm0, when I do :
[root@localhost ~]# cat /dev/rfcomm0
I get:
M,0.0,0000*76
$GPGSA,A,1,,,,,,,,,,,,,50.0,50.0,50.0*05
$GPRMC,000009.999,V,0000.0000,N,00000.0000,E,,,101102,,*17
$GPGGA,000010.999,0000.0000,N,00000.0000,E,0,00,50.0,0.0,M,0.0,M,0.0,0000*7E
$GPGSA,A,1,,,,,,,,,,,,,50.0,50.0,50.0*05
and the only problem is what to do to read this sequences via java application. I obtained package comm2.0.3.zip , but have no idea what next. I would be grateful for any help.
best regards
joshuaI did everything described here:
http://www.geeksville.com/~kevinh/linuxcomm.html
got an example from:
http://java.sun.com/developer/releases/javacomm/SimpleRead.java
(the defaultPort = "/dev/term/a"
replaced with
defaultPort = "/dev/rfcomm0")
i connect to my gps with:
[root@localhost ~]# rfcomm connect /dev/rfcomm0 XX:XX:XX:XX:XX:XX
start the application and get an error:
java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver
gnu.io.RXTXCommDriver cannot be cast to javax.comm.CommDriver
at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:239)
at javax.comm.CommPortIdentifier.<clinit>(CommPortIdentifier.java:109)
at comm.SimpleRead.main(SimpleRead.java:78)
Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z
at com.sun.comm.SunrayInfo.isSessionActive(Native Method)
at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155)
at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100)
at javax.comm.CommPortIdentifier.<clinit>(CommPortIdentifier.java:138)
at comm.SimpleRead.main(SimpleRead.java:78)
Java Result: 1
i think i did everything about rxtx as described. could anyone help?
best regards
joshua
Maybe you are looking for
-
How can I transfer music from my iTunes account to my daughters iTunes account
How can I transfer music from my iTunes account to my daughters new iTunes account?
-
PR to PO ...Standard text problem
Hi all, I am writing one report , which converts the purchasing requistion to purchase order. I am using the BAPI function module...BAPI_PO_CREATE1. In this i want to populate the purchase order header text. I am using the standard text for all po's
-
Installing windows 8.1 onto Mac Book Air (mid 2012)
Hi, trying to install Windows 8.1 on my Mac Book Air (mid 2012) when using early stages of bootcamp assistant i get the error message"Your bootable USB drive could not be created. An error occurred while copying the windows instalation files" Help?!
-
Auto Create lines without clicking configurator button
Hi All, Is there anyway to create related items automatically if a model item is entered in sales order form with out clicking configurator button. Thanks Kranthi
-
Garbled gnome-shell after hibernation resume with nvidia GPU
Hello, Using the proprietary driver 346.35-4 on GF106 [GeForce GTS 450] on a desktop (64 bits). After fiddling with the hibernation and mkinicpio hooks, it does work now, but when resuming from hibernation the whole display is garbled/tiled. Restarti