LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Use multiple versions of same hardware and the same LabVIEW code

Solved!
Go to solution

Here is my dilemma, 

 

I have many different NI 9213s (16 channel thermocouple module) that I use in my lab. I only need to use them one at a time, but I want to use the same LabVIEW code with each. I use NI MAX to create a task for the NI 9213 that I am using, but when I plug a different NI 9213 into the computer I need to delete the first task and make a second tast with the second NI 9213. 

 

My questions is, is there a way to be able to plug in different NI 9213s into the computer and not have to reconfigure the tasks in NI MAX? If so, how? 

 

Thanks,

Maddie

0 Kudos
Message 1 of 6
(3,206 Views)

The short answer is yes, but you need to supply a little more info to get a better response.  First, what hardware are you using with the 9213 modules?  Is it in a CompactDAQ, CRIO, or USB module? Your best bet is to post your code and then I, or someone else, can offer better advice.

0 Kudos
Message 2 of 6
(3,197 Views)

Maybe this will help you out.  It will do a check to find all of the devices and then find the first of the type you want.  From there, you can build up the task programmatically using that device.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 6
(3,190 Views)

I am using a USB module with the 9213. Thank you for the exmple code. Could you possibly give me example code on how to programatically build a task once I have the device I want. That is what I am having trouble with. 


Thanks! 

0 Kudos
Message 4 of 6
(3,126 Views)
Solution
Accepted by topic author MaddieDrake

Just use Concatinate String using the returned device name and the channel names to build of the full channel name and then DAQmx Create Channel to add that channel to your task.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 5 of 6
(3,111 Views)
Thank you so much for this example. It helped me get to my solution. Maddie
0 Kudos
Message 6 of 6
(3,093 Views)