GPI - General purpose inputs

The GPI block (or its C++ routines) is responsible for reading the the logic states of the General Purpose Inputs (GPI) pins. This function allows the controller to read external digital signals efficiently.

Voltage logic levels, location and input counts are summarized in the reference table below, while detailed hardware specifications can be found within the associated product datasheet.

A comprehensive technical comparison of imperix’s programmable controllers is also provided in PN250.

Param.B-Box 4B-Box 3B-Box microB-Board 3 PRO
Location and count– 24x VHDCI inputs– 16x VHDCI inputs– 8x PCB header inputs– 16x PCB header inputs
Logic level– 3.3V/5V– 3.3V/5V– 5V– 3.3V
Shared with– FLTN/AN/AN/A
Product datasheetB-Box 4B-Box 3B-Box microB-Board 3 PRO

Signal specification

The output signal returns the value of one GPI pin.

Parameters

  • Device ID selects which B-Box/B-Board to address when used in a multi-device configuration.
  • GPI pin(s) (vectorizable) a selection of GPI pin(s) to read. It can be a single value or a vector.
  • Show simulation input port defines if the simulation input is displayed or not.
GPI Simulink dialog

PLECS block

Signal specification

The output signal returns the value of one GPI pin.

General purpose inputs PLECS block

Parameters

  • Device ID selects which B-Box/B-Board to address when used in a multi-device configuration.
  • GPI pin(s) (vectorizable) a selection of GPI pin(s) to read. It can be a single value or a vector.
  • Simulation input port defines if the target inport is displayed or not. This parameter is only used in simulation.

C++ functions

Standard functions

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

Activates the GPI pin on B-Box 4 devices. Since these pins are shared with FLT, this function determines the active input type.

Can only be called in UserInit().

Parameters

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

Returns the value (0 or 1) of a given GPI pin.

Can be called in the interrupt routine.

Parameters

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

Return value

  • The value of the GPI pin

Legacy functions

int Gpi_Get(unsigned int device=0);Code language: C++ (cpp)

Returns the value of all GPI pins in the form of a 16-bit value.

Can be called in the interrupt routine.

Parameters

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

Return value

  • The value of all GPI pins