LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

problem with serial reading of Hexadecimal string data

Hi
 
I am having a real problem reading hexadecimal strings via my serial interface using serial read/write in LabVIEW.
 
(I have attached the code I am using to read into LabVIEW over the serial link).
 
When I run the VI it does collect the hex data, but after it collects the data the VI fails to stop.  In fact some fatal error occurs as LabVIEW crashes altogether and I have to re-start it!
 
Has anybody else had this problem?  I am very interested to know because a colleague of mine says he recalls somebody having a similar problem a few years ago (probably LabVIEW version 6 then) but can't remember how they corrected it.
 
Many Thanks
 
Ashley
 
 
0 Kudos
Message 1 of 5
(2,928 Views)
Can u please send me the code in 6.1 version.actually i dont have 7.1.its very easy.first u configure ur serial port prperly.make sure that the other device with which u r communicating has the same configuration.then send some command if the other device needs to reply and place a read vi in while loop and provide he end of string logic.and ultimately close the serial port.
thank u
0 Kudos
Message 2 of 5
(2,913 Views)
Hi Ashley:

Your VI is fine to read from serial

Just check:

* 'VISA resource name' to be the port you are using to communicate
* 'delay before read' is enough to the other machine to respond
* if 'Bytes at port' is 0 or the command is not ok, or the other machine needs more time.

(If you don't have any answers yet, try the ending of your command with just a '\n', or put a '\n' at start also.)

Aitortxo.
Aitortxo.
0 Kudos
Message 3 of 5
(2,913 Views)
Sorry, I missundestood.

If you can read from serial, the problem is not this VI, but the other where you try to read Hex

Aitortxo
Aitortxo.
0 Kudos
Message 4 of 5
(2,911 Views)

Hi Guys

I've solved the problem.

In the VI I posted on the board the code execution was halting at VISA close.  Why? Well I can't answer that, but with VISA close removed from the VI the Hex data can be read just fine.  The answer was thus to put a delay between the VISA read data and VISA close. 

Thanks for your advise anyway.

Regards

Ashley

0 Kudos
Message 5 of 5
(2,888 Views)