GPO - General purpose outputs

The GPO block, or its equivalent C++ routines, is responsible for asserting the specific logic states of the General Purpose Outputs (GPO) pins. This interface allows imperix’s programmable controllers to drive external signals effectively.

Hardware specifications, including location, voltage logic levels and output counts, are summarized in the reference table below. Detailed specifications regarding the GPO can be found within the associated product datasheet. Additionally, a comprehensive technical comparison of imperix’s programmable controllers is provided in PN250.

Param.B-Box 4B-Box 3B-Box microB-Board 3 PRO
Location and count– 48x fiber/VHDCI outputs– 16x VHDCI outputs– 8x PCB header outputs– 16x PCB header outputs
Logic level– 3.3V/5V (elec.)– 3.3V/5V– 5V– 3.3V
Shared with– PWMN/AN/AN/A
Product datasheetB-Box 4B-Box 3B-Box microB-Board 3 PRO

Signal specification

The GPO pin is set if the input is >0.

Parameters

  • Device ID selects which B-Box/B-Board to address when used in a multi-device configuration.
  • GPO pin(s) (vectorizable) is the GPO pin(s) to control. It can be a single value or a vector.
  • Reset pin value to 0 in case of fault acts when a fault is detected, for instance when an analog inputs exceeds a configured limit value.
  • Show simulation output port defines if the simulation output is displayed or not.

PLECS block

Signal specification

The GPO pin is set if the input is >0.

General purpose outputs PLECS block

Parameters

  • Device ID selects which B-Box/B-Board to address when used in a multi-device configuration.
  • GPO pin(s) (vectorizable) is the GPO pin(s) to control. It can be a single value or a vector.
  • Optional reset can be set to Reset pin value to 0 in case of fault to act when a fault is detected, for instance when an analog inputs exceeds a configured limit value.
  • Simulation input port defines if the target outport is displayed or not. This parameter is only used in simulation.

C++ functions

Standard functions

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

Activates a given GPO pin on B-Box 4 devices. Since these pins are shared with CB-PWM, this function determines the active output type.

Can only be called in UserInit().

Parameters

  • bit: the GPO pin number
  • device: the ID of the addressed device (optional, used in multi-device configuration only)
void Gpo_SetBit(unsigned int bit, unsigned int device=0);Code language: C++ (cpp)

Sets a given GPO pin.

Can be called in the interrupt routine.

Parameters

  • bit: the GPO pin number
  • device: the ID of the addressed device (optional, used in multi-device configuration only)
void Gpo_ClearBit(unsigned int bit, unsigned int device=0);Code language: C++ (cpp)

Clears a given GPO pin.

Can be called in the interrupt routine.

Parameters

  • bit: the GPO pin number
  • device: the ID of the addressed device (optional, used in multi-device configuration only)

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

Toggles a given GPO pin.

Can be called in the interrupt routine.

Parameters

  • bit: the GPO pin number
  • device: the ID of the addressed device (optional, used in multi-device configuration only)
void Gpo_ForceBit(unsigned int bit, unsigned int value, unsigned int device=0);Code language: C++ (cpp)

Sets a given GPO pin to value.

value = 0 → GPO(bit) = 0
value > 0 → GPO(bit) = 1

Can be called in the interrupt routine.

Parameters

  • bit: the GPO pin number
  • value: the value to apply to the GPO pin (0 or 1)
  • device: the ID of the addressed device (optional, used in multi-device configuration only)
void Gpo_ClearBitInCaseOfFault(unsigned int bit, unsigned int device=0);Code language: C++ (cpp)

Configures a given GPO pin to clear automatically upon a system fault.

Can only be called in UserInit().

Parameters

  • bit: the GPO pin number
  • device: the ID of the addressed device (optional, used in multi-device configuration only)

Legacy functions

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

Sets the whole 16-bit GPO register.

Can be called in the interrupt routine.

Parameters

  • value: the 16-bit value to apply to the GPO outputs
  • device: the ID of the addressed device (optional, used in multi-device configuration only)