5.4Use of iobox_chk
Internally, this function creates an event object of I/O Box and waits for the object for a specified time. During the wait time, it is possible to dispatch another task. Therefore, there are two ways of usage as stated below.
Sequential Mode
This mode is to call the function and check if the
Place
iobox_chk (30)
Yes
Connected ?
No
Next Job
Error Process
Fig. 5.2
Multiple-Thread Mode
Main program creates a thread (CreateThread( ) ) for session with I/O Box and calls the function within this thread to wait for the establishment of session with the I/O Box. While the main program waits in the loop, it makes necessary processes of each message.
After the created thread confirms the session, the
37