07-22-2014 04:13 AM
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!
Solved! Go to Solution.
07-22-2014 04:25 AM
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)
07-22-2014 08:01 AM - edited 07-22-2014 08:03 AM
@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
07-22-2014 08:07 AM
Thanks Zach - I wasn't aware of the System Configuration API.
Thanks for pointing me in the correct direction! It is highly appreciated...
07-22-2014 08:29 AM
@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.
07-22-2014 08:32 AM
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!