From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx - Problem creating new DAQmx task during runtime

I am writing a queued timed event based data acquision application that collects analog samples from 4 channels.

 

The program is set up so during runtime, when the user changes the value of the DAQmx Physical Channels control, the old DAQmx task is stopped and cleared with "stop task.vi" and "clear task.vi"; once this is completed, a new task is configured using the new values from the DAQmx Physical Channels control. The task is stored through shift register.

 

The structure in question is pictured in the attachment.

 

When the program is ran, after the user changes the channels value, the loop iterates, but the appropriate samples are not collected when the DAQmx read is called. When the program exits and the loop exits, I get error code 200099 saying specified physical channel does not exist from DAQmx Create Channel.vi.

 

 

I don't see what I am doing wrong here, if anyone can help me figure this out I would greatly appreciate it.

 

Thank you.

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

Please attach the vi and not just a screenshot. It's hard to figure it out what happens there.

 

Paul

 

 

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

Thanks for the reply, I am attaching the VI as requested.

 

LabView version is 2009 SP1

0 Kudos
Message 3 of 4
(2,466 Views)

I've done some more digging, and made a simple test VI to check if DAQmx Tasks can be cleared and created during runtime.

 

This VI uses a basic event driven state machine structure to clear and create DAQmx Task when the DAQmx Physical Channel box is changed by the user.

 

This test works as intended, but a similar structure in the vi posted above does not. Is there an explanation for this?

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