07-13-2018 01:54 PM - last edited on 07-16-2018 12:13 PM by Kristi_Martinez
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?
Solved! Go to Solution.
07-13-2018 03:05 PM - edited 07-13-2018 03:19 PM
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.
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.
07-14-2018 11:35 PM - edited 07-14-2018 11:38 PM
Please attach your VI. Pictures of parts of the VI give a very incomplete "picture" of your code.
Bob Schor
07-16-2018 09:10 AM
@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.
07-16-2018 09:18 AM
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
07-16-2018 12:07 PM - edited 07-16-2018 12:07 PM
How can I edit the title? It reads 'DAQms' instead of 'DAQmx'... oops!
07-16-2018 12:10 PM
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.
07-16-2018 12:11 PM
07-16-2018 12:12 PM
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.
07-16-2018 12:14 PM
Let me know if that attachment is useful to you.