gtpc2m1y | C/C++ Language Support User's Guide |
This function defines to the control program a named event that can be waited on by this ECB and posted by other ECBs. This function is used with the evnwc and postc functions.
Format
include <tpfapi.h> int evntc(struct ev0bk *evninf, enum t_evn_typ evtyp, char evn_name, int timeout, enum t_state evstat);
A counter event is complete when the specified count becomes zero. The postc function decreases the event count by 1. A mask event is complete when the mask is completely reset. The postc function uses a 16-bit mask to reset the mask bits. Core block events are completed after the first postc function call. A list event is completed when all the data items have been posted.
Normal Return
Integer value of zero.
Error Return
An integer value of 1 is returned if the event name already exists.
Programming Considerations
To ensure completion of the operation, call the evnwc function.
Examples
The following example defines a count event to be named by the system with a time-out of 250 seconds, and capable of running in all system states.
#include <tpfeq.h> struct ev0bk event_blk;
·
·
·
event_blk.evnpstinf.evnbkc1 = 1; evntc(&event_blk, EVENT_CNT, 'N', 250, EVNTC_1052);
Related Information