Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

Mixing MAX Task under one Start/Stop

Hi,
 
I have an end-of-line app that is testing some radio boards.  These tests will require turnng on/off the some digital lines, reading some analog values and some RS-232 communications, sorta async stuff for the most part. 
 
I have defined several specific tasks in MAX for the digital and analog operations.  My question, that I cannot seem to find an answer or example for, is can I mix analog reads and digital writes under a single StartTask/ StopTask(see below)?  If not, what is the method.  Please advise and an example that gets posted on the web would be GREAT.
 
Will the StopTask and ClearTask stop and clear all loaded tasks?  I guess a more in-depth of what is really going on might be helpful.
 
thanks
 
tim
 
 
 
    DAQmxErrChk DAQmxLoadTask("D_TurnOnPwr", taskHandle)
    DAQmxErrChk DAQmxLoadTask("A_MeasurePwr", taskHandle1)

    DAQmxErrChk DAQmxStartTask(taskHandle)
    DAQmxErrChk DAQmxWriteDigitalLines(taskHandle, 1, F, 1, _
        DAQmx_Val_GroupByScanNumber, i(0), sampsWritten, ByVal 0&)
     DAQmxErrChk DAQmxReadDigitalLines(taskHandle, 1, 10#, _
        DAQmx_Val_GroupByChannel, readArray(0), arraySizeInBytes, _
        sampsPerChanRead, numBytesPerSamp, ByVal 0&)
   
    DAQmxErrChk DAQmxStopTask(taskHandle)
    DAQmxErrChk DAQmxClearTask(taskHandle)
     
0 Kudos
Message 1 of 2
(6,394 Views)
Hi Tim,
From what I understand, it appears that you are trying to generate digital signal and acquire analog signal at the same time.  If your card is line addressible, for example, the PCI-6221, you can add one line per task and address your lines in seperate tasks or you can add multiple lines per task and address your lines within the task.  You have to make sure to set up the task to be in "One Line Per Channel" mode, so you can address your digital lines one by one.  You need a seperate TaskHandle for each task.  On top of that, you cannot mix input and output, digital and analog in one task. However, you can always create multiple tasks for each operation you are trying to do, and once you start the task, you can read from or write to those channels, and the value will stay until you either clear the task or write some new values.  The values written into each digital line will not affect the values in others.  Make sure when you clear the task, use the correct taskhandle.
Hope this information helps.

Yi Y.
Applications Engineer
National Instruments
http://www.ni.com/support
0 Kudos
Message 2 of 2
(6,341 Views)