Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

PXIe 8431/8 serial card in RS-422 is sending out the wrong number of bits

Solved!
Go to solution

I'm using a PXIe 8431/8 serial card in RS-422 configuration to talk to a device that has the following settings Baud rate 38400, 7 data bits, 1 stop bit, odd parity. I've confirmed that the device definitely has these settings as I can communicate with it using a separate Linux PC.

 

When I try using the NI serial port, the device does not respond. So, I connected the NI serial port to my Linux PC to see what the NI port was sending. It is garbage. Unprintable characters, control commands and other characters are transposed (e.g. I send ascii character "1" and get ascii character "a").

 

I've made sure to add the terminating 120Ohm resistor on the NI RX+ and RX- lines as mentioned in other posts on these forums but that is only for receiving and has not solved the problem.

 

I've put an oscilloscope on the TX+ and TX- lines coming from the NI card and the trace looks reasonable in that the rate of bits being sent out is correctly 38400 and the voltage levels are correct moving between +/- 3V. What I did notice is that the NI serial card seems to be sending out 11 data bits. I would expect 10 bits (1 start bit, 7 data, 1 parity and 1 stop). I changed to 8 and then 6 data bits and the total number sent out went to 12 and then 10 respectively.

 

I get the same behaviour whether I use Labview VIs, the VISA panel for the port in MAX or, removing the NI software entirely and use Hyperterminal. This would seem to indicate that the problem is something in the low-level settings on the NI card itself.

 

I've tried a second PXIe-8431/8 card and same results, so it's not a fault card (could be two faulty cards I suppose!!).

 

Any ideas???

 

Many thanks in advance,

Ian

0 Kudos
Message 1 of 4
(3,499 Views)
Solution
Accepted by topic author IDavies

Have found out what the issue was: used a scope to display the trace from both the Linux PC and the NI serial port to compare them. The NI trace was significantly longer than the Linux one. When I measured the width of the whole NI trace, it worked out to have a frequency of about 33,000, which is far less than the 38400 that it had been set to. I was getting the wrong characters because each data bit from the NI port was out of synch with the Linux PC.

 

I increased the baud rate of the NI port and found that setting it to 45,000 made it line up correctly with the Linux PC and I now have communication between the two devices.

 

For info, I did not need the 120Ohm termination resistance or the grounding line to be included in the serial cable between the NI and Linux ports.

0 Kudos
Message 2 of 4
(3,486 Views)

Ian, I am glad you were able to solve the problem, but you shouldn't have to enter the wrong baud rate like that. Which operating system are you using this on, and which version of the driver are you using?

0 Kudos
Message 3 of 4
(3,479 Views)

An even better solution has now been provided by NI. I downloaded and install v.3.6 of the serial drivers and the baud rates are now accurate.

 

For info, I'm using Windows XP.

 

 

0 Kudos
Message 4 of 4
(3,471 Views)