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.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Visa Read returns the framing error (0xBFFF006B).

Hi I am a newbie and I am working on to communcate to a MDB. The Communication Format is as follow:

Baud Rate: 9600 NRZ

Serial Bit Format: 1 Start Bit

8 Data Bits

1 Mode Bit

1 Stop Bit

 This is how to send data and read data from the MDB:

 

00001xxxB (08H)          Changer

                                                                      Mode    Address      Command

Coin changer reset                          0x108           1         00001            000

Coin changer setup                         0x109           1         00001            001

Coin changer tube status                0x10A           1         00001            010

 

 I read on NI web site to use the parity Mark to set the mode bit. When I try to read data from the MDB I get a  framing error (0xBFFF006B). I also read in another forum to test the Mark using the Measurement and Automation explorer. I try it and still get the error. I am a bit lost on how to communicate to the MDB. I try differrent setup but nothing works. I hope someone could help me on this.

 

Thanks

JJ

0 Kudos
Message 1 of 10
(6,188 Views)

Hi,

 

For some modules we have I also have to use an extra bit (9th bit) for the communication.

Sending data you change the parity to mark and space to add a 9th bit. But when you receive the same data (with either mark or space parity) you get a parity error (not a framing error).

You should catch this error and delete it.

I use this to communicate with modules in a test set-up.

 

Kees

Message 2 of 10
(6,175 Views)

Usually, a framing error is a baud rate issue.  Double check all of your serial settings and verify that the device is using the same.


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
Message 3 of 10
(6,166 Views)

I know my baud rate is set right but I will double check it. The unit I am working with will poll device on the bus. I am looking for when it polls b 1 01100 000 for the address of the slave  at this address. I have a couple of Idea on how to capture the data.

 

 

Thanks

JJ

0 Kudos
Message 4 of 10
(6,142 Views)

I do have another question that might resolve the Framing error. When the MDB poll all the device on the bus. How can I use the mark parity with the 0x60 data to be accepted by LabView when it see it on the Bus and not any othe address it may see. I am new at this and in the past I have written programs on a microchip to work with Labview via RS232 but this application is new to me because of using the Parity bit as a mode bit for the address. I know how to use a Pic chip to communicate to the device but I would like to use LabView as well.

 

Thanks

 JJ

0 Kudos
Message 5 of 10
(6,140 Views)

Hi,

 

You described the data with the Mode bit. Does this apply for both sides ?

If so you will always get a framing error on the received data. I use the same kind of communication (based on the old Intel 9 bit protocol)

 

Kees

Message 6 of 10
(6,136 Views)

Hi the MDB sends out the code with the mode bit with the address to the device. The device will reply back with the mark bit and an ack code to let the MDB know it is on the bus. Then the MDB will send addition code that could be up to 32 bytes to the device. I can write a code for the Microsoft Pic chip to and to talk to the MDB by using the parity Mark bit. I just having trouble using LabVIEW to talk to the MDB.

0 Kudos
Message 7 of 10
(6,125 Views)

Ok, This way you can change the parity After sending x byte(s) before sending the next byte(s)

 

Let me know if you understand this.

Maybe you also post your VI you have.

 

Kees

 

Serial Mark Space.png

Message 8 of 10
(6,120 Views)

I think that was my problem I was not setting the Mark back to space to read the data when the MDB sends data to Labview. I will give that a try tonight.

Thanks

 JJ

0 Kudos
Message 9 of 10
(6,113 Views)
I know this is an old topic. But I thought I would throw this in, just for future reference, of my find after having the"framing issue" on a serial port. My fix for the issue came from a simple trial and error, but it seemed to work.
I usually keep all my Vi's on a USB stick since I build and rebuild others (to make their's simpler and user friendly) Vi's at work for learning and the hassle of higher ups in my company not liking the little guy (me) being smart.
So I went to work on the same Vi that I hadn't ever had issues with before a month ago. Well I'm guessing the main-vi rearranged where it pulled the sub-vi(s) from is my only thought as to why this became an issue. But I figured that all my sub-vi's came off the USB stick and that is really where I wanted them to come from. Well my error came from the sub-vi on the USB stick that has the task to read an API (Angle Position Indicator) from off the serial port. I opened an older version of the same general Vi that was saved on the computer to see if the issue was hardware or software driven. It came out to be software driven. So this morning I decided to replace the sub-vi (on my main-vi on the USB stick)that read the serial port for this particular device to the copy of the sub-vi on the computer and everything work as it should.
So I guess the issue was that the main Vi (on the USB stick) was going back to read the sub-vi on the USB stick each time it cycled through the sequenced test points causing a lag in times between cycles and resulting in the"framing error". Which changes my thought of believing that the hierarchy of sub-vi's was loaded into memory on the initial loading of the main-vi.

Hope this helps anyone.....

R. Haas
0 Kudos
Message 10 of 10
(5,555 Views)