DAQmxWriteCtrTicks

NI-DAQmx C Functions

DAQmxWriteCtrTicks

int32 DAQmxWriteCtrTicks (TaskHandle taskHandle, int32 numSampsPerChan, bool32 autoStart, float64 timeout, bool32 dataLayout, uInt32 highTicks[], uInt32 lowTicks[], int32 *numSampsPerChanWritten, bool32 *reserved);

Purpose

Writes new pulse high tick counts and low tick counts to each channel in a continuous counter output task that contains one or more channels.

Parameters

Input
Name Type Description
taskHandle TaskHandle The task to write samples to.
numSampsPerChan int32 The number of samples, per channel, to write. You must pass in a value of 0 or more in order for the sample to write. If you pass a negative number, this function returns an error.
autoStart bool32 Specifies whether or not this function automatically starts the task if you do not start it.
timeout float64 The amount of time, in seconds, to wait for this function to write all the samples. The default value is 10.0 seconds. To specify an infinite wait, pass -1 (DAQmx_Val_WaitInfinitely). This function returns an error if the timeout elapses.
A value of 0 indicates to try once to write the submitted samples. If this function successfully writes all submitted samples, it does not return an error. Otherwise, the function returns a timeout error and returns the number of samples actually written.
dataLayout bool32 Specifies how the samples are arranged, either interleaved or noninterleaved.
Value Description
DAQmx_Val_GroupByChannel Group by channel (noninterleaved)
DAQmx_Val_GroupByScanNumber Group by sample (interleaved)
highTicks uInt32 [] The number of timebase ticks the pulse is high.
lowTicks uInt32 [] The number of timebase ticks the pulse is low.
reserved bool32 * Reserved for future use. Pass NULL to this parameter.
Output
Name Type Description
numSampsPerChanWritten int32 * The actual number of samples per channel successfully written to the buffer.

Return Value

Name Type Description
status int32 The error code returned by the function in the event of an error or warning. A value of 0 indicates success. A positive value indicates a warning. A negative value indicates an error.