04-08-2008 10:04 AM
04-08-2008 10:42 AM
Reiterate my problem.
Inside the subvi, I give the card a pulse train to generate. The last value of this pulse train for the lines of the port are not all zero. I wish to keep the values that way after the subvi finished till the next execution. However, the current situation is, somehow the card clears all the lines into zero.
Grateful to any suggestion!
04-08-2008 02:04 PM - edited 04-08-2008 02:05 PM
04-08-2008 02:17 PM
04-08-2008 02:37 PM - edited 04-08-2008 02:37 PM
Thanks for suggestion.
In the documenation,
Labview Help::VI and Function Reference::Measurement IO VIs and Functions:: DAQmx Data Acquisition VIs and Functions::Additional Information::Supported Properties by Device::Task Creation and Destruction
It says if in a loop, not clearing task will give error.
emmm, hard to do.
04-08-2008 02:52 PM
04-08-2008 03:05 PM
04-09-2008 07:15 AM
Had a try yesterday.
If I don't have "Stop Task" in the loop, error -200288 will show up when the loop is executed after the first time. It happens when writing data to the card.
If I have "Stop Task" in the loop, all lines goes to zero again.
Thanks for suggestions anyway.
04-09-2008 12:45 PM - edited 04-09-2008 12:47 PM
Hello Lcdos,
In your first screen shot you have a DAQmx Clear Task VI; this is not the same as a DAQmx Stop Task VI. If you're referring to the DAQmx Clear Task as the "Stop Task" then this is probably the problem. Stopping the task ends the generation but it doesn't clear the task so the last values you output should stay on the lines. I've attached a screen shot below of how I would code the output you've described. I would make your subVI only include the code that is inside of the while loop. This way you can create the task once, write a finite number of samples, stop the task, then change the write buffer and write a finite number again while maintaining the last values on the lines. Then you clear the task a single time at the end of your program. Note: VI before the DAQmx Write is just to make a waveform to write. In you're program I'd make this an input on the subVI.
If you've already made a modification similar to the one I've suggested it would be helpful to if you can post another screen shot of your current VI.
I hope this helps get you started, and have a good day.
Cheers,
04-09-2008 01:55 PM
Thank you Brooks,
I did mean Daqmx Stop Task.vi.
Currently there is no error coming out, yet it seems the card still clears the line.