01-24-2020 03:07 AM
I am using DaqMx create channel to collect a sequence of boolean data from four cDAQ9181 modules. I want to be ab le to select the lines at run-time from four controls, one per cDAQ.
I read Labview does not necessarily execute the code left to right.
I attach the vi. It starts the acquisition from the pre-set lines, but I would like to have the possibility to change them. How should I change the code to make it possible?
Thanks
01-25-2020 11:18 AM
@DavideB wrote:
I read Labview does not necessarily execute the code left to right.
LabVIEW uses the Principle of Data Flow to determine code execution order. Look at any function (or VI) -- it has 0 or more Inputs, it "does something", and it produces 0 or more Outputs. The Principle of Data Flow says:
Some comments:
Now, dealing with your question, you have two things you want to do (and in this order):
If you want Task 1, defining the DAQmx Channels, to be "interactive", i.e. you want to see and change them at Run Time, I would recommend that you write a sub-VI that lets you choose the Channels and their configuration. Once you have it the way you want, exit the sub-VI, passing the settings out as its output, to be used in the rest of the code. Note that if you are doing multi-channel DAQ acquisition, it is much simpler to set up sequential channels (0, 1, 2 ...) and set up N-channel acquisitions.
Bob Schor
01-28-2020 10:03 AM
Thanks a lot Bob,
I realised though that if one of the chassis goes off for some reason (eg momentary lack of power), the vi will crash. How can I modify it in order that it will keep collecting data from the modules which are still on line?
01-28-2020 10:25 AM
What do you mean by crash? Do you get an error code then crash? If so you need to handle the error code. Stop and restart the system once the error clears.
01-28-2020 08:00 PM
If a momentary power loss causes problems for your test, then I recommend you invest in an uninterruptible power supply for it.
01-29-2020 07:09 AM
@RavensFan wrote:
If a momentary power loss causes problems for your test, then I recommend you invest in an uninterruptible power supply for it.
A UPS should be in every real test system. The only real question is how large. I will state that I have had a lot of luck with this UPS from Eaton.