Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Framing Error with PCI-8433 and MAX at 921600 baud

Solved!
Go to solution

We can successfully communicate with an instrument using the PCI-8433 interface card with the Microsoft VB.NET COM control. But we get a framing error if we try to read more than 44 bytes with MAX at 921600 baud. We get the same error using the Measurement Studio VISA interface in VB.NET (NationalInstruments.VisaNS.SerialSession).

 

At 115200 baud, MAX lets us read any length with that card. But at 921600 baud, MAX only lets us read up to 44 bytes (45 including the termination character). Note that the failed SCPI command requests 45 bytes but we read 46 to get the termination character.

 

We can read any amount with the VB.NET COM control. Both MAX and VB.NET COM are set to 921600 baud, 8 data bits, 2 stop bits and no parity. See the images below for the MAX error and settings.

 

VB.NET COM lets us reliably read any length at any rate up to 1843200 baud.

 

PCI-8433 Framing Error.png

0 Kudos
Message 1 of 9
(4,494 Views)

Could you please provide some more information about the device you are communicating with? Also, any information about the system you have set up would be helpful.

 

Thanks in advance,

 

Mitchell Faltin

Applications Engineer

National Instruments

www.ni.com/support

 

0 Kudos
Message 2 of 9
(4,437 Views)

This instrument supports RS-232/485, Ethernet (VXI-11), USB (USBTMC) and GPIB. The PCI-8433 works properly using the VB.NET System.IO.Ports.Serial class but NationalInstruments.VisaNS.SerialSession causes a framing error with larger (> 44 bytes) transfer lengths and fast baud rates. All other interfaces work properly. The reason we want to use NI-VISA is so we have a common API. NationalInstruments.VisaNS.SerialSession also works properly using the built-in PC COM port at 115200 baud.


Below is additional information about my system.
System Info.png

0 Kudos
Message 3 of 9
(4,426 Views)

Has there been any situation (MAX or VB.NET) that you have successfully sent a SCPI command at 921600 baud?

0 Kudos
Message 4 of 9
(4,418 Views)

USB and VXI-11 (LAN) are "serial" interfaces faster than 921600 baud and they work fine with NI-VISA. The reason we got the PCI-8433 was to get faster speed than a standard serial port. It's also attractive because of the high noise immunity (differential signals) and electrical isolation.

 

There may be a way to duplicate this problem by simply connecting the 2 channels together (swap TXD/RXD signals). One channel can be the VISA session opened in MAX and the other channel can be opened as a VB.NET COM port. We should be able to transmit a text string (with termination character) from VB.NET COM and then attempt to read it in the MAX VISA session. If nothing else, this exercise would help isolate the problem.

 

I'll try to set this up later today and let you know the results.

0 Kudos
Message 5 of 9
(4,414 Views)

We narrowed down the original problem. The VISA session works properly up to 460800 baud. When the read “fails” at 921600 baud (the next speed the instrument supports), the MAX VISA session actually reads the correct data but reports a framing error. On a scope, the RXD signal coming into the PCI-8433 has the correct timing. The instrument baud rates are within 0.16%.

 

One oddity is the instrument’s stop bit is slightly longer but this shouldn’t matter since the PCI-8433 receiver should resynchronize at the next start bit. Another strange behavior is some larger reads work. This indicates some type of buffering or threshold problem. Below is a summary:

Read length

Result

491-536

Good

537-546

Framing error

547-592

Good

593-602

Framing error

This is a repeating pattern of 46 good followed by 10 bad.

 

We then connected the 2 PCI-8433 channels together to eliminate the instrument. Channel 1 is a VISA session opened in MAX and Channel 2 is a VB.NET System.IO.Ports (COM). The MAX VISA session has no problems reading from VB.NET COM at 921600 baud.

 

Our theory is the NI-VISA driver for this card is overly strict. It interprets slight delays between bytes from the instrument as a framing error. The System.IO.Ports.Serial driver for this card is more relaxed, allowing reads of any length with no framing errors.

0 Kudos
Message 6 of 9
(4,403 Views)

It sounds like there may be something going on with the instrument you are trying to control. Form what I understand, when you hook up an output channel of the 8433 to an input channel of the 8433 there are no problems communicating at 921600 baud. But when you try to communicate with the instrument at 921600 there are problems... 

 

Is that correct?

0 Kudos
Message 7 of 9
(4,394 Views)

Nice Troubleshooting!

 

OK it looks like you found a limitation of the NI Serial driver.  I see you are using 14.0, try upgrade to 15.0.  NI Serial has a bit of overhead that NI has been steadily improving that effect max baud rate.  


"Should be" isn't "Is" -Jay
0 Kudos
Message 8 of 9
(4,389 Views)
Solution
Accepted by ray_martin

We updated NI-Serial to version 15.0 and it still failed. One big clue that led to the solution was the error wasn’t related to the overall transfer length but the alignment of the last byte in the instrument’s FIFO. After updating the firmware, NI-VISA now runs reliably at the instrument’s maximum speed (1843200 baud).

 

The mystery now is why the original firmware worked with VB.NET System.IO.Ports. It could be System.IO.Ports simply didn’t report the “error” since the data was correct.

0 Kudos
Message 9 of 9
(4,375 Views)