LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Do Express VI's attach to specific hardware?

I'm teaching introductory LabVIEW programming to undergraduate students. We're using Express VI's to read input from USB connected cDaq hardware. We have ten identically configured computers, including the LabVIEW software and USB connected hardware. It seems that LabVIEW programs that use Express VI's only run on the computer where the program was developed. If the program is run on another computer the Express VI's fail to detect the cdaq hardware (error 200220 I believe?). Students store their programs on USB drives. If they unplug the drive and then plug it into another computer the program fails with the above error. The only way to fix the problem is to delete the Express VI's and re-create them. Is this a bug?

 

Here's another complicating factor. Students sometimes move USB hardware from one computer to another. If they don't delete the previous hardware configuration in MAX then newly connected hardware takes the next sequential address. For example the new module becomes cDAQ2 instead of cDAQ1, even if cDAQ1 is no longer connected. If a program using an Express VI is created using cDAQ2 is moved to a computer that has only cDAQ1 then there's no way to reconfigure the Express VI to use cDAQ1 instead of cDAQ2. The Express VI configuration tool will not allow changing task channels from cDAQ2 to cDAQ1. Actually the tool complains about the change but it does accept it. But the program still fails with the above error.

 

 

 

0 Kudos
Message 1 of 4
(2,221 Views)

This does not sounds like expected behavior.

 

Which version of LabVIEW are you using? DAQmx drivers?

 

You should be able to open the Express VI and reconfigure.  You may have to delete the channels in the task and add the channels for the new device though.  I don't believe there's a way to just say "use this channel, but on a different device."

 

Are you using tasks created in MAX?

 

Also, you can delete hardware that is no longer connected to a computer from MAX (right-click on the item).  And you can rename the hardware to whatever name the Express VI is referencing (cDAQ1, cDAQ2, myDAQDevice, etc.).

Chris
Certified LabVIEW Architect
Certified TestStand Architect
0 Kudos
Message 2 of 4
(2,206 Views)

km4hr,

 

What you are seeing is actually expected behavior. Our DAQ devices are typically enumerated via the serial number, so when a daq device gets plugged into a computer for the first time, it will be assigned a new device ID. There are a couple of ways to fix this.

 

The simplest would be to have the students simply delete the old devices out of Measurement and Automation explorer, then rename their device to "dev1" or whatever they have coded their program to have it be called. Another way to fix this is in the DAQ Assistant. If you open the DAQ assistant, and right click on the channels they are using, you can select "change physical channel" and select the channels they are using. This will assign out the daq assistants channels to the device that is actually connected, instead of the device it was previously set up for. 

 

That said, all of these are a bit labor intensive. What I would suggest is to label each device with a name (label maker, etc), then set them up on one computer with that name, then export that MAX configuration to the other computers. That way each computer will have the devices enumerated to the same names. From there, just make the groups grab the same device each time (easy to tell them apart), and they wont need to change anything when switching between computers. 

 

Let me know if that works out for you. 

 

 

Regards,

Kyle M.
Applications Engineering
National Instruments
0 Kudos
Message 3 of 4
(2,185 Views)

@km4hr wrote:

Here's another complicating factor. Students sometimes move USB hardware from one computer to another. If they don't delete the previous hardware configuration in MAX then newly connected hardware takes the next sequential address. For example the new module becomes cDAQ2 instead of cDAQ1, even if cDAQ1 is no longer connected. If a program using an Express VI is created using cDAQ2 is moved to a computer that has only cDAQ1 then there's no way to reconfigure the Express VI to use cDAQ1 instead of cDAQ2. The Express VI configuration tool will not allow changing task channels from cDAQ2 to cDAQ1. Actually the tool complains about the change but it does accept it. But the program still fails with the above error.

 

 

 


This is actually pretty simple to get around.  Simply create a custom app that uses the system api to rename your device's alias when it is detected.  On one machine connect each device and select "MyAlias renamiing tool" and "allways take this action"
 export the MAX configuration and HKEYs.


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 4
(2,167 Views)