DAC - Analog outputs

The DAC block applies a given value to one of the four analog outputs of the B-Box RCP. The corresponding hardware specifications are available in the B-Box datasheet.

Signal specification

The input signal is the value to apply to the analog output specified in volts (-5V to 5V). The output is saturated beyond these limits.

Standard parameters

  • Device ID selects which B-Box/B-Board to address when used in a multi-device configuration.
  • Analog output channel(s) (vectorizable) selects a physical analog output channel (0 to 3)
DAC Simulink dialog

PLECS block

Signal specification

The input signal is the value to apply to the analog output specified in volts (-5V to 5V). The output is saturated beyond these limits.

Analog output PLECS block

Standard parameters

  • Device ID selects which B-Box/B-Board to address when used in a multi-device configuration.
  • Analog output channel(s) (vectorizable) selects a physical analog output channel(s) (0 to 3).
Analog output PLECS dialog parameters

C++ functions

void Dac_SetVoltage(unsigned int output, float voltage, unsigned int device=0);Code language: C++ (cpp)

Sets the value of an analog output in volts.

Parameters

  • output: the analog output channel (0 to 3)
  • voltage: the value to output in volts (-5V to 5V, saturated if over- / under-voltage)
  • device: the id of the B-Box/B-Board to address (optional, used in multi-device configuration only)
void Dac_SetValue(unsigned int output, unsigned int value, unsigned int device=0);Code language: C++ (cpp)

Sets the value of an analog output using a raw 16-bit value.

value=0 → output = -5V, value=65535 → output = 5V

Parameters

  • output: the analog output channel (0 to 3)
  • value: the raw 16-bit value, saturated if overflow
  • device: the id of the B-Box/B-Board to address (optional, used in multi-device configuration only)