LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Transmission data via RS232

Hi everyone,

 

I'm trying to implement an adquisition systems of different values of voltage (using PSoC devices). I configure the device to send the information via RS232. The issue is that when I get the value in labview, the first time the VISA resource read the value is correct, but if it not change lately, read badly. I give an example: The device sends the value 1,5678, the first time the VISA reads the same value 1,5678, but the second reading it is 78 1,56 (is like if the values ​​are disrupted). When I change the value sent by the device to 2,5 do the same (th first ok, and the second disrupted).

 

I don't know what is happening. I test it with Hyperterminal to see if it was problem of the Device, but in it works perfectly so, I dont know what is happening in Labview. I have installed the VISA 5.0 and Labview 2009.

 

 

 

Thanks for your support! 

0 Kudos
Message 1 of 3
(2,184 Views)

It sounds like your device is constantly sending the result, and I'm guessing you're reading a fixed number of bytes. The reason why it works in HyperTerminal is that HyperTerminal is continuously reading the serial port and simply displaying whatever characters are in the serial port buffer. The device should be appending some sort of character to indicate the end of the value. Look in the programming manual for the device to see what it says regarding this. You can then enable terminaton for VISA Reads and set the termination character using the VISA Configure Serial Port, as shown in the examples that ship with LabVIEW. Or, you can just read whatever is on the serial port and append it to a buffer and then extract your number from there.

0 Kudos
Message 2 of 3
(2,177 Views)

Hi,

 

Thank you very much for your fast response... I had no idea what was happening... You are right! the device sent continuosly. Could you give any idea how to implement the buffer you mention for after extrac the value from there?

 

Do you think is better to apply this solution or it will be better to send from the device a send out carriage return?

 

 

Thanks for your feedbacks!

0 Kudos
Message 3 of 3
(2,171 Views)