07-16-2014 05:08 PM
Fahad80,
I am by no means an RS-485 expert, but RS-485 is a full-duplexed protocol in 4-wire mode. The control pin I believe you are talking about is the DTR line which controls whether or not to transmit or receive. As I stated earlier, myRIO does not have the DTR signal avaliable -- that is why I said you can only use 4-wire mode or 2-wire auto. It sounds like you are wanting to use 2-wire DTR which is not possible with myRIO as we describe.
In 2-wire mode, the TX pin itself is used as the control pin. When you are transmitting (TX pin is high), the transmitter is turned on and data is sent on the wire. When you are not transmitting, the receiver is turned on. As you stated, all of this is automatically handled in our sbRIO boards since they have the transceivers on-board and all the logic to switch wire modes.
Again, as you stated, one other option would be to use a DIO line on the myRIO to control the transceiver. You could write LabVIEW code that toggled that line when you wanted to transmit and toggle it back to receive. I am not well versed in the driver itself, however.
07-17-2014 07:51 AM
Ok, I got it. The device I wanted to interface only accept 2-wire. Don't know how 2-wire auto works, need to dig deep on that.
If Tx works as control pin it wont high all the time, because it will carry lots of high-low bits. That mean in the middle of the transmission it will stop transmitting.
But thanks a lot for helping me out. I really appreciate that.
02-22-2017 05:21 PM
02-23-2017 05:57 AM
hello tannerite
i want to interface RS485 with MyRio
if i understood you correctly,
In 2-wire mode, the wiring must be like is showed in this picture
If you have a solution, can you help me ?
02-23-2017 09:53 AM
Hi yusuf5,
From the wiring diagram you sent, it is not clear if "Port RS485" means that it is being wired directly into a RS-485 interface which is not compatible with UART 3.3V logic levels and will damage the myRIO. RS-485 requires a transceiver that translates UART single-ended logic levels to RS-485 differential logic levels that are compatible with an RS-485 interface. Many companies sell RS-485 transceiver ICs that can be integrated into a design. In general, "A+" and "B-" infer that those pins are differential and are on the bus-side of the transceiver.
Therefore, if B+ and A- in your diagram expect RS-485 communication, then you need to add an RS-485 transceiver after the myRIO UART interface.
02-23-2017 10:26 AM
tannerite, thanks for replying
it's me who made this wiring diagram to better describe my idea ,
yes, you are right B+ and A- in the diagram expect RS-485 communication
so it's impossible to wire directly RS-485 to UART pins of MyRio !
the RS-485 transceiver must be like this for exemple ?
or an USB/RS485 is better ?!!
or there is another type of transceiver ? please show me the best one which is compatible with MyRio?
thanks
03-02-2017 02:34 PM - edited 03-02-2017 02:58 PM
Hi yusuf5,
I cannot recommend a particular RS-485 transceiver and as stated earlier in the post, I have not tried this on a myRIO. The myRIO UART interface was really meant to be used with an RS-232 interface and it doesn't have the TX and RX enable signals that RS-485 requires. I believe someone above pointed that out and I am not sure if they ever fully addressed that issue.
While you did not list the below breakout part, I believe that is an SP3485 transceiver from a Sparkfun breakout board. It looks like this breakout is going EOL, however. Again, It appears to be +3.3V logic on the UART side; however, this transceiver breakout board needs an RTS signal which connects to the TX and RX enable, which the myRIO UART interface does not have.
03-02-2017 02:42 PM
03-02-2017 03:09 PM
Looking at that breakout board in more detail, that is only a half-duplex transceiver, where as before i mentioned you will need a full-duplex transceiver. After a quick search, there are many full-duplex-only transceivers out there that do not have enable pins; therefore, they are always enabled. Please take a look. The one i found quickly was the SN65HVD1471 full-duplex, 3.3V transceiver from TI. Again, I haven't tried it but it may get you on the right track.
03-03-2017 04:33 AM
Hello tannerite