04-26-2022 06:33 PM
My data acquisition program (Delete 1.VI) works perfectly fine on its own. However, when I try to implement two of it into an event structure, nothing happens. No error shows and highlight execution shows nothing. Any suggestions?
04-26-2022 06:46 PM
The missing piece in the puzzle of why your implementation doesn't work is the understanding of DAQmx tasks. Typically, most DAQ devices support ONLY ONE active HW timed task of a type. This means, it can have only one AI task running, if you need more than one channel to acquire, all those channels have to be part of that ONE task and not on a separate task of its own.
Your code would work only with DSA instruments which support up to 2 simultaneous HW timed tasks of a type.
04-26-2022 07:52 PM - edited 04-26-2022 08:13 PM
So it's impossible with my device is what I'm understanding. Is that correct? If so, I'm unsure how I could simultaneously acquire two AI channels with individual on/off controls as requested. I'll try using two DAQmx Create Channel
04-26-2022 08:01 PM
Your "acquisition on" event locks the panel until the event completes, preventing all user interactions during that time. Since you have inner interactive loops, no further interaction is possible, including reading the "end program" command.
You really need to implement a better and well established code architecture. There is not good reason to even have an event structure here. (Also: LEDs should not be controls! Why are there so many local variables? Why are there value property nodes to read booleans? etc. etc.)
I am not a DAQ person, so I sure what has been said above also applies.
04-26-2022 10:29 PM
@User002 wrote:
So it's impossible with my device is what I'm understanding. Is that correct? If so, I'm unsure how I could simultaneously acquire two AI channels with individual on/off controls as requested. I'll try using two DAQmx Create Channel
So far, you have not said what your hardware is.
BTW, this one had a similar requirement, please study the solution posted - https://forums.ni.com/t5/LabVIEW/How-to-program-a-toggle-switch-for-selection-of-one-two-virtual/m-p/4225536
04-26-2022 10:36 PM - edited 04-26-2022 10:40 PM
It's just a myDAQ.
04-26-2022 10:39 PM
@User002 wrote:
It's just a myDAQ
I don't think such a low-cost (comparatively) device supports simultaneous tasks. There is a solution to allow dynamic enable/disable of channels but not the way you've attempted.
04-26-2022 10:42 PM
That earlier program wouldn't run without a channel name one so I started fresh.