Main Content

resetCounters

(Not recommended) Reset counter channel to initial count

This session object function is not recommended. Use DataAcquisition object functions instead. See Compatibility Considerations.

Description

example

resetCounters(s) resets the current value of counter channels configured in the session object, s, to the value specified by the InitialCount property on each channel.

Tips

Examples

collapse all

Create a session, then add a counter channel with an EdgeCount measurement type and acquire data.

s = daq.createSession ('ni');
addCounterInputChannel(s,'cDAQ1Mod5',0,'EdgeCount');
inputSingleScan(s)
ans =

   756

Reset the counter to the default value, 0, and acquire data again.

resetCounters(s)
inputSingleScan(s)
ans =

   303

Input Arguments

collapse all

Data acquisition session, specified as a session object. Create the session object using daq.createSession. Use the data acquisition session for acquisition and generation operations. Create one session per vendor and use that vendor session to perform all data acquisition operations.

Version History

Introduced in R2011a

collapse all

R2020a: session object interface is not recommended

Use of this function with a session object is not recommended. To access a data acquisition device, use a DataAcquisition object with its functions and properties instead.

For more information about using the recommended functionality, see Transition Your Code from Session to DataAcquisition Interface.