SBI - Sandbox input from FPGA

The Sandbox Input from FPGA (SBI) block reads the value of the SBI registers in the FPGA. It is used to transfer data from user-made code within the FPGA to the CPU. To transfer data from the CPU to the user-made code within the FPGA, the SBO block should be used.

Information on FPGA edition is available on:

Usage examples of the SBI block are available on:

Simulink block

Signal specification

The output returns a vector of the 16-bit unsigned integers representing the SBI register values. Up to 8 registers can be read from a single SBI block. Multiple SBI blocks can be used to read more registers.

Parameters

  • Device ID selects which B-Box/B-Board to address when used in a multi-device configuration.
  • Starting register number and Number of registers defines the range of registers to read.

PLECS block

Signal specification

The output returns a vector of the 16-bit unsigned integers representing the SBI register values. Up to 8 registers can be read from a single SBI block. Multiple SBI blocks can be used to read more registers.

Parameters

  • Device ID selects which B-Box/B-Board to address when used in a multi-device configuration.
  • Starting register number and Number of registers defines the range of registers to read.

C++ functions

uint16_t Sbi_ReadDirectly(unsigned int address, unsigned int device=0);Code language: C++ (cpp)

Returns the SBI register value.

Can only be called in UserInit().

Parameters

  • address : address of the target SBI register
  • device : the ID of the addressed device (optional, used in multi-device configuration only)
uint16_t Sbi_Read(unsigned int address, unsigned int device=0);Code language: C++ (cpp)

Returns the SBI register value. The target register must be configured for real-time access via Sbi_ConfigureAsRealTime(); otherwise, the function returns 0.

Can only be called in the interrupt routine.

Parameters

  • address : address of the target SBI register
  • device : the ID of the addressed device (optional, used in multi-device configuration only)
void Sbi_ConfigureAsRealTime(unsigned int address, unsigned int device=0);Code language: C++ (cpp)

Configures a given SBI register as real-time, meaning that its value is transferred to the CPU before each interrupt routine. The value of this SBI register can be retrieved by Sbi_Read().

Can only be called in UserInit().

Parameters

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