Skip to main content

IAnalogIoDevice

Interface for analog I/O device drivers. Provides methods for reading and writing analog values in various data types.

Namespace: DeviceBase

Inheritance

This interface extends IDevice.

Methods

SetAnalogOutputByte

Sets an analog output value as an unsigned byte (0-255).

void SetAnalogOutputByte(int channel, byte value);

Parameters:

  • channel — The channel number.
  • value — The value to set (0-255).

SetAnalogOutputSignedByte

Sets an analog output value as a signed byte (-128 to 127).

void SetAnalogOutputSignedByte(int channel, sbyte value);

Parameters:

  • channel — The channel number.
  • value — The value to set (-128 to 127).

SetAnalogOutputWord

Sets an analog output value as an unsigned 16-bit word (0-65535).

void SetAnalogOutputWord(int channel, ushort value);

Parameters:

  • channel — The channel number.
  • value — The value to set (0-65535).

SetAnalogOutputSignedWord

Sets an analog output value as a signed 16-bit word (-32768 to 32767).

void SetAnalogOutputSignedWord(int channel, short value);

Parameters:

  • channel — The channel number.
  • value — The value to set (-32768 to 32767).

SetAnalogOutputDWord

Sets an analog output value as an unsigned 32-bit double word.

void SetAnalogOutputDWord(int channel, uint value);

Parameters:

  • channel — The channel number.
  • value — The value to set (0 to 4294967295).

SetAnalogOutputSignedDWord

Sets an analog output value as a signed 32-bit double word.

void SetAnalogOutputSignedDWord(int channel, int value);

Parameters:

  • channel — The channel number.
  • value — The value to set (-2147483648 to 2147483647).

GetAnalogOutputByte

Gets the current analog output value as an unsigned byte.

byte GetAnalogOutputByte(int channel);

Parameters:

  • channel — The channel number.

Returns: The current output value (0-255).

GetAnalogOutputSignedByte

Gets the current analog output value as a signed byte.

sbyte GetAnalogOutputSignedByte(int channel);

Parameters:

  • channel — The channel number.

Returns: The current output value (-128 to 127).

GetAnalogOutputWord

Gets the current analog output value as an unsigned 16-bit word.

ushort GetAnalogOutputWord(int channel);

Parameters:

  • channel — The channel number.

Returns: The current output value (0-65535).

GetAnalogOutputSignedWord

Gets the current analog output value as a signed 16-bit word.

short GetAnalogOutputSignedWord(int channel);

Parameters:

  • channel — The channel number.

Returns: The current output value (-32768 to 32767).

GetAnalogOutputDWord

Gets the current analog output value as an unsigned 32-bit double word.

uint GetAnalogOutputDWord(int channel);

Parameters:

  • channel — The channel number.

Returns: The current output value.

GetAnalogOutputSignedDWord

Gets the current analog output value as a signed 32-bit double word.

int GetAnalogOutputSignedDWord(int channel);

Parameters:

  • channel — The channel number.

Returns: The current output value.

Usage Example

IAnalogIoDevice analogDevice = ...;

// Initialize device
analogDevice.Init(config);

// Set analog output as word
analogDevice.SetAnalogOutputWord(0, 32768);

// Read current output value
ushort currentValue = analogDevice.GetAnalogOutputWord(0);

// Dispose when done
analogDevice.Dispose();

Remarks

  • Different methods support different data type ranges for analog values.
  • Choose the appropriate method based on your hardware's bit depth and value range.
  • All values represent direct hardware values and may require scaling for physical units.

See Also