Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot get RS-485 RX buffers to flush

I am using the PCI RS-485/2 card with Labview 6.1.

I have the card set up for a buad rate of 115,200, odd parity, 1 stop bit 8 data bits in 2-wire mode with echo and DTR control.

When I send an RS-485 message, I am able to read and display it. However, when I read a message from my device I get the message and display it, but it does not seem to be being flushed by the buffer. The TX messages are being flushed.

In fact, if I disconnect my device and run my labview VI a second time I still get the messages my device sent when it was hooked up last time.

I do not have this problem if I exit my VI.

I have tried the VISA clear and VISA flush I/O buffer.

Note that I did modify the clock on my RS/485
card, so that I can get an odd baud rate of 128,000. That may be where my problem lies. However, if that were the case, I don't understand why it flushes when I read transmitted data and not received data.

VI attached.
0 Kudos
Message 1 of 2
(3,153 Views)
Hello,

It seems like a good idea to eliminate your program in this scenario and try just a basic VISA serial write/read to see if the problem still exists there. I believe that the LabVIEW 6.1 example is called "LabVIEW <-> Serial" which should do this. Try to replicate the same behavior on this program by sending a string to your remote that will give a response, then disconnecting the cable and running the VI again. It sounds like this should give you the response back again; if it does, we can troubleshoot more here. If it does not, then we can focus on the programming differences between the two VI's.

Also, I'd like to know what version of VISA you are running as well as your operating system.

The viClose VI at the end of your program should be c
learing out all the receive buffers. Remember that if you are using the 2-wire mode with echo that your receivers on your 485 board are always enabled and that anything you write out the serial port will automatically be received on that same port. Thus, if you are getting the same data back that you wrote then this is expected behavior.

See this KB for more information on wire modes:

http://digital.ni.com/public.nsf/websearch/E905D94CF3C0601D862565EF004D5D7F?OpenDocument

Hope this helps.
Scott B.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 2
(3,154 Views)