LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Code that is compatable with different chassis

Hello Everyone,

I'm looking to expand a piece of code to make it compatible with different chassis without requiring the programmer to individually go through and change all the physical channel names. Specifically I’m looking to allow the program to update the physical channel names associated with a DAQ assistant.

 

The code is set up using the DAQ assistant VI and multiple channels are used by the DAQ assistant for data acquisition. The code is fully functional when the hardcoded chassis is used. However when the chassis is switched (to say chassis 2, with all the same cards installed) all the physical channel names are then incorrect and the channels must be reprogrammed. For this set up there are multiple cards in the chassis so designating the device as an input to DAQ assistant is not an option. I am using the standard naming convention for the chassis and cards: cDAQ1Mod1/ai0 as an example. When chassis are switched the new physical channel needs to be cDAQ2Mod1/ai0. I have been actively searching forums and examples for 2 days or so now and haven't been able to find help on this specific topic. Any help would be greatly appreciated and feel free to ask for any additional information.

 

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

You can connect a standard string to DAQmx functions that expect a task or channel.  Using strings you can build up the channel names yourself.

Message 2 of 4
(2,077 Views)

There is no way you should be using the DAQ Assistant if you want flexibility. You could convert to a DAQmx task and the channels could be edited in MAX or you can change the device name there. You can also use DAQmx property nodes to list the available devices and assign the channels based on that as nathand mentions.

Message 3 of 4
(2,074 Views)

Thank you for the advice. Definitely put me on the right track and the program has the added functionality now.

0 Kudos
Message 4 of 4
(2,049 Views)