LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

RS485 Interfacing pins in myRIO

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.

Tannerite
National Instruments
Message 11 of 21
(3,176 Views)

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.

0 Kudos
Message 12 of 21
(3,162 Views)

hi fahad80

i want to interface RS485 with MyRio

If you have found a solution, can you help me ? 

0 Kudos
Message 13 of 21
(2,951 Views)

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 

 

 

Sans titre.png

If you have a solution, can you help me ? 

0 Kudos
Message 14 of 21
(2,940 Views)

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.

Tannerite
National Instruments
Message 15 of 21
(2,927 Views)

tannerite, thanks for replying 

it's me who made this wiring diagram to better describe my idea Smiley Wink

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 ? sfe-uart-to-rs-485-converter-2_1.jpgsfe-uart-to-rs-485-converter-3_1.jpg

 

or an USB/RS485 is better ?!!

Capture.PNG

 

or there is another type of transceiver ? please show me the best one which is compatible with MyRio? 

thanks 

0 Kudos
Message 16 of 21
(2,923 Views)

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.

 

Tannerite
National Instruments
Message 17 of 21
(2,909 Views)

Hi tannerite,

thanks for replying

really i appreciate your help  !Smiley Wink

0 Kudos
Message 18 of 21
(2,905 Views)

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.

Tannerite
National Instruments
0 Kudos
Message 19 of 21
(2,899 Views)

Hello tannerite

But I think that I have a half-duplex communication here because at the device, I only have three outputs : A, B and GND 
0 Kudos
Message 20 of 21
(2,890 Views)