COMCHECK
8.6D
The COMCHECK instruction monitors the COMFILE states while waiting for specified mask byte settings to become true. The instruction uses the following format:
|
|
|
|
|
Where:
label
Optional. A Program Execution Label.
comfile
Required. A previously defined and opened COMFILE definition.
mask
Required. A previously defined Character String Variable or literal that contains a byte mask.
timeout
Required. A previously defined Numeric Variable or literal identifying the number of seconds to wait.
state
Required. A literal or previously defined Character String Variable that receives the output characters of a COMSTAT instruction.
Flags Affected: ZERO, OVER, EOS
Note the following:
The COMCHECK instruction suspends the program execution until a mask byte setting becomes true or a timeout occurs.
When any one of the masked byte settings becomes true (1), COMCHECK exits and continues execution of a program.
To prevent an overload of the CPU usage, the COMCHECK instruction monitors the states every fifty (50) milliseconds.
The {mask} parameter must contain a byte mask identifying the bytes in the state to monitor. The {mask} consists of zero or one characters. A byte character of one in a mask position identifies that the corresponding byte position in the COMSTAT output string should be monitored for a byte character value of one.
The {timeout} parameter identifies the number of seconds to wait for any {mask} byte to become true. {timeout} can be specified as a value with a decimal point with up to three digits to the right of the decimal point. This allows specification of a timeout value less than one second. Note that the timeout occurs in fifty milliseconds increments to avoid overload of the processor.
The {state} parameter must be large enough to hold all of the output characters of a COMSTAT instruction. If the {state} variable is too small, an I97 error occurs. The string returned in the {state} variable is identical to the COMSTAT output and contains the last string processed by the COMCHECK instruction.
The ZERO flag is set when the COMCHECK instruction returns with a {mask} byte value set to true in the {state} byte string.
The OVER flag is set when the COMCHECK instruction returns due to a timeout.
The EOS flag is affected because the COMCHECK performs internal COMSTAT operations that affect this flag. The flag will always be FALSE.
The intended use for the COMCHECK instruction is to simplify the logic required to determine when a given state is true while improving the overall communications performance.
This verb will clear any outstanding FILEPI.
See Also: Communication I/O Instructions
![]() |