IEC 61131-3 C Tools User Manual


Add to my manuals
501 Pages

advertisement

IEC 61131-3 C Tools User Manual | Manualzz

IEC 61131-3 C Tools Function Specifications

poll_event

Test for Event Occurrence

Syntax

#include <ctools.h> int poll_event(int event);

Description

The poll_event function tests if an event has occurred.

The poll_event function returns TRUE, and the event counter is decrements, if the event has occurred. Otherwise it returns FALSE.

The current task continues to execute.

Notes

Refer to the Real Time Operating System section for more information on events.

Valid events are numbered 0 to RTOS_EVENTS - 1. Any events defined in primitiv.h are not valid events for use in an application program.

See Also

signal_event, startTimedEvent

Example

This program implements a somewhat inefficient transfer of data between com1 and com2. (It would be more efficient to test for EOF from getc).

}

#include <ctools.h> void main(void)

{ while(TRUE)

{ if (poll_event(COM1_RCVR)) fputc(getc(com1), com2); if (poll_event(COM2_RCVR)) fputc(getc(com2), com1);

}

/* Allow other tasks to execute */ release_processor();

Document (Version 2.50) 5/12/2011 363 363

advertisement

Was this manual useful for you? Yes No
Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Related manuals

advertisement

Table of contents