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

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

Returns the GPI pin value (0 or 1).

It has to be called in the control 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 GPI pin value (0 or 1)
int Gpi_Get(unsigned int device=0);Code language: C++ (cpp)

Return the whole 16 GPI inputs values in the form of a 16-bit value.

It has to be called in the interrupt.

Parameters

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

Return value

  • The whole 16 inputs GPI value in the form of a 16-bit value