Visara Master Console Center Scripting Guide User Manual
Page 169
Chapter 5 Script Commands
Scripting Guide
169
the printer message queue. It is placed in the printer message queue
after the user presses
3. Incomplete messages are not available to QREAD().
4. Each message pointer can be moved with QSKIP().
5. If the OS Console is an RS232 or Telnet connection, and was
defined with the no_printer flag, this command will not work with
that OS. See QOPEN() for more details.
Example:
//==============================================
// Example 1
//==============================================
%Wait := 180
%QID := QOPEN()
//open queue on current OS
WHILE TRUE
//repeat process continually
$Msg := QREAD( %QID, $MsgArray, %Wait)
IF $Msg == “”
//if null, then no msg was
received
//the building of the $Temp string to display
//on the log is done this way here simply due to
//width restrictions of the printed page
//Normally, build it on one line or place the
//entire string in the LOG command
$Temp := “No messages in ” + STR( %Wait)
$Temp := $Temp + “ seconds on OS: ”
$Temp := $Temp + $MsgArray[ 1])
LOG( LOG_FLT, $Temp, STATUS_WARNING)
ENDIF
//check first word of msg for IO
// err $MsgArray[ 1] will always
//have
OS
name
IF $MsgArray[ 2] == “IOS000I”
//call IO err handling script passing OS name
IOERROR(
$MsgArray[
1])
ENDIF
ENDWHILE
//====================================================
// Example 2
//====================================================
%Wait := 30
%ObjIDSys5[ 1] := OBJID( OS, “SYS5”)
%QIDSys5 := QOPEN( %ObjIDSys5)
$Msg := QREAD( %QIDSys5, $MsgArray, %Wait, “error”)
IF $Msg == “”
//if null, then no msg was received
$Temp := “No msgs for ” + STR( %Wait)
$Temp := $Temp + “ seconds: ” + $MsgArray[ 1]
LOG( LOG_FLT, $Temp, STATUS_WARNING)
ELSE
LOG( LOG_FLT, $Msg, STATUS_ERROR)
ENDIF
See Also:
QCLOSE, QOPEN, QPREVIEW, QSKIP, PORT, SCANB, SCANP