LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx Start Task and Task Started Property Node

Hi all,

 

Two quick questions for you.

 

The DAQmx Start Task function states the following as taken from the help file:

 

"If you do not use the DAQmx Start Task VI and the DAQmx Stop Task VI when you use the DAQmx Read VI or the DAQmx Write VI multiple times, such as in a loop, the task starts and stops repeatedly. Starting and stopping a task repeatedly reduces the performance of the application."

 

Q1. Does this mean that if you have used the Start Task function before the while loop that the task is not topped after the read? If so, why is the default behaviour to stop after every read if the start task function is not used. Could it be so that the resource can be used elsewhere without having to stop the task every time?

 

Q2. This question is based around the Start Task function and I have already proven this programatically, however I would like to know if there is there a property node selection that states whether the task has been started/stopped? The closest I can find is Task Done property but this does not appear to exhibit the behaviour I am after as this returns true before I either start the task manually via the Start Task function or perform a read which will force the task to start.

 

Thanks in advance.

 

Mitch

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

I just read that post back and would just like to point out that whilst the answer to Q1 may seem obvious as it’s the opposite to the statement, I would like this clarifying in order to better understand the operational functionality as its only today that I found out the task stops after a read unless it’s been manually told to start. I was under the impression that once the read has been performed, that task has been started and continues to run until told otherwise.

 

Regards

 

Mitch

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

In this post Sean took us all to school about how DAQmx Task state transitions occur and when explicit transitions can improve performance over explicit transitions.  Warning: Wrap your head with Duct tape prior to just jumping in as the post covers some advanced DAQmx concepts.  A good look at the DAQmx help file and state transition diagram is essential to fully understand.

 

The help file DOES cover all the information however it suffers (like most help files) from fragmentation Sean did a good job pulling it all together for us.

 

To more directly answer you:

Q1Does this mean that if you have used the Start Task function before the while loop that the task is not topped after the read? No the task is stopped BUT, the DAQmx State transitions back to what it was when the task started If so, why is the default behaviour to stop after every read if the start task function is not used. Could it be so that the resource can be used elsewhere without having to stop the task every time?

Essentially, DAQmx will go to the run state from any state (or error) but it would be "Rude in the extreeme" for the task to exit without returning to the same state it started from.

Q2. Task State Property>> Not really something you want to hear but no, there isn't one that is readable other than the Done? (Is running) boolean.  Probably a good thing in the long run since state transitions happen inside DAQmx


"Should be" isn't "Is" -Jay
Message 3 of 4
(2,590 Views)

Hi Jeff,

 

Many thanks for the reply, much appreciated.

 

Had a quick look at the link; time to get a coffee and doctor on hand before tackling that one :  )

 

Cheers

 

Mitch

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