Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Example VI BasicWriteandRead.vi reads back junk.

Hello All,

I am new to LabView, and I am currently trying to talk to a device connected through a serial port. (I am also new to working with serial ports…) When I use the BasicSerialWriteandRead.vi provided as an example, the data I read back is always a bunch of junk. The number of bytes read that is reported always matches the number of characters I entered, but the data read back does not match. Here is an example:

--> string to write: hello
-->read string: nunoo
(hit run again, and next string read is: nenno; next time it reads: oenno)

This connection uses the RS232 standard. When I use the example .vi mentioned above with another COM port listed, the input is echoed correctly, so I guess the problem has something to do with the specific device I’m talking to—maybe I don’t have the settings correct or something like that?

Any suggestions?

Thanks
0 Kudos
Message 1 of 4
(3,013 Views)
Get the correct communication specs for your device, if needed, contact the manufacturer.

Try communicating in Hyperterminal 1st before trying LV code, this way you know you have the correct baud, stop bits, parity, flow control.
~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 2 of 4
(3,008 Views)
Thanks for the reply. I definitely had the baud rate wrong. I still need some more info on my other settings, though.

By the way, now when I try to write to this port in Hyperterminal, I am getting an arrow-type character to the right of the returned characters (e.g., if I type 'd', I get 'd >' back--but that arrow is a solid black character in the actual terminal).

Does anyone know what that arrow (or triangle) means?
0 Kudos
Message 3 of 4
(3,000 Views)
It could be the termination character that the instrument is set up to transmit to signify the end of transmission. Though it is usually a carriage return CR or line feed LF.
~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 4 of 4
(2,998 Views)