06-16-2017 08:15 AM
Hi everyone,
I want to specify the simulated instrument Model in the "Driver Setup" field in NI MAX. In NI MAX I gave the Driver Setup as follows:
Model:4137
I then create an instance by calling the `IviDCPwr_init` function. However if I then query the `IVIDCPWR_ATTR_INSTRUMENT_MODEL` attribute, I see that the option was ignored and only a 'NI PXI-4110' was created instead of the 4137.
What am I doing wrong?
(The only workaround I found is to I use the `IviDCPwr_InitWithOptions` function and pass the option string as a parameter. But I want to be able to configure the options in NI MAX.)
06-19-2017 12:35 PM
Just create the simulated device in devices and interfaces
06-20-2017 02:47 AM
Although this is a workaround, I see several drawbacks to the method of creating a simulated device and assigning it as a hardware asset in the IVI Driver session:
1. It is only needed for the NI-DCPwr driver, hence different from other drivers and confusing. (So far I tested one other NI driver (NI-DMM) and a couple of drivers of other vendors. All others behaved as expected when giving a DriverSetup string in NI MAX.)
2. The configuration happens outside of the IVI Configuration Store, which kind of breaks the "have only one source to manage your instruments" that the IVI Configuration Store provides.
3. The workaround only works for devices for which NI MAX provides the possibility to create simulated devices. This is only a very small subset of devices usually encountered in the lab.
4. It only works if NI MAX is used as tool to manage the IVI configuration store.
06-21-2017 12:30 PM
I’ve attached a NI-DMM Simulated Devices article below that offers another solution of initializing the instrument in LabVIEW.
NI-DMM Simulated Devices: http://digital.ni.com/public.nsf/allkb/3C7A39FCA065E46D862572C900712938
Does this seem like it would be a more suitable workaround for your application?
ShaneK
Applications Engineering
06-22-2017 02:00 AM
Hi Shane,
thanks for the tip, but both solutions given in the article have the issue that they potentially break interchangeability:
The first method given in the article is the same like Jeff mentioned earlier.
The second method also is problematic if you switch to another instrument because the syntax of the Driver Setup is not standardized. For example to simulate a certain model, NI instruments expect something like "Model:4130", while a Keithley driver expects "Model=MODEL 2450".
I will file a bug report about the issue because to me it clearly looks like unintended behavior that the DriverSetup string from the IVI Configuration store is ignored (especially since the issue only occurs with the NI-DCPower driver, and not to other drivers like NI-DMM, or other vendor's drivers.)