09.12.2012 Views

Basic Characteristics RAPID

Basic Characteristics RAPID

Basic Characteristics RAPID

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

ReadBin Reads from a binary serial channel<br />

Example<br />

ReadBin (Read Binary) is used to read a byte (8 bits) from a binary serial channel.<br />

VAR iodev inchannel;<br />

.<br />

Open "sio1:", inchannel\Bin;<br />

character := ReadBin(inchannel);<br />

A byte is read from the binary channel inchannel.<br />

Return value Data type: num<br />

Arguments<br />

A byte (8 bits) is read from a specified serial channel. This byte is converted to the<br />

corresponding positive numeric value. If the file is empty (end of file), the number -1<br />

is returned.<br />

ReadBin (IODevice [\Time])<br />

IODevice Data type: iodev<br />

The name (reference) of the current serial channel.<br />

[\Time] Data type: num<br />

Program execution<br />

The max. time for the reading operation (timeout) in seconds. If this argument is<br />

not specified, the max. time is set to 60 seconds.<br />

If this time runs out before the reading operation is finished, the error handler<br />

will be called with the error code ERR_DEV_MAXTIME. If there is no error<br />

handler, the execution will be stopped.<br />

The timeout function is in use also during program stop and will be noticed in<br />

<strong>RAPID</strong> program at program start.<br />

Program execution waits until a byte (8 bits) can be read from the binary serial channel.<br />

<strong>RAPID</strong> Reference Manual 9-ReadBin-1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!