07-10-2014 09:38 AM
Hi,
I wanted to communicate with a device through RS485 from myRIO. But from manual what I got is, they only have UART Tx and Rx pin. I didn't find anything about RS485 in the whole manual. Is that mean myRIO don't have RS485 interfacing (like sbRIO. They have separate onboard RS485 connector).
I don't even find any appropriate example. I did try to implement RS485 through VISA (by changing wire mode property node), but gives error..
07-10-2014 09:57 AM
07-10-2014 10:01 AM
Yaiks!! Thanks though! So this is the only way?
Why they didnt just assign some pins for that
07-11-2014 11:11 AM
Greetings fahad80
There is another possibility, outlined in this document. Let us know what you decided to do or if you have additional questions.
http://www.ni.com/white-paper/9595/en/
Warm Regards,
Luis J
Applications Engineering
National Instruments
07-11-2014 04:03 PM - edited 07-11-2014 04:04 PM
ASRL3 do show up, but status in MAX is showing 'Not Present'. Is it supposed be that?
07-11-2014 07:50 PM
Sorry to say, but that USB-RS485 thing actually dont work. I guess, the author didn't actually test that. Linux RT do recognize the device and load the driver for it, but as he occupied the device, NI-VISA don't have access of it. Also NI-MAX depict this device's status as "Not Present".
So if we unload the FTDI driver (ssh->rmmod) then NI-Max can detect the device but as an USB raw device. That mean, I can't use the already available RS485 library. Because they look for any serial port.
I wish there were some PORT for RS485 like sbRIO.
07-15-2014 01:02 PM
One thing I think worth mentioning is that there are UART TX and RX lines on the MXP connectors that can be used to interface with a serial transceiver. They cannot use "2-wire DTR controller" or "2-wire DTR controlled with echo" modes because the DTR lines do not exist on myRIO; however, you can use 4-wire or 2-wire auto modes depending on how you configure the transceiver.
I believe you can do multi-drop with 4-wire mode, but you cannot do multi-point. Multi-drop means multiple receivers while multi-point means there can be multiple transeivers and receivers. When in 4-wire mode, there are separate pairs for TX and RX, you can do multiple receivers but only one transmitter.
The UART TX and RX lines on myRIO were designed to be connected to a serial transceiver, whether it be RS-232 or RS-485. I hope this helps.
07-15-2014 04:35 PM
Hi Tannerite,
Thank you. I was thinking the same. So I hooked up a RS232 to RS485 conveter. And its working. The device receiving RS485 command from myRIO.
Now, there is still a lil bit problem. RS485 is not a full duplex protocol. To control Tx and Rx data there is a control pin in that converter IC. In sbRIO i didn't have to worry about this (i guess, it was handled internally). But in myRIO how can I control the communication flow?
One way to do this is manually handle the flow (by connecting the pin with digital I/O). Then i have to change the library files ( Dynamixel library). Because, in the library code, they configure the serial with visa and then change the property node (wire mode) to RS485, assuming there might Be RS485 port in the device or laptop.
Any suggestion?
07-16-2014 04:02 AM - edited 07-16-2014 04:09 AM
@fahad80 wrote:
Sorry to say, but that USB-RS485 thing actually dont work. I guess, the author didn't actually test that. Linux RT do recognize the device and load the driver for it, but as he occupied the device, NI-VISA don't have access of it. Also NI-MAX depict this device's status as "Not Present".
So if we unload the FTDI driver (ssh->rmmod) then NI-Max can detect the device but as an USB raw device. That mean, I can't use the already available RS485 library. Because they look for any serial port.
I wish there were some PORT for RS485 like sbRIO.
Did you make sure to have NI-Serial installed and deployed to the myRIO device? That is the NI driver that should be able to talk to all kinds of NI-RS232 and NI-RS422/485 hardware. Without that the NI Linux RT OS might try to load standard driver modules that aren't exactly able to deal with the specifics of the NI hardware. You definitely would loose any RS-485 specific VISA properties as that is only supported by the NI-Serial driver and none of the standard FTDI drivers.
EDIt: Never mind, NI-Serial seems so far not to be available for NI Linux RT targets.
07-16-2014 09:44 AM
Yeap, I tried. And yeap you are right, they are not for myRIO. Literally I tried everything. 😞