Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Does anyone have an example VI demostrating asynchronous RS422 Communication

I have to communicate asynchronously with a UAV Engine's ECU using a National Instruments RS-422 card. I've been able to communicate in one direction, but not both directions.

Anyone have a VI that illustrates the proper methodology? Any info would be useful. Thanks
 

0 Kudos
Message 1 of 10
(4,923 Views)

Did you connect all wires?  (at least 5)

And did you verify that the card was set for 422?

 

greetings from the Netherlands
0 Kudos
Message 2 of 10
(4,915 Views)

Thanks Albert for getting back to me. We have 5 pins wired. Pins 1,4,5,8,9. We are using the National Instruments PCI-8432 card. The card is suppose to handle 422 and 485 protocols, which I believe are electrically the same. I don't believe there is a switch between the two protocols. It has two ports and when I cable the two ports together, I can send data from one port to the other without a problem. I'll be sending a "heartbeat" packet with a CRC value to the ECU on the engine and listening to the return packet from the ECU with all the data such as cylinder head temp, throttle position etc. Trouble is, I don't know when to talk and when to listen.

0 Kudos
Message 3 of 10
(4,907 Views)

Hi

In rs485 mode you need to tie the ports together but not in rs422 mode.

 

rs422 sends on one pair and recievs at the other, asynchronously.

Where rs485 sends and receives via a protocol and the send and receive lines are connected to one set, that either sends or receives.

 

maybe you have connected the send to send on the other side and also receive to receive. So you see you can send but nobody listens?

 

or is the endcharacter such that it is not recognised?

greetings from the Netherlands
0 Kudos
Message 4 of 10
(4,899 Views)

I didn't mean to accept the previous post as a solution, Sorry.  I am not aware of a way to switch the card from 485 to 422. I thought that the two wires for transfer work together to produce 1 bit. The bit consisting of the difference in potential between the two wires and the same for the receiving pair. If you could upload a VI that illustrates what you are saying, I would greatly appreciate it.

 

 

0 Kudos
Message 5 of 10
(4,876 Views)

You are right in that the two wires work together.

but still you can have a problem between the wires on one end to wires on the other end.

What I tried to say was: have you connected send on side A to receive on side B and send on side B to receive on side A?

greetings from the Netherlands
0 Kudos
Message 6 of 10
(4,865 Views)

Yes the 5 & 9 pins are connected, as well as, 4 & 8.

0 Kudos
Message 7 of 10
(4,863 Views)

On both sides same pin numbering?

Could you make a drawing of the connection?

greetings from the Netherlands
0 Kudos
Message 8 of 10
(4,861 Views)

I hope the attached jpg image helps. I have just discovered on this NI Board a thread from 12-06-2009 which asks about "timed serial data transmission" from a man named 'jack1'.

The VI that you helped him with, will also be useful to me. Its what is inside the case statement that sends the data to the ECU that I don't know about.

 

I don't have the ECU to experiment with just yet, but what I've done is cable the COM ports between 2 computers together. I have no problems sending a Labview cluster converted to bytes along with a CRC value to the port and then reading the bytes and converting back to a cluster on the other machine. If I write and then follow with a read, won't I prevent the ECU from being able to read what I've written?

 

The serial connection to the ECU is on COM4. Will I open both a Read Port and a Write Port to this COM port and then time my reads and writes?

 

Thanks again Albert, you've been a big help.

 

0 Kudos
Message 9 of 10
(4,854 Views)
Seems ok.
Now baudrate, etc and maybe endcharacters are left.
And ofcourse the commands.
greetings from the Netherlands
0 Kudos
Message 10 of 10
(4,849 Views)