EasyManua.ls Logo

HEKA EPC 9 - Page 95

HEKA EPC 9
101 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Controlling E9Screen EPC9 Installation 95
END; (* IF *)
IF NOT
IOText.Open(
MessageName,
IOFiles.Read + IOFiles.Shared,
MessageFile )
THEN
IF IOFiles.GetError() <> IOFiles.FileNotFound THEN
WriteError( 'Opening message file' );
END; (* IF *)
RETURN FALSE;
END; (* IF *)
LastSignature := -1;
RETURN TRUE;
END OpenMessageFile;
PROCEDURE PollForCommands;
VAR
InputString : ARRAY[0..127] OF CHAR;
NewSignature : INTEGER;
Count : INTEGER;
Dummy : BOOLEAN;
BEGIN
IF NOT CommandFile.IsOpen THEN
RETURN;
END; (* IF *)
IF ( NOT MessageFile.IsOpen ) AND ( NOT OpenMessageFile() ) THEN
RETURN;
END; (* IF *)
(* Read the first text line. If reading fails, or converting to a number
fails, or the resulting number is negative, then the answer from the
target E9Screen is not ready.
*)
NewSignature := -2;
Count := HIGH( InputString );
IF
( NOT IOText.SetPosition( MessageFile, IOFiles.FromStart, 0 ) ) OR
( NOT IOText.Read( MessageFile, Count, ADR( InputString ) ) )
THEN
RETURN;
END; (* IF *)
IF ( InputString[0] = 0C ) OR ( InputString[0] = '-' ) THEN
RETURN;
END; (* IF *)
Count := Encode.Integer( InputString, NewSignature );
IF ( NewSignature < 0 ) OR ( LastSignature = NewSignature ) THEN

Table of Contents