LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to make DAQmx tasks work on multiple DAQ devices

Solved!
Go to solution

I created Temperature tasks on cDAQ1 on my development PC.  I moved that DAQ system to the lab along with an executable.  I have connected cDAQ2 to my development PC and none of the Tasks that I created will work on this system since all reference channels on cDAQ1.  Also the executable will not work with cDAQ2 also.  Note that cDAQ1 and cDAQ2 have the same hardware setup.

 

How do I create these tasks so that they will work with either system or additional identical systems in the future?

0 Kudos
Message 1 of 5
(3,742 Views)

1.  Do you have the necessary DAQ drivers on your lab PC?

2.  Are your DAQ devices specified as the same device (i.e. "Dev1") on both computers?

3.  Did you create the tasks using MAX, or did you use the "DAQmx Create Task" vi?

4.  Is the Run-time engine installed on your PC?  (if you developed in LV8.6, you'll need Run-time engine 8.6...if you developed in 8.5.1, you need RTE 8.5.1...etc)

5.  How are you able to tell that your executable is having a problem due to a DAQ error?

 

We should be able to figure this out with some additional information from you.

0 Kudos
Message 2 of 5
(3,721 Views)

1.) I believe that I do have the necessary DAQ drivers as when I created my build installer I had to insert the NI Device Driver CD. Also, the executable and my program works with cDAQ1.

2) The first cDAQ system is called cDAQ1 and the second is called cDAQ2.  That was the default name that MAX gave the system when I plugged it in.

3) I created the tasks using MAX.

4) Yes the runtime engine is installed on the lab PC.

5) I am able to tell that my EXE is have problems because all measurements are 0 and when I press my program stop button I get the following message:

 

Error -201003 occurred at DAQmx Start Task.vi: 22

 

Possible reason(s):

Measurements: Device cannot be accessed.  Possible causes:

Device is no longer present in the system.
Device is not powered.
Device is powered, but was temporarily without power.
Device is damaged.

Ensure the device is properly connected and powered.  Turn the computer off and on again.  If you suspect that the device is damaged, contact National Instruments at ni.com/support.

Device Specified: cDAQ1Mod4

Task Name: Temperature Input 2

0 Kudos
Message 3 of 5
(3,719 Views)
Solution
Accepted by topic author CarolK

Ok.  I see the problem.  It is because your devices have different names.  You have told your tasks to reference a hardware device that has a specific name:  "cDAQ1".  Therefore your program is always going to look for a hardware device bearing that name.  Here are your options:

 

1.  Change the device name "cDAQ2" to "cDAQ1" on your target computer.  You will need to do this for every target computer upon which you load your executable. 

 

or...

 

2.  After installing your DAQ board and your program on your target computer, go into your tasks in MAX and re-direct them to the proper hardware (cDAQ2) by selecting "change physical channels" for each task, and designating the appropriate channels on cDAQ2.

 

Alternatively, you can use the "Create Tasks" vi instead, and add a control that allows the user to select the hardware channels upon which your acquisition will take place.

 

 

 

 

 

 

 

Message 4 of 5
(3,708 Views)

Or do like I did some years ago for a system to be shipped overseas and installed on some mystery PC:

1) write a small VI which lists all the DAQ devices on the system and their device types

2) find the device name which corresponds to the device type you need (this way you can ignore other DAQ devices which might be installed)

3) use that device name for all your configuration

 

In this manner you don't have to worry about the device name on any target system or try to have a possibly naive user choose the device name.

 

LabVIEW user since 2.0
0 Kudos
Message 5 of 5
(3,393 Views)