Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

How to stop this ao task and writer?

When I close the application, the hardware is still output  Voltage 'val' .How to stop this ao task and writer?

Code as follows:

//////////////////////

try
{
CNiDAQmxTask task(_T("AOTask"));

task.AOChannels.CreateVoltageChannel(
physicalChannel,
_T("AOChannel"),
min,
max,
DAQmxAOVoltageUnitsVolts);

CNiDAQmxAnalogSingleChannelWriter writer(task.Stream);
writer.WriteSingleSample(true, val);
}
catch(CNiDAQmxException *e)
{
e->ReportError();
e->Delete();
}

0 Kudos
Message 1 of 1
(3,896 Views)