rfbcWaitEvent (Function) |
Top Previous Next |
This function will wait until an event is raised. It has an optional timeout.
An event is a notification that something has happened in the RFBC interface. There are three types of events: 1. Unknown: a message which could not be processed was received. No acknowledgment has been sent. 2. Notification: a message broadcasted from another device. No acknowledgment has been sent. 3. Requests/updates: a message addressed to this device. The device will process and acknowledge according to current configuration (see rfbcGetConfig/rfbcSetConfig).
The events are queued until appropriate action is taken as described in this table:
Only a single event of the type 2 and 3 can be handled at a time. This means that if the appropriate action is not taken, rfbcWaitEvent will continue to report the same event.
Note: waiting for an event using this function will block the calling thread.
Input: timeout : INT (-1,0..32000) (default -1) Timeout period in milliseconds to wait.
Output: id : DINT The ID of the sending device. This ID must be used when sending direct requests/notifications to a specific device.
broadcast : BOOL If true, then this message was not sent to a specific device and was therefore not replied with an acknowledgment to confirm the reception.
Returns: INT
Declaration: FUNCTION rfbcWaitEvent : INT;
Example: INCLUDE rtcu.inc |