From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial communication with and w/o instrument i/o assistant

I am using a 485 network of modules which are measuring thermocouples and pressure xducers. The 485 network is connected through a 485/232 converter into com1. To sample a voltage or temperature I need to send a serial string such as #020 which identifies the module and channel I wish to sample. The network then returns something like this >+2.0345. I can get all of this to work from hyperterminal and by using the instrument i/o assistant, but when I try to use the serial.vi or serial communication.vi examples it returns no reading. It seems the vi is writing the port but nothing is being returned. Any possible solutions?
0 Kudos
Message 1 of 2
(2,844 Views)
Hi,

I have also tried to communicate with RS485.
The main problem is to switch the converter from send to receive. This is normaly done by the RTS line. You can do this with the serial control vi. But while this is done by the software you will get timing problems when the number of characters and the baud rate differs to much. If you have only a view characters and always the same baud rate, then it is possible to get a good result.
Do not set the rts line directly after your send string, because LV will send the data to the buffer and will continue with the program, maybe directly with toggling the rts line, but then some of the data are still in the send buffer. If then the rts line is switched, the data converter switch from send to receive and not all
data is transfered. You have to play with different delay settings in your software. It is a good idea to connect an oscilloscope to the serial lines.

Good luck
Gerhard
Hardy
0 Kudos
Message 2 of 2
(2,844 Views)