Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Can VISA process such frame? Why I got BFFF006B error? Need help!

Solved!
Go to solution

Hello,

 

I have a device that sends out the message by RS232. But the message package is a little different from normal operation. For example, if the message is FF 06 43 02 C1 02, the ninth bit of the first byte FF is set to '1' and the rest of bytes are set '0'. To send message to the device, I have to change parity between 'mark' and 'space'. But how to receive such data package with VISA? I use the normal receive routine, it said that there's frame errorSmiley Sad

 

Is there anybody got similar problem? Much thanks!

0 Kudos
Message 1 of 8
(5,119 Views)

There's not really anything such as a "normal" receive routine. Your error indicates a mismatch in the com settings between the instrument and the pc. Impossible to say what you should be setting since you have not provided the instrument make and model, it's manual, or your code.

0 Kudos
Message 2 of 8
(5,099 Views)

Thanks for reply!

 

But my device send out the data frame which the parity setting is different for each byte. How can I receive such message with VISA?

0 Kudos
Message 3 of 8
(5,071 Views)
I don't believe the parity is changing with each byte. You need to attach the instrument's manual.
0 Kudos
Message 4 of 8
(5,059 Views)

Here is my device protocol document. In data layer section at page 6 there's description for the data frame. The ninth bit of one byte is called frame bit. It is set to '1' only for the fist byte of the message.

 

Actually I have implemented this protocol with win32 program. And made a dll file called in Labview program. Now I want to implement all with Labview, but I got such problem. Much thanks for reply!

0 Kudos
Message 5 of 8
(5,052 Views)
Solution
Accepted by topic author btzhang

Hi,

 

You can implement the ninth bit protocol in LV. I use it all the time.

 

In my system the first byte has the ninth bit set and for all others bytes the ninth is zero. It looks like different parity for normal UART's, so you get a parity error.

You can use 'Mark' and 'Space' parity to force the parity bit to '1' or '0'. Send the first byte with a 'Mark' parity and the remaining bytes with a 'Space' parity.

Receiving byte with either parity will result in a parity error. Just ignore that error.

 

The downside is that you cannot see which byte is the first byte. But in a test-setup it works for me.

 

Normally this kind of interface is handled by a Microcontroller like the 80C31.

 

 

Kees

 

 

Message 6 of 8
(5,042 Views)

If you expand K C's solution a bit you should be able to identify the first byte: Set receiving parity to Space. If you get a parity error, it was a first byte - sent with Mark parity. Check for that specific error and when found process as a first byte.  All others should not generate a parity error. This assumes that the Read returns the 8 data its even if a parity error has occurred, which I have no easy way to check. It sounds like it does from what K C reportred doing.  Of course if your transmission path is noisy and you get real parity errors, this will not work.

 

Lynn

0 Kudos
Message 7 of 8
(5,023 Views)

Thanks for your help!

 

I always got problem on receiving data. I'm going to try ignore the parity error in my program. But now I build dll by C code using WinAPI to work with LV:)

 

0 Kudos
Message 8 of 8
(4,866 Views)