FUNCTION_BLOCK FLASHER4

Hover over a colored input or output
for a brief description.

As shown in the Execution Control Chart (ECC) and algorithms below, an instance of the Function Block type illustrated above sequences a set of four boolean outputs in an order determined by the MODE input. Following initialization by an event at the INIT input, successive steps in the output sequence are triggered by events at the REQ input.

The animation above shows the results of the following procedure:

  1. An instance of the FB type is launched from a test window using the FBDK.
  2. The FB is initialized by setting the MODE input to 3 (CHASE_UP) and clicking the INIT event input button.
  3. Successive events are generated by clicking on the REQ button.

The FLASHER_TEST, FLASHER_TESTL, FLASHER_TESTD, and FLASHER_TESTR system configurations are examples of the application of an instance of this type.

ECC
ST ALGORITHMS
ALGORITHM INIT IN ST :
LED0:=(MODE>2);
LED1:=false;
LED2:=false;
LED3:=false;
END_ALGORITHM

ALGORITHM COUNT_UP IN ST :
LED0:=NOT LED0;
IF NOT LED0 THEN
LED1:=NOT LED1;
IF NOT LED1 THEN
LED2:=NOT LED2;
IF NOT LED2 THEN LED3:=NOT LED3;END_IF;
END_IF;
END_IF;
END_ALGORITHM

ALGORITHM COUNT_DOWN IN ST :
LED0:=NOT LED0;
IF LED0 THEN
LED1:=NOT LED1;
IF LED1 THEN
LED2:=NOT LED2;
IF LED2 THEN LED3:=NOT LED3;END_IF;
END_IF;
END_IF;
END_ALGORITHM
FLASH_ALL
CHASE_UP
CHASE_DOWN