07-30-2010 01:30 AM
Hi. May I know how the task in NI MAX can be modified programtically each time a different NI USB device is attached, without any user to do anything?
I have created few taks for NI USB-6221, However, when the NI USB-6229 is attached, Dev 2 appears instead of Dev 1.
Can we create a program that automatically updates the task in NI MAX before the actual operation of the new device?
Please advise.
Thanks in advance.
Clement
Solved! Go to Solution.
07-30-2010 02:11 AM
Hi,
Sometimes I use either a USB-6501 or USB-6008 but I search to see which is connected based on the model I want and return the 'Dev' number. See attached, hope it helps.
Regards,
07-30-2010 04:32 AM
Hi I think I did not not make myself clear. In case of changed model (NI USB device) with similiar specifications, we delete the missed device in NI MAX and replaced the DEV1 with DEV2 and the following tasks will be updated immediately. So can it be same way for labview program that automatically replaced the device abd update the tasks automatically after change of device, without any user interference.
Clement
07-30-2010 05:01 AM
Hi Clement,
you need some user interaction in every case. If you programmed your device with the name like "Dev1" you only need to change the device in MAX and everything works fine. So if you want to replace your 6221 with an 6229 all you need to do is change the name from Dev2 to Dev1 (delete Dev1 before that or change the name) and your LabVIEW programm will work with the new Dev1 device.
How many devices are connected to your PC at the same time?
Stefan
07-30-2010 07:17 AM
Hi, if I understand you correctly, if you use the code I showed then it doesn't matter what the Dev number is. It only matters if you have more than one device attached to the PC of the same model. If you only have 1 device connected at any one time then the code I showed would retrieve the Dev number for that device and your task code can then use it. I don't believe there is any need to change Dev assignments in MAX.