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 PA-2400W is connected to I/O Box. After a confirmation on the session establishment, the process continue to a next job.

Place PA-2400W on I/O Box.

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 sub-thread throws a message to the main program which makes the main program confirms the session. Refer to Chapter 5.5 “Sample Program” on page 38 for a sample program to use the function in “Multiple-Thread Mode”.

37

Page 37
Image 37
Casio PA-2400W manual Use of ioboxchk, Sequential Mode, Multiple-Thread Mode