Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Fetch IVI devices (logical names) in LV7.1

How can I fetch the IVI logical names for all existing instruments in LV7.1?  Before an instrument create (RFSA) is executed, I would like to see if resource (PXI1Slot2) already exists.
0 Kudos
Message 1 of 8
(4,566 Views)
Hello mbarone,
          Programmtically accessing the IVI Config Store is the only way that I know to programmatically get a list of all of the logical names.  "PXI1Slot2" looks like a DAQmx name and not a logical name.  Logical names are primarily for use with IVI Class drivers.  Which PXI card are you using?  I believe that any hardware resources should have been configured in MAX before running your application.

Cheers,

NathanT
0 Kudos
Message 2 of 8
(4,547 Views)
It's true that the name is identical to DAQmx convention as this becomes the Logical name when the instruments' Initialize VI is executed.  I am using the PXI-5661 with the RFSA IVI drivers.

In my current process, I initialize instruments by function (spectrum analyzer, modulation analyzer, frequency counter, etc.).  This creates issues with the IVI drivers when I want initialize the 5661 as multiple instruments.  When the "PXI1Slot2" resource is initialized multiple times, all previous items are unusable (the initialize makes a new copy PXI1Slot2 n) and only the latest instrument is valid.

I would like to check all available IVI logical names in memory and avoid creating multiple items.
0 Kudos
Message 3 of 8
(4,513 Views)
Hello mbarone,
          Instead of Initializing the same device multiple times, just initialize it once and pass that reference to the different sections of your application.  If you must initialize it multiple times, close it each time before re-initializing it.  It does not sound like you are using a IVI Class driver or logical names.  "PXI1Slot2" is a hardware resource descriptor, not necessarily a logical name.  A logical name is used by a class driver and it points to a IVI Specific Driver session.  NI-RFSA is a IVI Specific Driver.  Since you can't use the different instrument functions in parallel, you should not expect to maintain different valid hardware descriptors in parallel.

Cheers,

NathanT
Message 4 of 8
(4,495 Views)
I felt that running a close (and ignoring the error output) before any intialize was a bit brutish, but, it is a valid option.  I'm still interested in a way to search for existing IVI resource and not run the initialize if it exists (just pass the existing resource to instrument attributes).
0 Kudos
Message 5 of 8
(4,490 Views)
Hello mbarone,
       I am not suggesting a "brutish" close before your first initialize, but rather just recommending that you follow the coding convention of Open->Configure->I/O->Close.  I believe that if you follow this convention you will not have the problems with multiple open hardware sessions that are invalid.

Cheers,

NathanT
0 Kudos
Message 6 of 8
(4,465 Views)
I agree that following the Open->Configure->I/O->Close convention would eliminate the duplicate or multiple sessions if performed at the time test equipment is required.  However, our current process is to batch initialize all instruments before testing begins and use the existing resources when needed.  This doesn't allow for the convention suggested and (admittedly) is the reason behind this situation.
0 Kudos
Message 7 of 8
(4,460 Views)
Hello mbarone,
    Thanks for explaining more about your system's architecture.  If you are locked into that for now, you could pass all of the references in a cluster or other way.  You could also store whether or not each instrument has been initialized with a boolean.  Maybe someone else will have a better way.

Cheers,

NathanT
0 Kudos
Message 8 of 8
(4,432 Views)