03-10-2009 01:58 PM
Hello Pblase,
I think that the IVI Configuration Store function "Ivi_GetInfoFromResourceName" is what you are looking for. Here is a description from the help:
This function returns the appropriate resource name and option string that Ivi_SpecificDriverNew function uses to create a new IVI session. The Resource Name can be an actual resource descriptor or a logical name or driver session name that the user configures with the IVI Configuration utility.
If the string that the user passes in the Resource Name parameter is an actual resource descriptor, this function returns the original resource descriptor and option string in the New Resource Name and New Option String parameters and returns VI_FALSE in the Is Logical Name parameter.
If the string that the user passes in the Resource Name parameter is a logical name or driver session name, this function returns strings in the New Resource Name and New Option String parameters based on the settings of the logical name or virtual instrument in the IVI Configuration Store. The function return VI_TRUE in the Is Logical Name parameter.
and help for the NewResourceName parameter:
If the string that the user passes for the Resource Name parameter is an actual resource descriptor, this function returns the original value of the Resource Name parameter in this parameter.
If the string that the user passes for the Resource Name parameter is a logical name or driver session name, then this parameter contains a resource descriptor that identifies the physical device based on the configuration of the logical name or virtual instrument in the IVI Configuration utility.
Another option is using "Ivi_IOSession" which is also available in the IVI Class Driver Wrapper VIs as a property under IVI Inherent Settings>>Advanced Setting Information>>IO Resource Descriptor
If your instruments return their serial numbers in the ID Query, you can also extract that data and identify the different instruments that way.
Let us know how it goes,
NathanT
03-12-2009 04:35 PM
03-16-2009 12:59 PM
Hello pblase,
According to section 3.3.5 of the IVI Driver Architecture Spec: An IVI specific driver applies the configurable initial settings for the session when the user calls the Initialize
and Reset With Defaults functions.
Adding a Configurable Setting to the Software Module makes it possible to configure that setting in the Driver Session. To actually have it applied to the instrument driver session, you must choose to use it in the Driver Session and configure it.
Section 6.6.5.3 defines the Software Module Key as: A string that the IVI driver uses to identify the attribute and the repeated capability instance, if any. The IVI driver defines the contents of the string. Configuration utility programs should not display the string to the user.
There can be many Driver Sessions that use the same Software Module. You would only want to programmatically read the Configurable Settings in the Software Module to see what could possibly be configured initially. To find out what a specific Driver Session configures initially, you would want to programatically read the Driver Session settings in the Config Store.
Here is a Knowledgebase Article that explains it in more detail: KB 3GJATSBJ.
Cheers,
NathanT
03-16-2009 01:24 PM
03-17-2009 08:37 AM
Hello pblase,
Here is an example call to GetAttribute:
checkErr( Ivi_GetAttributeViAddr( vi, VI_NULL, AGN6700_ATTR_INSTR_INSTRUMENT_MODULES_RANGES, 0, (ViAddr*)&pinstrument_modules));
The attribute names are mostly defined in the header file, and the hidden attributes are defined in the c file.
An easier way to check and see is to run a NI-Spy capture and see if the correct instrument command was sent to the instrument (or just confirm that the instrument has the setting that you configured, not the instrument's default).
Cheers,
NathanT
03-17-2009 09:02 AM
checkErr( Ivi_GetAttributeViAddr( vi, VI_NULL, AGN6700_ATTR_INSTR_INSTRUMENT_MODULES_RANGES, 0, (ViAddr*)&pinstrument_modules));
>The attribute names are mostly defined in the header file, and the hidden attributes are defined in the c file.
Except that MAX knows nothing about either one.
Please read this carefully, this is getting frustrating since it's obvious that you aren't understanding the original question:
Again, the problem is: if I set up a "Configurable Setting" in MAX for a Driver Session, with a Name of "StageDescriptor", a Software Module Key of "STAGE_ATTR_StageDescriptor", type = "String", and Value = "ABCDEFG", when I initialize the Stage driver and call "Ivi_ApplyDefaultSetup", the defined Stage driver Attribute "STAGE_ATTR_StageDescriptor" does not end up with the value "ABCDEFG". I have tried various combinations of Software Module Key values, and STAGE_ATTR_StageDescriptor never gets initialized. Nor can I find out what is being initialized with that string.
Of course, there is no table that I know of that allows MAX to associate the string in the Software Module Key with the .h file tag "STAGE_ATTR_StageDescriptor".
So: where is the initialized value ending up, and how do I get it where I want it to go? There are no examples of how to do this, and (unfortunately, as usual) inadequate documentation.
03-18-2009 09:20 AM
Pblase,
Please provide answers for each of these questions:
1. What is the exact manufacturer and model of your instrument?
1A. Does it fall under one of the existing IVI Classes?
If Yes: Are you using the appropriate IVI Class Driver?
If No: Are you using a Custom Class Driver OR are you initializing the specific driver with the IVI Logical Name?
2. Are you using an IVI-C Specific Driver?
2A. Is it NI-Certified and NI-Supported?
3. Which Development Environment are you using (I know that you mentioned CVI)?
4. Are you currently using a live instrument?
5. Will your application use multiple Driver Sessions that use the same Software Module?
-NathanT
03-18-2009 10:01 AM - edited 03-18-2009 10:05 AM
I just tested the initial configurable settings of the agn6700 with the following settings and code:
I could change the value in the Driver Session, save the Config Store, and then run the example again and see the different value. I am using the full attribute name of "AGN6700_ATTR_DIGITAL_PIN3_FUNCTION" for the Software Module Key and made sure to use the IVI Logical Name to initialize the Specific Driver.
-NathanT
03-18-2009 12:11 PM
1. What is the exact manufacturer and model of your instrument?
1A. Does it fall under one of the existing IVI Classes?
If Yes: Are you using the appropriate IVI Class Driver?
If No: Are you using a Custom Class Driver OR are you initializing the specific driver with the IVI Logical Name?
2. Are you using an IVI-C Specific Driver?
2A. Is it NI-Certified and NI-Supported?
Newport NPESP300 Motion Controller and motion stages.
I'm writing my own drivers, using the LabWindows tools and the IVI standards.
There are actually 3 drivers: the NPESP300 instrument driver, a MotionController class driver, and a Stage driver that lets me control a stage regardless of which controller it's attached to. The system is configured using the Hardware Asset, Driver Session, and Logical Name capabilities of MAX.
3. Which Development Environment are you using (I know that you mentioned CVI)?
LabWindows/CVI 8 under Windows XP
4. Are you currently using a live instrument?
Yep
5. Will your application use multiple Driver Sessions that use the same Software Module?
Yep
03-18-2009 12:12 PM
I just tested the initial configurable settings of the agn6700 with the following settings and code
Thanks. Now I just have to figure out what I'm doing wrong.
Paul