Supported platforms: CODESYS 2.3, CODESYS 3.5

EL_Update (FUN)

Description

This function updates event status including filtering and edge detection. The function can be called every program cycle.

 

The function input status changes are monitored every time this function is called. The event is logged when the status keeps the same state for a given time period. Separate time periods can be set for rising and falling edges.

 

When an event is logged, event ID, status and current time is saved to the event log.

 

Limitations

Initialization with EL_Init must be done before any other event log functions can be called. MultiTool Creator automatically generates initializations to the code template.

 

 

Inputs

Input variable name

Data type

Description

i_State

BOOL  

State of the event (event on/event off)

i_EventID

WORD

ID number of the event

i_OnDelay

WORD

Delay before setting the event on in internal array (ms). Default: 0 ms

i_OffDelay

WORD

Delay before setting the event off in internal array (ms). Default: 50 ms

i_ToIntEventLog

BOOL  

Defines whether the event is added to the internal event log. Default: FALSE

For example, Epec 5050 unit can have an internal event log  and also send events to the event consumer, for example 6107 display.

Return value

Data type

Range

Description

BOOL  

TRUE/FALSE

State of the event in internal array (includes on and off delays)

Example code

Definitions:

 

TYPE EL_EVENTS :

(

    EL_FIRST_EVENT,

    EL_SECOND_EVENT,

    EL_THIRD_EVENT,

    EL_FOURTH_EVENT,

    EL_FIFTH_EVENT,

    EL_SIXTH_EVENT,

    EL_SEVENTH_EVENT,

    EL_EIGHTH_EVENT,

    EL_END_OF_EVENTS

);

END_TYPE

 

VAR

    filtered_event_state: BOOL;

    event_state         : BOOL;

END_VAR

 

 

Init:

 

EL_Init();

 

 

See also

EL_Init(FUN).

 

Source file Topic000341.htm

Last updated 19-Dec-2024