LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx Start Task VI slow

Solved!
Go to solution

Hi there,

 

I am using a PXIe system with PXIe-8821 with Win7 (64 bit) and a PXIe-4302 +/-10V, 32-Ch, 24-bit, 5kS/s/ Voltage Input Module to collect 24 separate channels of analog data.

 

I have a fairly simple state machine which implements the setup and acquisition. Attached are images showing the creation and configuration of the task, as well as starting the task, acquiring the data and stopping the task (we also clear it but a screenshot wouldn't be very illuminating). Everything seems to be put together properly, but for some reason the Start Task VI is terribly slow, we timed it as taking 800 ms! For various reasons this is unacceptable. I've searched high and low and can't find a solution. What can I do to speed up Start Task.vi?

0 Kudos
Message 1 of 20
(3,974 Views)

First of all, i would say that you really should take a blank template of the JKI state machine and run it in "Highlight Execution" mode to see what is happening.  The fact that you put a sequence structure around the case structure tells me that you don't have a full understanding of it yet. 

I can also see you don't fully understand the state machine because of the overuse of local variables. Look in the Data:Initialize case and make use of the bundle function there to add other datatypes that you might use throughout the program.  For instance, you could take a task constant, give it a name, bundle it into the shift register, and it will store your task.  It's very easy to unbundle it where needed...no need for a local variable. 

Capture.PNG

Edit: Just realized that a DAQmx task doesn't need to be rebundled in most cases, since it is basically just a string.  But the comment does apply to other datatypes that need to be saved for use elsewhere.

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 2 of 20
(3,956 Views)

Please attach your VI.  Pictures of parts of the VI give a very incomplete "picture" of your code.

 

Bob Schor

0 Kudos
Message 3 of 20
(3,913 Views)

@chadt wrote:

... but for some reason the Start Task VI is terribly slow, we timed it as taking 800 ms! 


How did you time it?  I don't see that code anywhere. 

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 4 of 20
(3,888 Views)

So you start the task via a digital trigger? What's the source of this trigger and when do it trigger? I don't Think the start itself takes much time, but that it for some reason Waits for this trigger. Disable it and test again.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 5 of 20
(3,882 Views)

How can I edit the title? It reads 'DAQms' instead of 'DAQmx'... oops!

0 Kudos
Message 6 of 20
(3,859 Views)

Hi there,

 

It's part of a much larger program so I'm not sure it will work as a stand-alone VI, but here you go. Thanks for your time.

 

 

0 Kudos
Message 7 of 20
(3,854 Views)

Hi,

The source of the trigger is a DIO device we have in our lab. It does not wait for the trigger, the trigger timing is correct and the VI receives the trigger correctly. We checked the timing and it is indeed the Start Task VI which is taking 800 ms to run.

0 Kudos
Message 9 of 20
(3,847 Views)

Let me know if that attachment is useful to you.

0 Kudos
Message 10 of 20
(3,837 Views)