
MVI-ADM ♦ 'C' Programmable Side-Connect API Library Functions
'C' Programmable Application Development Module Developer's Guide
ProSoft Technology, Inc. Page 317 of 342
February 20, 2013
MVIsc_PLCMsgWait
Syntax
int MVIsc_PLCMsgWait(HANDLE handle, BYTE msgnum, BYTE msgtype, WORD timeout);
Parameters
returned by previous call to MVIsc_Open
PLC-5 message number (0 to 31)
Message type (read or write)
Maximum number of milliseconds to wait for message instruction
Description
MVIsc_PLCMsgWait returns the current status of the message handler specified
by msgnum.
handle must be a valid handle returned from MVIsc_Open. msgtype must be set
to MVISC_MSGTYP_READ to specify a read message, or
MVISC_MSGTYP_WRITE to specify a write message. If timeout is set to zero,
the current status of the specified message handler is returned immediately. If
timeout is not zero, the function will return when the message instruction has
been completed, or when timeout milliseconds have expired.
Return Value
The message-read or message-write instruction has completed
successfully.
handle does not have access
No message handler has been registered for msgnum.
The timeout expired before the message instruction occurred.
The message instruction has not yet occurred (Note: This result
code is only returned if timeout is set to zero).
Example
HANDLE Handle;
/* Wait here until message handler 1 has completed, timeout=10 seconds */
rc = MVIsc_PLCMsgWait(Handle, 1, MVISC_MSGTYP_READ, 10000);
if (rc != MVISC_SUCCESS)
printf("ERROR: MVIsc_PLCMsgWait failed");
Kommentare zu diesen Handbüchern