LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I retrieve the MAX "Configurable Initial Settings" from within an IVI driver

Solved!
Go to solution
MAX allows you to set "Configurable Initial Settings" that can be retrieved from within a driver to pass in implementation-specific information. I found the Knowledge base entry http://digital.ni.com/public.nsf/allkb/3B6F209F7851514886256F700062ACD6, but it's somewhat less than helpful on defining how exactly to retrieve the Initial Settings. I can't find any IVI library function that does it, I'm obviously mission something. Any suggestions would be appreciated.
Paul
0 Kudos
Message 1 of 24
(5,513 Views)
To be specific: the cited document, "IVI Configurable Initial Settings" says that "During initialization, the initial settings you specified [in MAX] will be applied by the IVI Engine and attributes will be set to the values you configured." But where do the MAX settings end up? There's a naming convention or something here that isn't being specified. If I give a setting the Software Module Key "XYZ" in Max, does the engine look for a defined attribute with the name "XYZ", or "PREFIX_XYZ", or "PREFIX_ATTR_XYZ", or what?
0 Kudos
Message 2 of 24
(5,479 Views)
Hi,
 
 But where do the MAX settings end up?
IviConfigurationStore
 
You can find more information in the spec on ivifoundation section 6.6.5.1
0 Kudos
Message 3 of 24
(5,448 Views)
I've got that. What it doesn't say is how to retrieve them. Do they end up as attributes that I access using the regular Get Attribute functions? If so, what name do I use?
Reading through Section 3.5 - Configuration Server Specification, they seem to end up in the Configurable Components Collection, accessed through a IviConfig_GetConfigComponentDataComponentCollection() function, but it's still not clear how the information put in in MAX relates to what is retrieved.
0 Kudos
Message 4 of 24
(5,439 Views)
Hello Pblase,
        Which specific attribute(s) are you interested in?  You should be able to read them by using Prefix_GetAttributeViString or the whichever GetAttribute is appropriate for the datatype of the attribute that interests you.  Look at the GetAttribute function panel for more information and for the different attributes that you can choose.  You can also call into the Config Server API.  For more information, please see this KB.

Cheers,

NathanT
0 Kudos
Message 5 of 24
(5,421 Views)

Actually, there are two items.

1) Under the "IVI Drivers/Advanced/Instrument Driver Software Modules" section; "Configurable Settings" Tab MAX allows you to set a Configurable Setting: Name, Software Module Key, Type, and Default Value. Supposedly, if I understand things properly, during the initialization process the IVI Configuration Server copies this _somewhere_ so that I can access it from within the driver to configure the driver for a specific instance. However, no where is it clearly stated _where_ it puts it, or how to retrieve it. Exactly how is the question; if I understand things correctly, the Default Value ends up in an attribute named with the entry in "Software Module Key"  and can be retrieved through the IviConfig_Get<ItemName>Count functions (IVI-3.5, Section 3 and Section 4). However, there are no examples given on how the driver should "read through the virtual identifiers collection." (3.6.2) and retrieve the value.

2) Presumably, the driver may also retrieve the other information in the Configuration Store, such as the Description entered in the Driver Session entry in MAX. Again, instructions on how to get these from with a C program (LabWindows/CVI) are lacking.

0 Kudos
Message 6 of 24
(5,418 Views)
Hello Pblase,
        Any IVI settings that you change in MAX are added to the IviConfigurationStore.xml file when you click on "Save IVI Configuration".  Depending on which version of ICP was first installed on your system, the file will either be located at: C:\Documents and Settings\All Users\Application Data\IVI Foundation\IVI or somewhere under C:\Program Files...   If you can't find it, let me know which version of ICP was first installed on your system and which version you currently have installed.
        I encourage you to add some Configurable Settings to the Config Store and then take a look at the xml file.  (CTRL+F is very useful)

Since the IVI Engine already provides a way to apply the Configurable Settings (Ivi_ApplyDefaultSetup ()), I recommend that you use that.  I don't see any other exported IVI Engine functions that would allow you the granular control of retrieving other information from the Config Store.  This is where the Config Store API comes in.  Please give that a try.

Cheers,

NathanT
0 Kudos
Message 7 of 24
(5,398 Views)
Ok, so if I have a configurable setting with the key "XYZ" for a Driver Session, which attribute does it end up in, and does ApplyDefaultSetup() create the attribute, or do I have to create it first (with the LabWindows/CVI Attribute Editor) and leave it blank?
0 Kudos
Message 8 of 24
(5,391 Views)
Hello Pblase,
        ApplyDefaultSetup() does not create attributes.  You would generally use the configurable settings for attributes that were already part of the IVI Specific Driver.  If you are considering creating an attribute to only use for configurable settings, you might want to consider using a driver setup string instead.  Before the driver is initialized, most (if not all) of the attributes should be "invalid" until they are used, in which case they are populated and validated by either the Read or Write Callbacks.

Have a superb weekend,

NathanT
0 Kudos
Message 9 of 24
(5,374 Views)

NathanT says:

<blockquote>        Any IVI settings that you change in MAX are added to the IviConfigurationStore.xml file when you click on "Save IVI Configuration".  Depending on which version of ICP was first installed on your system, the file will either be located at: C:\Documents and Settings\All Users\Application Data\IVI Foundation\IVI or somewhere under C:\Program Files...   If you can't find it, let me know which version of ICP was first installed on your system and which version you currently have installed.
        I encourage you to add some Configurable Settings to the Config Store and then take a look at the xml file.  (CTRL+F is very useful)</blockquote>

 

Ok, I'm back on this again.

I need to retrieve the Description entered into the Hardware tab of a Driver Session of MAX. I have perhaps a dozen Hardware Elements (instruments), and a Driver session associated with each one. My top-level program is about 3 levels up on top of a class driver. So, I initially call the instrument with the logical name assigned in MAX, e.g. "Left hand widget". This, in turn, is associated through the various MAX mechanisms to a particular hardware element and a GPIB address (GPIB0::10::INSTR). In the Driver session, then, are various descriptions which may be entered, and which end up in the .xml configuration store file, saying that "Left hand widget" is, in fact, "Serial number 123, located on the left hand optical bench". This is what I need to retrieve and display on my control panel. Is there a utility that will retrieve this stuff, or do I have to parse the xml file?

 

 

0 Kudos
Message 10 of 24
(4,976 Views)