NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

what is most efficient method to pass taskID to TS steps?

With LV7 and TS3, I used DAQmx to read AI channels as DAQ assistant task, the first time I ran the sequences the data are there, the second time I had error task is not valid... I see DAQ Assistance creates the task every time and every test step. There is a task copy in the DAQ assistant.
Q1. Should I use setup sequence to create a taskID out and somehow store the taskId as a local, and then pass this local to the "task to copy" for every DAQmx Create task.vi
Q2. what kind of local(double, string) that can store taskID?
sincerely
0 Kudos
Message 1 of 3
(3,113 Views)
Q2: What kind of local(double, string) that can store taskID?

There is a built in type in for storing LabVIEW tasks: the LabVIEWIOControl. This type is a cluster containing a string for the device name and a number for the session number.

Q1: Should I use setup sequence to create a taskID out and somehow store the taskId as a local, and then pass this local to the "task to copy" for every DAQmx Create task.vi

There are two clean architectures for using DAQmx with TestStand:

1 Let LabVIEW automatically manage the tasks for you. Create test VIs that contain one or more DAQ assistant calls to make each of the measurements. Using this approach you will not have to wire the tasks because the DAQ assistant VI keeps an internal copy.

2 Manage the tas
ks yourself creating one instance of each task you may use and repeatedly use the tasks in your tests. In this approach I would NOT use the DAQ assistant, the DAQmx VIs are more flexible if you want to manage the references.

If you decide to use architecture #2 then I would suggest you create your tasks in Setup using DAQmxCreateTask. Then call the pre-created tasks for a test steps in Main using DAQmxRead. Finally you can optionally using the Clear Task in Cleanup.

I am not sure what is causing the error you have been seeing. I would be interested in looking at a short sample that shows the problem.

-Rick Francis
Message 2 of 3
(3,113 Views)
Thank Rick,
My sequence is working OK now, I am not sure why.
It works so I am going to try to fix it.
0 Kudos
Message 3 of 3
(3,113 Views)