VirtualBench

cancel
Showing results for 
Search instead for 
Did you mean: 

Enumerate VirtualBench devices in LabVIEW

Solved!
Go to solution

I was wondering if it is possible to query the system for the available VirtualBench devices... 

 

For DAQmx & VISA I know how to do it but not for VirtualBench devices. 

I looked into the call library function node and noticed that there is a function called "lv_LCI_GetDiscoveredDeviceList" so it should be possible but I do not know the correct function prototype for this DLL function...

 

Anybody knows an alternative way to get the NI MAX device names for VirtalBench devices? 

Thanks for your help!

0 Kudos
Message 1 of 6
(7,825 Views)

Never mind... found the solution myself. 

Some trying with different function prototypes (& LV crashes) I was able to find the correct function prototype...

(see attached vi)

0 Kudos
Message 2 of 6
(7,822 Views)
Solution
Accepted by topic author noxus

@noxus wrote:

Never mind... found the solution myself. 

Some trying with different function prototypes (& LV crashes) I was able to find the correct function prototype...

(see attached vi)


First, I commend your spelunking to get this to work.  However, this is an internal entrypoint that may not continue to work into the future.

 

That being said, the recommended approach is to use the System Configuration API.  There is a shipping example called 'Show All Hardware' that does what you want.  It will return the 'Alias' for all NI devices on the system.  That is the name that can be used with the VirtualBench API to communicate with the device.  If you want to limit the devices returned simply specify 'virtualbench' as the 'Experts' input to Find Hardware.vi

------
Zach Hindes
NI R&D
Message 3 of 6
(7,808 Views)

Thanks Zach - I wasn't aware of the System Configuration API.

Thanks for pointing me in the correct direction! It is highly appreciated...

0 Kudos
Message 4 of 6
(7,804 Views)

@noxus wrote:

Thanks Zach - I wasn't aware of the System Configuration API.

Thanks for pointing me in the correct direction! It is highly appreciated...


No problem!  Let us know if you have any more troubles.

 

I should also mention that I just checked out your VI and the CLN Parameter configuration isn't quite right.  As you mentioned getting that wrong can cause LabVIEW instability, so I would recommend not using that VI.  Also, we have an internal distinction between 'discovered' and 'saved' devices that is subtle but significant.  The entrypoint you found may not be doing exactly what you want.

------
Zach Hindes
NI R&D
0 Kudos
Message 5 of 6
(7,800 Views)

The code based on the System Configuration API is already in place. I'm not using the 'hacked' code anymore. I prefer to use the 'right' way of doing things... Thanks again for your helpfull replies!

0 Kudos
Message 6 of 6
(7,797 Views)