Methods

Open

Open the stream

Open the stream.

Close

Close the stream

Close the stream.

Read String

Read a string from a stream

Read a number of characters from the stream.

Read Line

Read a line from a steam.

Read a line of data from a stream as a string.

The line terminator can be changed on the setup page.

Read Byte

Read a single byte from a steam.

Read a single byte from a stream.

The byte is returned both as the actual value, and as a single character as defined by stream’s encoding.

Read Until

Read from a stream until a given string is read.

Read from the stream until the given terminator is read.

Read Until Silent

Read from a steam until no data has been received for a given time.

Read from a stream until it has been silent for a defined time.

Write String

Write a string to the stream

Write a string to the stream using the encoding defined on the stream.

Write Binary Data from string

Write binary data to the stream. The data is taken from a string listing the binary values. To decode the data string a decoder for the specific format must be selected.

Write binary data to the stream.

The binary data is given as a hexadecimal encoded string.

Write Text

Write multiple lines of text to the stream

This method has been deprecated.

Flush

Flush read/write buffers of the stream

Flush the buffers of the stream.

Read XML

Read an XML element from the stream.

Read Bytes

Read a number of bytes from the stream

Read a given number of bytes from the stream.

If the stream reports an error while reading (timeout or end-of-stream), the script can ignore this error using the Error Handling tab and the bytes which was read will still be returned.

Write Bytes

Write an array of bytes to the stream

Write an array of bytes to a stream.

The bytes are given as an array of integers, if the integers given is outside the range of byte the ValueOutOfRangeError will be reported.

Request and wait for response

Write a string or byte-array to a stream and read the response.

Write a string or an array of bytes and wait for, and read the response.

This method is useful because other users of the stream are prevented from using the stream while the Request and wait for response step is executing, for example to prevent panels from reading and writing from the stream while waiting for a response.

The input and output data are always the same type, so the step should be marked as either using strings or a byte array.