You are on page 1of 6

Library Description:

CoDeSys V 3.x
SysEvent.library

Document Version 1.0


libdoc_e.dot / V1.0

3S - Smart Software Solutions GmbH Page 1 of 6


SysEvent_V3x_E.doc
Library SysEvent.library

CONTENT

1 OVERVIEW 3

2 LIBRARY MODULES 4
2.1 SysEventCreate 4
2.2 SysEventDelete 4
2.3 SysEventSet 4
2.4 SysEventWait 5

CHANGE HISTORY 6
libdoc_e.dot / V1.0

3S - Smart Software Solutions GmbH Page 2 of 6


SysEvent_V3x_E.doc
Library SysEvent.library

1 Overview

Note: Es hngt vom verwendeten Zielsystem ab, welche Systembibliotheken im Steuerungsprogramm verwendet
werden knnen.

This library provides functions for synchronizing and controlling the processing of two (IEC-)
tasks.

A task currently waiting for an event can be re-activated by setting this event by a second
task.

The following events are available for creating, deleting, starting resp. setting a timeout of a
task. The processing is synchronous:

SysEventCreate
SysEvebtDelete
SysEventSet
SysEventWait
libdoc_e.dot / V1.0

3S - Smart Software Solutions GmbH Page 3 of 6


SysEvent_V3x_E.doc
Library SysEvent.library

2 Library Modules

2.1 SysEventCreate
This function serves to create and name a new event.

The return value of type UDINT is a handle, identifying the event and required as input for the
other library functions.
Input Variable Data type Description

szEvent REFERENCE TO STRING Name for the event

pResult POINTER TO Pointer on error code, see document Runtime


RTS_IEC_RESULT Error Codes

2.2 SysEventDelete
This function serves to delete an event which is identified by the handle returned by
SysEventCreate.

The return value of type UDINT contains an error code and tells about the success of the
operation.
Input Variable Data type Description

hEvent UDINT Handle of the event to be deleted, returned by


SysEventCreate

2.3 SysEventSet
This function serves to set an event which is identified by the handle returned by
SysEventCreate. Thereby the task currently waiting for the event via SysEventWait will get
active.

The return value of type UDINT contains an error code and tells about the success of the
operation.
Input Variable Data type Description

hEvent UDINT Handle of the event to be set, returned by


SysEventCreate
libdoc_e.dot / V1.0

3S - Smart Software Solutions GmbH Page 4 of 6


SysEvent_V3x_E.doc
Library SysEvent.library

2.4 SysEventWait
This function serves to wait for the event. By setting a timeout you can define the wait time.
The event for which should be waited is identified by the handle returned by SysEventCreate.

The return value of type UDINT contains an error code and tells about the success of the
operation.
Input Variable Data type Description

hEvent UDINT Handle of the event for which the timeout


should be set, returned by SysEventCreate
ulTimeout UDINT Time in milliseconds, after which the function
will return at the latest, even if the event could
not be detected. In this case ERR_TIMEOUT
will be returned as result.
By ulTimeout = 16#FFFFFFFF an infinite wait
time can be set.
libdoc_e.dot / V1.0

3S - Smart Software Solutions GmbH Page 5 of 6


SysEvent_V3x_E.doc
SysEvent.library

Change History
Version Description Date

0.1 Issued 26.07.2007


1.0 Rework acc. to German version, Release 08.08.2007
libdoc_e.dot / V1.0

3S - Smart Software Solutions GmbH Page 6 of 6


SysEvent_V3x_E.doc

You might also like