NI-DAQmx .NET Framework 4.0 API Reference

Table of Contents

DigitalSingleChannelWriter.WriteSingleSamplePort Method (Boolean, Int32)

  • Updated2023-02-21
  • 1 minute(s) read
DigitalSingleChannelWriter.WriteSingleSamplePort Method (Boolean, Int32)
Writes a single 32-bit integer sample to a single DOChannel in a task.

Namespace:  NationalInstruments.DAQmx
Assembly:  NationalInstruments.DAQmx (in NationalInstruments.DAQmx.dll) Version: 20.7.40.49302

Syntax

public void WriteSingleSamplePort(
	bool autoStart,
	int data
)
Public Sub WriteSingleSamplePort ( 
	autoStart As Boolean,
	data As Integer
)

Parameters

autoStart
Type: SystemBoolean
If set to this method automatically calls Start if you do not explicitly call it. You cannot set this parameter to if you have installed events on the task.
data
Type: SystemInt32
A sample to write to the task.

Exceptions

ExceptionCondition
DaqExceptionThe NI-DAQmx driver returned an error.

Remarks

Use this method for devices with up to 32 lines per port. If the task uses on-demand timing, this method returns only after the device generates all samples. If the task uses any timing type other than on-demand, this method returns immediately and does not wait for the device to generate all samples. Your application must call the WaitUntilDone method to block until the device has generated all samples.

NI-DAQmx read and write methods time out after the amount of time specified by the Timeout property on the task you are reading from or writing to.

This method returns immediately if the output buffer has sufficient space for the samples. Otherwise, the call is blocked until the application generates enough samples to fit the new data into the output buffer.

See Also

Log in to get a better experience