General description

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.

The B-Board PRO possesses no onboard DAC. However, the carrier board that is part of the Evaluation Kit embedds the necessary chip, so that four analog outputs are also available.

Simulink 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.

Standard parameters

  • Device ID selects which B-Box/B-Board to address when used in a multi-device configuration.

  • Analog output channel selects a physical analog output channel (0 to 3)

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.

Standard parameters

  • Device ID selects which B-Box/B-Board to address when used in a multi-device configuration.

  • Analog output channel(vectorizable) selects a physical analog output channel.

C++ functions

Standard functions

void Dac_SetVoltage(unsigned int output, float voltage, unsigned int device=0);

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)

Advanced functions
void Dac_SetValue(unsigned int output, unsigned int value, unsigned int device=0);

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)

  • No labels