Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

IVI Drivers - OK to use SetValue rather than specific Config functions

Solved!
Go to solution

This is a general IVI driver question, although I am currently using C# with the agesani driver provided by NI.

 

The IVI specifications provide many methods for configuring devices (e.g., ConfigureLevel, ConfigureAcquisition, etc.).  The IVI spec also requires that all drivers provide support for configuring attributes through SetValue.

 

Question: Can all configurations be done through SetValue, or is it necessary to use the specific "Configure" methods?

 

Thanks .. and apologies if this a lame question.  Still learning about IVI.

 

0 Kudos
Message 1 of 4
(3,408 Views)
Solution
Accepted by topic author dasher

Hello Dasher,

      It is possible to configure all of the writable attributes through the SetAttribute functions, but that is not the recommended approach.  The Configure methods were designed to configure related attributes in logical manner.  Sometimes one attribute must be configured before other attributes.  The Configure functions should take this into account.  If you use the SetAttribute functions directly, you will probably need to learn more about how the instrument operates and responds to commands.

 

Cheers,

 

NathanT

0 Kudos
Message 2 of 4
(3,379 Views)

You mean SetAttribute and not SetValue?

 

Most IVI drivers can be programmed through the attribute model. I think I am right in saying that there will always be an attribute for a setting but not always a method. Methods are provided as a user convenience to deal with issues that the instrument vendor may know better than the user. e.g if there are attributes for range and resolution a user can set one and the other may change in the instrument - so a user needs to be aware of this. So in this case there will also be a method provided that takes the 2 parameters and if it is possible then the driver will send the right commands - generally it just call the 2 appropriate SetAttributes for you. But there are cases where it is not possible to get the desired resolution on certain ranges and the method can then return an error or warning.

 

As a general guideline it is easy to create a Get and Set Attribute for every setting in the instrument and then layer on top of that methods that group common attributes together or deal with coupling issues that I mentioned above.

 

 

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

Thank you for the responses.  Yes, I meant SetAttribute, not SetValue.  I suspected that order might be important for certain types of configurations, but just wanted to verify.  If order wasn't so crucial, I could have had a simpler interface for some control software I was developing.   Thanks again for your help.

 

 

 

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