Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Proper Equipment Initialization

Hello,

One thing that has always bugged me is "what should I do for proper equipment intialization?"  When I write a program, the program itself does not know the status of the equipment I'm controlling.  For example, the testset may have just been turn on, it may have been running all day, or it may have a hanged GPIB bus.  The issue I'm trying to figure out is, how do I properly initialiize the equipment to remove all errors.  I currently do the following:

 

Clear

loop on SYST:ERR? until no errors are present on the testset.

*RST

*CLS

(Also, overide any defaults that are necessary depending on the testset)

 

I'm not sure if this is all that is necessary or not, but I was hoping someone could help confirm.

 

Thanks!

0 Kudos
Message 1 of 4
(4,732 Views)

Hi,

 

I don't see any problems with the current way you initialize things. Some people make sure to clear errors at the end of their programs, but what you do would be the best way to make sure you don't get any once starting up. 

 

If you're using LabVIEW we also have the GPIB Initialization Function that can help out with all of the initizialization efforts. http://zone.ni.com/reference/en-XX/help/371361J-01/lvinstio/gpib_initialization/     We should also have similar functions in CVI or Measurement Studio.

Daniel Parrott
Software Product Marketing - Data Management & LabVIEW
National Instruments
Message 2 of 4
(4,669 Views)

I just realized that the *CLS will clear the errors so there is no need for the syst:err? loop.  I'm using C#, but I am using the VISA drivers.  I used to use LabVIEW so I just used the initialize function, but since i don't have LabVIEW installed anymore, i couldn't find documentation on what it does.  Thanks for the reply.

0 Kudos
Message 3 of 4
(4,664 Views)

What you're doing looks fine. 

You can iterate through the loop if you want to capture/present the errors, otherwise just *CLS and *RST will get things done.

Then set your specific test parameters after that.

0 Kudos
Message 4 of 4
(4,652 Views)