Download RAPID reference manual

Transcript
ClearIOBuff
Instruction
File and Serial Channel Handling
ClearIOBuff - Clear input buffer of a serial channel
ClearIOBuff (Clear I/O Buffer) is used to clear the input buffer of a serial channel. All
buffered characters from the input serial channel are discarded.
Example
VAR iodev channel2;
...
Open "com2:", channel2 \Bin;
ClearIOBuff channel2;
WaitTime 0.1;
The input buffer for the serial channel referred to by channel2 is cleared. The
waittime guarantees the clear operation enough time to finish.
Arguments
ClearIOBuff
IODevice
IODevice
Data type: iodev
The name (reference) of the serial channel whose input buffer is to be cleared.
Program execution
All buffered characters from the input serial channel are discarded. Next read instructions will wait for new input from the channel.
Limitations
This instruction can only be used for serial channels. No wait for acknowledge of the operation is done. A waittime 0.1 after the instruction
is recommended to give the operation enough time in every application.
Error handling
If trying to use the instruction on a file, the system variable ERRNO is set to
ERR_FILEACC. This error can then be handled in the error handler.
RAPID reference manual - part 1a, Instructions A-R
33