LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you implement the DAQmx clear task in the DAQ asst. analog output?

I have the following system: Labview 7, pxi 1042 chassis, scb-68, windows xp, pxi 6070e card.

My application is to send a 10Vdc constant value to command a system to run. When stopping the VI, the 10Vdc value remains, I want a 0Vdc value to turn my system off. I read in another post that the NI system is configured this way to store the last value in its internal buffer.

I am trying to "clear" the last value of the analog output buffer which is 10Vdc to 0Vdc. I've been trying to enter the clear function DAQmx Clear task at the very end of the DAQ assistant analog output block diagram. In other words, I open the front panel of the DAQ assistant analog output and go to the block diagram.
At the output, where the I/O and Error outputs are, I installed the daqmx clear task right before it. I found that it does not set the voltage to 0. I do not include the I/O icon (purple) because there is no connection to it from the DAQmx clear function icon - I do not know whether this affects the function.

I also tried assigning an I/O task to the daq clear function (internal to the icon), and this did not work.

Any suggestions on how to implement this function?

thanks,
derek
0 Kudos
Message 1 of 4
(2,745 Views)
Derek,

The best way to zero your analog output is to write a zero voltage to it at the end of the program. This is how the examples accomplish this as well. The DAQmx Clear function by itself will not zero the analog output. Write a zero to the analog output right before you do the DAQmx Clear.

RossC
0 Kudos
Message 2 of 4
(2,745 Views)
Do you have any sample code of how to do this?

derek
0 Kudos
Message 3 of 4
(2,745 Views)
Derek,

Here is a quick piece of example code. It writes 10V to the analog output channel, waits two seconds, then writes a zero to the channel and clears the task. From what you described, this should be similar in format to your application, except that you would put your application code where I put the wait command in a sequence structure. Good luck with your program!

RossC
0 Kudos
Message 4 of 4
(2,745 Views)