08-01-2022 11:34 AM - edited 08-01-2022 11:57 AM
I tried searching for this topic in the forums first but I cannot quite figure out how to word it.
What I'm hoping for is a way to bring any computer that has LabView runtime installed on it and be able to plug it in to a DAQ module via USB and utilize it's input and output channels without the need to create specific task constants or channel constants within NI-MAX on every computer that wants to run the program.
Perhaps we've been doing it wrong this whole time but when choosing channel/task constants it would seem one has to choose from the given list of available constants within NI-MAX. Therefore we code the LabView program to run using these constants and create them before-hand in NI-MAX manually to contain the necessary channels needed to send and receive data. Once the program is complete if I want to run it on another machine I have to not only publish the program to a that machine, or at least a network location, but then I physically have to get on to that machine and configure the channel/task constants locally or else the program will not be able to find them (of course).
Is there a way, in the first steps of a LabView program, to search for plugged in DAQ modules by model, use that device object to then create tasks dynamically with the appropriate channels (Ao1, Ai2, port0/line1, etc.) and then use those constants to carry out the IO features of the program?
The goal, again, is that any machine that has at least the runtime version of LabView (i.e. capable of running published LabView programs) can be plugged in to a specific DAQ Module and run the program without the need to manually set up channel/task constants in NI-Max
EDIT: Another frustrating element to this process is that I need to set up channel constants for an NI-USB6215. However I cannot create the channel constant without having the module plugged into my machine as I need to select the given channel in the channel list when actually creating the constant. The NI-USB6215 module does not show up in the choices available to simulate a device just so I can create the constant. Thus having a method to dynamically call out for available modules and creating task/channel constants would eliminate this need.
Any feedback would be appreciated!
Thank you!
Solved! Go to Solution.
08-01-2022 11:59 AM
Is there a way, in the first steps of a LabView program, to search for plugged in DAQ modules by model, use that device object to then create tasks dynamically with the appropriate channels (Ao1, Ai2, port0/line1, etc.) and then use those constants to carry out the IO features of the program?
The goal, again, is that any machine that has at least the runtime version of LabView (i.e. capable of running published LabView programs) can be plugged in to a specific DAQ Module and run the program without the need to manually set up channel/task constants in NI-Max
Of course, there is and it is the recommended way to make it scalable and deployable automation. You have to use DAQmx drivers in the programming language of your choice to create the task and configure it dynamically during execution without even having to touch NI MAX.
Skip the DAQ Assistant part and look at the rest of the stuff - https://www.ni.com/en-us/support/documentation/supplemental/06/learn-10-functions-in-ni-daqmx-and-ha...l
08-01-2022 12:02 PM
I get a webpage error when attempting to follow that link. I'd love to read it!
08-01-2022 12:16 PM
This is exactly what I was looking for:
Programmatically Finding Device Name of DAQ Device in System in LabVIEW - NI
This was my biggest hurdle as I was not sure how to get the device name without having a specific COM port or naming convention available for the device itself between machines.
08-01-2022 02:26 PM
Hi darren,
@darrenlwoodson wrote:
I get a webpage error when attempting to follow that link. I'd love to read it!
Just append an "l" (lowercase L) to the link address (to get "html" instead of just "htm" at the end)!
Or use this link…
08-01-2022 02:40 PM - edited 08-01-2022 02:45 PM
Some Other things to consider.
You can use the System Configuration API to:
You can save your DAQmx channels, Scales, Tasks, etc... in your LabVIEW Project file and they will exist anywhere your lvproj file goes. BONUS! your application build creates a configuration file under a NI DAQ folder in the output directory. You can even edit that ini file to change properties without rebuilding the exe!
You can create simulated devices on your development machine and your DAQmx chanels, Scales, tasks etc... will be just fine when they see a real DAQmx device with the same Alias.