LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NI VISA read stops at zero character, returning an 0xBFFF003E error

Hi

 

I’m trying to read some serial data from a UUT using the NI-VISA read function. The data is mostly text but does include some control codes. The first of these appears after the ‘OK’ in the Serial Bytes window on the front panel. More text should follow but for some reason, the read function stops at the first zero character (index 144 in the Byte Array), and returns an 0xBFFF003E (-1073807298) error. I found another thread where someone had a similar problem and I’ve tried the fix for this plus a few other things, but nothing’s worked. If I use Hyperterminal, the entire data block is returned as it should be.

 

I wondered if this was anything to do with the 7.1 version of Labview I’m using (upgrade is on the cards). The version of NI VISA I’m running is 4.2.

 

Very much appreciate any thoughts.

Thanks

Bruce

 

Read serial bytes BD.png

 

Read serial bytes FP.png

0 Kudos
Message 1 of 4
(2,568 Views)
I really don't see anything wrong in the code. I did something very similar with TestStand and monitoring a product during bootup. Does it consistently error at the same spot? Are you using a usb-serial converter? If so, what is the driver it uses? What happens if you ignore the error?

You could try updating the version of NI-VISA. I don't know the latest that supports your old version of LabVIEW.
0 Kudos
Message 2 of 4
(2,519 Views)

The error code itself is a generic VISA error which often happens with USB to RS-232 interfaces. Does your device connect to the PC through USB as a virtual COMM port? If so what chip and Windows driver is it using?

 

Also your function somehow looks wrong. The only criteria for the read loop to terminate is if there is an error on the VISA read or the Teststand termination status gets true. Generally if you use VISA Bytes at Serial Port you are almost always doing something wrong! That function does absolutely not synchronize with anything in your data. You will read whatever is there at that moment and that could be a partial message, no bytes at all (LabVIEW is typically many times faster than any serial device even if it is super high speed), or multiple messages.

Rolf Kalbermatter
My Blog
0 Kudos
Message 3 of 4
(2,466 Views)

Dennis & Rolf, thanks for your replies.

 

The Com port I’m using isn’t a USB-serial converter. It’s from a 4-port RS232 PXI card (a PXI-8420/4 which I think is obsolete now?). This sits in a 1045 chassis and connects to the PC via a MXI-4 link. I’ve installed the 4.4.1 version of NI-VISA which looks to be the last release compatible with LV 7.1, but it’s not made any difference.

 

The error does occur at same place. If I ignore it, the read continues and I get the rest of the control codes, followed by the remaining text so I guess this’ll be the workround.

 

The routine is just a cut down version of what I’m actually using and this does have other exit conditions. I call it via TestStand which is why the termination monitor is in there. The case statement includes a ‘0’ case to handle 'no Bytes at Port' and all I do when this occurs, is wait 250 milliseconds.

 

Thanks

Bruce

0 Kudos
Message 4 of 4
(2,439 Views)