Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Framing Error

Hello,

I am receiving a framing error with my application.  I have several pieces of equipment hooked up to my computer from which I take a reading about every 20 seconds.  One of them is an Agilent E3645A DC power supply.  The program runs fine usually for many hours but often times a framing error occurs while reading from the power supply.  As per a suggestion of a KnowledgeBase entry, I checked the IO configuration and made sure that everything matched up, which it did.  I have the device plugged directly into my computer.  Any ideas why this could be occuring?
0 Kudos
Message 1 of 9
(4,902 Views)

Hi Nick,

Do you have your configuration step outside of your loop(s)?  If the port only needs to be configured once for each device, then you can put this step outside the loop.  Also check that you have proper delays in your program.  If your configuration step takes too long and you start writing and reading from the resource before the configuration is done, you may see framing errors. 

Please also try an example program if possible.  I know you do not see the problem sometimes for a while, but it may be a useful test to see if an example shows the same behavior.

I hope this helps, but please post back if you are still having trouble.  Have a great day!

Chris R.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 9
(4,885 Views)
Hello,

Thank you for the suggestion; I removed the configuration step from the loop.  However the scan I was running last night again failed for the same reason, so are there any other things I could try?

Thanks!
0 Kudos
Message 3 of 9
(4,859 Views)

At what baudrate with what cable length are you communicating?

Sometimes framing errors come from noise on the line.

 

greetings from the Netherlands
0 Kudos
Message 4 of 9
(4,835 Views)
Hello,

Cable length is ~2m, with 9600 baud.
0 Kudos
Message 5 of 9
(4,827 Views)
9600 with 2 meter never gives that noise so it must be a handshake or bad electronics problem. 
greetings from the Netherlands
0 Kudos
Message 6 of 9
(4,820 Views)
Hello,

Thanks for the analysis; it appears I should contact Agilent.  Until then, is there some way I can bypass the error?  For example, will turning on automatic error handling help, or is there some way I can manually have it try to read the data again if a framing error occurs?
0 Kudos
Message 7 of 9
(4,816 Views)
One thing you could try is catching the error coming out of the VI (by unbundling the error cluster), and write some code in a Case Structure to handle it.  The Case Structure would choose its case based on whether the status was True or False. The code in the true case might consist of a Read Measurement VI (or a Fetch) that overwrites the previous reading.  You could probably put the error into a shift register so that it attempted to read the data until it succeeded.  You might even try reinitializing the whole instrument, but that could be difficult or impossible with a power supply (as opposed to something passive, like a DMM).

For the false case of the structure, just tunnel the outputs like you would normally.

Also, make sure that you replace the error data with a clean "No Error" error cluster.

Hope this helps!
0 Kudos
Message 8 of 9
(4,807 Views)

Hi Nick

Please attach your vi or vi's in a zipfile.

maybe something very simple parallel is going on in your code !

greetings from the Netherlands
0 Kudos
Message 9 of 9
(4,799 Views)