LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial Communication in LabVIEW - Extra Rx when using LabVIEW

Hi All,

 

Good evening and I hope your well. 

 

I am using LabVIEW 8.6 and VISA to write to a serial device. Baud rate is high (115.2k).

 

This device is generating an RF signal and is simply sending messages to change the power of this signal. I am able to send one message to the device successfully using LabVIEW and HyperTerminal. The problem comes when I wants to send multiple messages. When I construct a string that contains 100 messages separated by the EOL characters \r\n and does a single VISA write then it takes about 2 minutes for the device to step through all of the commands. When I write the same string to the device using another bit of software eg. HyperTerminal it takes about 3 seconds.

 

The serial device is connected to the LabVIEW computer via a serial interface board and this has two LEDs on it (Tx and Rx). My monitoring these LEDs I am able to get a bit more of an idea about what is going on. When I send a string which only  contains the termination character \n both Tx and Rx the LEDs flashed instantaneously showing the serial comms, this did not generate the required response though as the device needs the termination \r\n. As soon as you use the \r character, the Tx and Rx LEDs flash but then there is an additional read that is done by the LabVIEW machine. This is what seems to be slowing down the communications. This additional read is not observed when using other software such as HyperTerminal.

I have the log files, but this is the summary:

Results:
0ms Delay Capture.spy
- 9:53:32.508 I start to send Labview info
- 9:53:37.789 Labview Closes the last VISA

HyperTerminal2.log
- 10:31:06 I start to send HyperTerminal Data 

- 10:31:06 It finishes


I understand there are several differences between HyperTerminal and LabVIEW, namely speed and buffer size. But, I am not convinced this is causing this behavior on this one command which involves sending multiple messages. I have also seen the same issue with CVI - as LabVIEW. So this suggests to me its either the VISA layer handling the command differently to HyperTerminal, or LabVIEW requires the command to be altered firstly (which I guess could be speed..). 

 

I am aware that Dennis in the past has recommended using HyperAccess but the cost is a factor at this point in time. 

 

Another interesting piece of information, when HyperTerminal is set to emulation mode VT52 - the same results as produced with LabVIEW/CVI. The mode which works in HyperTerminal and is required is VT100. From what I have read, if it works in HyperTerminal then the battle is almost complete. But not in this case. Does anyone have any suggestions to find out what this extra read might be.. My knowledge of Terminal Emulation is amazing, but could escape characters be a factor?

 

Summary:

What is it about this mode that is being handled differently in LabVIEW (CVI) then in the Hyperterminal and is it related to this extra Rx?

Or, Is it more to do with the command I'm trying to send and the VISA layer? 

 

Any thoughts or suggestions I'd be very grateful to here - I know a few of you out there have experienance (worked very closely) with VT100 emulation and with serial.

 

Kind Regards, and have a pleasant day.

J. 

Message Edited by Gap.In.My.Knowledge on 01-15-2009 02:33 PM
0 Kudos
Message 1 of 4
(3,169 Views)
I have NOT ever recomended HyperAccess over VISA except in the case of true VT100 emulation. I have also never noticed a speed difference between sending multiple commands with Hyperterminal or VISA. I've also never tried to construct a single string with that many messages, though. I think it's simpler and clearer to put the VISA Write inside a for loop and pass in an array.
Message 2 of 4
(3,159 Views)

Hi Dennis,

 

Sorry to mis-quote you - I didnt mean any harm. 

 

I wasnt very clear - I wanted to make the point, that I could use something like HyperAccess in LabVIEW to get around the issues I am having with the VISA LabVIEW API. 

 

So how would passing an array get around this issue of the extra Rx which is being generated (Delay) when the message is sent to the UART by LabVIEW?

 

And did you have any insight into the differences between VT52/VT100 and VISA?

 

Thanks for your rapid response and insight,

Message Edited by Gap.In.My.Knowledge on 01-15-2009 03:09 PM
Message Edited by Gap.In.My.Knowledge on 01-15-2009 03:14 PM
0 Kudos
Message 3 of 4
(3,143 Views)
I don't see any RX unless there is an actual VISA Read or handshaking is turned on. Could you post your code and an NI-Spy capture?
0 Kudos
Message 4 of 4
(3,130 Views)