LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2 Channel Acquisition Not Functioning in Event structure

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?

Download All
0 Kudos
Message 1 of 8
(935 Views)

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.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 2 of 8
(926 Views)

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

0 Kudos
Message 3 of 8
(903 Views)

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.

0 Kudos
Message 4 of 8
(892 Views)

@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

 

 

 

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 5 of 8
(852 Views)

It's just a myDAQ. 

0 Kudos
Message 6 of 8
(843 Views)

@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.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 7 of 8
(831 Views)

That earlier program wouldn't run without a channel name one so I started fresh.

0 Kudos
Message 8 of 8
(822 Views)