DAC - Analog outputs

The DAC block, or its equivalent C++ routines, is used to apply a given value to one of the Digital-to-Analog Converter (DAC) channels of the B-Box controllers. The table below summarizes the hardware specifications, including location, channel count, update rate, resolution, signalling, and output voltage range. Detailed information regarding DAC outputs is available in the associated product datasheet.

Comparative information about imperix’s programmable controllers is also given in PN250.

Param.B-Box 4B-Box 3B-Box microB-Board 3
Location and count24x RJ45 ports4x SMA connectorUnavailableUnavailable
Update rateUp to 500 kspsUp to 50 kspsN/AN/A
Resolution12 bits16 bitsN/AN/A
Voltage range±10 V±5 VN/AN/A
SignallingDifferentialSingle-endedN/AN/A
Product datasheetB-Box 4B-Box 3B-Box microB-Board 3

Principle of operation

The DAC value is updated as soon as possible after the end of the CPU control task, with all DACs latching their outputs synchronously with a delay of up to one control task period.

Signal specification

The input signal directly sets the analog output voltage, potentially clipping at the hardware limits: (±5V for B-Box 3, ±10V for B-Box 4).

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.

PLECS block

Signal specification

The input signal sets the analog output voltage. The signal saturates at hardware limits: ±5V for B-Box RCP 3.0 and ±10V for B-Box 4.

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

C++ functions

void Dac_Use(unsigned int channel, unsigned int device=0);Code language: C++ (cpp)

Activates a given analog output channel.

Can only be called in UserInit().

Parameters

  • output: the analog output channel number
  • device: the ID of the addressed device (optional, used in multi-device configuration only)
void Dac_SetVoltage(unsigned int output, float voltage, unsigned int device=0);Code language: C++ (cpp)

Sets the value of a given analog output channel in volts. Inputs exceeding hardware limits are saturated to the maximum or minimum allowable limits.

Can only be called in the interrupt routine.

Parameters

  • output: the analog output channel number
  • voltage: the value to output in volts
  • device: the ID of the addressed device (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 a given analog output channel using a raw 16-bit (or 12-bit on B-Box 4) value. Inputs exceeding hardware limits are saturated to the maximum allowable limit.

value = 0 → output = -10V, value = 4095 → output = 10V (on B-Box 4)

value = 0 → output = -5V, value = 65535 → output = 5V (on B-Box RCP 3.0)

Can only be called in the interrupt routine.

Parameters

  • output: the analog output channel number
  • value: the raw 16-bit or 12-bit value to output
  • device: the ID of the addressed device (optional, used in multi-device configuration only)