04-18-2013 06:19 AM
I have a production test program that uses two USB 6501 DAQs. Currently during development they're assigned Dev1 and Dev2 in MAX and my DAQmx drivers are set up for those addresses. This test fixture, when deployed, will be connected and disconnected from the production equipment, and other USB devices may be plugged into and unplugged from the production test computer in the interim, then these will be plugged in again when it's time to test this product, and the Dev assignments are likely to be different from Dev1 and Dev2. I know I can change them in MAX, but that's not practical. I want this problem and a solution to be transparent to the people using the test program, and I'd like to reassign or change Devs programmatically. Is this possible? If so, how?
04-18-2013 08:01 AM
There are two use cases with USB devices in general.
If the device has a unique serial number (As defined in the USB spec) then you can have a per-real-device differentiation like you require.
If the device does NOT have a serial Number (Many don't) then this cannot work because there is no "unique" identifier.
Assuming the device has an identifier, you should have to set the alias only once per host computer to get it working.
04-18-2013 08:43 AM
EXCELLENT insight! Thank you. It does have a serial number. Now how do I set the alias as you suggest?
04-18-2013 09:03 AM
I'm not sure if you're being sarcastic or not....
Either way, I think if you go into MAX and select the device in your system you should be able to define an Alias there. If you export the MAX settings, you should be able to import them on another machine. It's been several years since I've done that but if memory serves correctly, that's how it's done.
Shane
04-18-2013 09:06 AM
Just tried it ona simulated device. Right-click ont he name as it shows up in MAX and choose the option.............
-drum roll-
"Rename" and type in whatever you want to call it. I like the name "Fred".
04-18-2013 09:09 AM
System Configuration VIs will allow you to chance MAX device names
But...
I had a similar problem with 25 identical test sets each with 6 USB power supplies. Power supplies are swapped out for calibration just about weekly. The identifiers in MAX needed to be changed each time based off of their serial number.
Years ago I attempted to modify the setting in MAX and had some success using the now deprecated “MAX Copy Configuration” VI, but opted instead to query the test set to find the power supplies and what their references names where and store the device names. Then the program could care less what MAX had for their device names. There was some extra code to figure out which supply was which (1-6) that depends on how YOU are using your devices.
We have adopted a similar methodology for other test sets for ALL our instrument device references (VISA, DAQmx, GPIB, USB, PXI, LXI). Find what’s there and use whatever name MAX has for and not try to change it.
See the
System Configuration VI
GPIB Find listeners
VISA Find Resource
niModInst
Depending on the system, I use some combination these to find my instruments.
I also use Mico Soft’s DevCon function to find devices on my test sets.
04-18-2013 09:26 AM
The best place to edit aliases in MAX is under
Software/NI-VISA X.X -> VISA Options tab -> My System/General Settings/Aliases
If you assign 'MyDev1' alias to serial number 123, but then replace unit s/n 123 with unit s/n 456 you will not be able to re-assign 'MyDev1' to s/n 456 until you delete it from s/n 123. If s/n 123 is not plugged in you have to delete the alias here before you can assign the alias to s/n 456.
04-18-2013 09:49 AM
Omar and Shane, good information, and I'm not being sarcastic. This is just what I was looking for. I'll try these suggestions.
04-18-2013 09:52 AM
@hammer3 wrote:
Omar and Shane, good information, and I'm not being sarcastic. This is just what I was looking for. I'll try these suggestions.
No problem. Nothing personal. I haven't "seen" you around much so I don't know how to filter your posts. There have been a spate of rather rude and overly expectant users in the last years.
Either way, if I can help I will. Hope you get it working the way you want.