General description

The Core state block returns the state of the target:

  • 0 = FAULT: The target received an error signal and waits for a user acknowledgment to switch back to BLOCKED state (PWM disabled)

  • 1 = BLOCKED: PWM disabled, the target waits for the enable command to switch to OPERATING and activate its PWM outputs.

  • 2 = OPERATING: The PWM outputs are enabled.

The block also provides a second signal called “reset” that can be wired to the external reset input of PID controllers to keep the integrator at reset when the target is not in OPERATING state.

Simulink block

Signal specification

  • The first output port s returns the core state of the B-Box/B-Board. (0=FAULT, 1=BLOCKED, 2=OPERATING)
    In simulation the output port s always returns the value 2 (OPERATING).

  • The second output port r provides the reset signal.
    reset = 1 when s=FAULT or s=BLOCKED
    reset= 0 when s=OPERATING
    In simulation, the reset output port always returns the value 0

Parameters

PLECS block

Signal specification

  • The output port s returns the core state of the B-Box/B-Board. (0=FAULT, 1=BLOCKED, 2=OPERATING)
    In simulation the output port s always returns the value 2 (OPERATING).

  • The second output port provides the reset signal.
    reset = 1 when s=FAULT or s=BLOCKED
    reset= 0 when s=OPERATING
    In simulation, the reset output port always returns the value 0

Parameters

C++ functions

tCoreState GetCoreState();

This function is used to return the current state of the core.

Return value

  • tCoreState: Current state of the core. The following states can be returned

typedef enum {
	FAULT = 0,
	BLOCKED = 1,
	OPERATING = 2
} tCoreState;
int reset = (GetCoreState() < 2)

This code snippet shows how a reset signal can be created.

Return value

  • 0: Reset not activated. This value is returned when the state is OPERATING

  • 1: Reset activated. This value is returned when the state is not OPERATING

  • No labels