From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

RS422 coms with PXI-8433

Hi guys,

 

 

I’ve got a sensor communicating over RS422. It came with a RS422/USB converter and my code works absolutely fine with VISA.

 

The sensor is intended to be used with a PXI and a NI 8433 (RS485/422) module. The PXI is running Linux RT and all required drivers are installed. I’ve set the port settings for the module as per the converter module running on Windows.

 

The problem I’m facing is that the sensor doesn’t seem to respond to the commands when using the PXI. If I set the sensor from Windows to output data, I can read the data through the PXI though. I just can’t get the commands to work for some reasons.

 

Any idea what I am missing there? Would there be a difference in syntax somewhat? I’m literally just using the simple serial example to send the same commands. A simple command for instance would be “GETINFO\n” and it returns all the infos about the sensor. I’ve also tried \r\n but makes no difference. Wiring should not be a problem as I wired a DB9 male connector to the converter box so I can quickly switch between the converter and 8433 module. 

 

For reference, I’m running LV2020 and the PXI is a PXIe-8661. 

Hope one of you guys may be able to help me.

 

Thanks,

Fred

0 Kudos
Message 1 of 13
(2,239 Views)

You might have some handshaking turned on, which can prevent sending of data.

 

My other thought is your port is configured for RS-485 2-wire communication.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 13
(2,200 Views)

Hi crossrulz,

 

Thanks for your message.

 

I've just double checked, I don't have any handshaking turned on and the RS-485 port is correctly set to 4-wire communication.

 

Anything else to suggest?


Thanks,

Fred

0 Kudos
Message 3 of 13
(2,187 Views)

Any chance of a picture of the serial code that you're running?  The addresses and how you're targeting the commands.

 

Just to admit my dumb experience, you don't try "Local Host: Command" so it works on Windows but not PX and you hsould be sending "Remote OS: Command"?  Stumped me a friend on my their first serial setup....

Regards,

Ben Johnson
ʕง•ᴥ•ʔง
0 Kudos
Message 4 of 13
(2,168 Views)

Hi Ben,

 

Here's the simple test code I'm using to send commands. The "TRIGGERSW" command returns the measurement from my sensor.

 

RS422.PNG

We've tried different configs with a colleague using VISA test panel but no luck at all.

 

To be honest with you, I'm not sure what's the difference between local host and remote os command? But I've tried to plug the RS422/USB converter directly to the PXI and it works all OK like that!

 

Thanks,

Frederick

0 Kudos
Message 5 of 13
(2,155 Views)

How about the obligatory termination resistors? Your USB converter may just have them build in, with most NI interfaces you can switch them on and off with a VISA property (which is an NI driver extension, so won’t work with non-NI hardware even if that hardware has such an option too). 
RS422 and 485 should be terminated on both sides of a differential line with a 120 Ohm resistor but for short cables it works if you only have one termination! Without any termination however it usually won’t work (reliable).

Rolf Kalbermatter
My Blog
0 Kudos
Message 6 of 13
(2,143 Views)

And if the interfaces don;t have the same 0V level, which can happen if there are galvanic isolations, you might need a 0V connection.

Terminators (like Rolf suggested) and 0V connection should always be used if you want a reliable connection.

 

Kees

0 Kudos
Message 7 of 13
(2,118 Views)

Thanks all for your inputs.

 

I already did put a 120 ohm resistor on my DB9 connector and the sensor and DB9 connector are both grounded to the PSU. Not sure where to look at anymore!

 

Fred

0 Kudos
Message 8 of 13
(2,108 Views)

Hi,

 

Some other items:

 

Have you configured the port as RS-422 (4 wire)

Can you try to swap the data Lines (+ and -)  Some manufactures believe that this is normal and call the A- and B+

Sure about the baudrate

 

Can you tell a bit more about the sensor or share the manual.

 

Kees

0 Kudos
Message 9 of 13
(2,092 Views)

Hi Kees,

 

The port is configured by default to RS-485 4-wire. As you can imagine, the baudrate is also correctly set up. 

 

Since I've added male and female DSUB connectors to easily switch between the PXI and USB connector, the wiring is correct as it works perfectly fine with the USB converter. I've opened the USB converter yesterday to check the termination resistors and I could see the 120 Ohm on Rx, which is what I have on my DSUB connector, so physically I don't see any difference.

 

You can find the manual for the sensor here .

 

I run through everything with a colleague and my manager and we really can't find anything wrong! I'm just hoping someone will spot whatever the stupid thing I'm doing here 😁

 

Thanks,

Fred

0 Kudos
Message 10 of 13
(2,078 Views)