LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I use RS232 library for RS485 communication? Alternatively, can I use NI Serial with non-NI 485 boards?

Hi-

I have successfully used RS232 library to communicate with one RS485 device.  I now have multiple devices using the same Rx and Tx lines.  Three of the 4 devices have their own dll and can communicate effectively despite each other.  My problem occurs when the one device I am talking to using the RS232 library now has to share the lines with the other devices.  Are there any ways around this? All I can think of is to see if I can use the NI Serial library commands with my non-NI PCIe card.  OR, buy the NI 485/422 card and use the NI Serial commands.  Any other suggestions? 

 

Thanks.

 

 

 

0 Kudos
Message 1 of 6
(4,279 Views)

The only interfaces you can connect with NI Serial are in the read me file.

 

http://download.ni.com/support/softlib//serial/Serial%20NickD/WIN3/Win32/readme.html#PciInterfaces

 

I can't think of much else to suggest but using NI Serial commands.

TimC
National Instruments
Applications Engineer
0 Kudos
Message 2 of 6
(4,251 Views)

I think the problem is that you cannot control the TX driver of the 4th device.

 

Using the RS232 library does not mean that the board cannot have its own driver.

I believe, that 4th device does probably have some advanced settings in its Properties window in Device Manager.

There you can set it to automatically turn off its TX driver when not talking.

 

After that you should still be able to control the port with RS232 library and it will behave according to the settings in Device Manager.

We can use Fastcom Commtech boards (which are configured for RS422 by defualt) in RS485 mode without problems with the RS232 library using this method.

 

Hope this helps,

S. Eren BALCI
IMESTEK
0 Kudos
Message 3 of 6
(4,234 Views)

The fundamanetal difference between RS232 and RS485 is the ability to connect to multoiple devices. The devices also normally work in a "speak only when spoken to" mode and this is achieve by adding a device address in the protocol. The NI serial library is oblivious to most of this and doesn't care if it's RS232 or RS485. The problem with your 232 device is that it will speak everytime when any other device is adddressed, so you should make it comply to 485 standards. This can be done with RS232 to RS485 convertors. You can do a search on Google for this. The ones I use and have the least amount of problems with is either from Advantech (<http://www.advantech.com/products/search.aspx?keyword=RS-232#search> and <http://www.advantech.com/products/search.aspx?keyword=RS-232#search>) or BB Electronics. (<http://www.bb-elec.com/Products/Serial-Connectivity/Serial-Converters/Port-Powered-RS-232-to-RS-485-...>)

 

Best Regards

Jattie van der Linde
Engineering Manager, Software & Automation
TEL Magnetic Solutions Ltd
0 Kudos
Message 4 of 6
(4,205 Views)

Eren Balci is spot on, but if you cannot see anything in the advanced properties you might also want to check if your RS485 card has any DIP switches to set the mode. Ours has.

 

Marcel

0 Kudos
Message 5 of 6
(4,178 Views)

Thank you all for the suggestions.  I will check the dip switch settings on the board.  The other thing I was trying to do was use the dll's that came with 3 of hte 4 devices.  For each device, the dll needs to open the port.  I think this is also a problem as the port should only be opened once, no matter how many nodes or devices are connected.  Right?  If that's the case, I will have to write my own ascii commands and not user the dlls that came with each device. Please let me know if I am wrong on this...

 

Thanks again for the help.

0 Kudos
Message 6 of 6
(4,175 Views)