User`s manual

EM1500 User’s Manual www.rabbit.com 57
Poll timeout (ms)
Poll sequence must complete within this timeout. “Poll timeout (ms)” specifies the
allowable time interval for the device to completely respond to the poll sequence. If it
does not respond, then the poll sequence has failed. When it fails, the next poll
sequence is not affected, but the EM1500 can be configured to close a connection if
this happens.
Poll script
Poll script specifies the polling sequence in send/expect script format. This is a string
that is entered with the syntax described below, in the order of send string followed by
expect string. In the simplest case, you can just set this to a send-string without any
expected response. This would send the string out the serial port at regular intervals,
but not look for any particular response. For example, the send string could be just
“\r\n” (carriage return + line feed). This would be equivalent to hitting the return key
regularly if a terminal was connected to the device rather than the EM1500. Since no
particular response is expected, the script will never time out. If the device sends some
data back in response to CRLF, then that data will be forwarded over the network (if a
connection is established).
The next level up in complexity is to actually expect a particular response to a query.
For example, if the device is set up so that if it gets “HELLO<CRLF>” then it
responds with “OK”, then the following poll sequence could be used:
'HELLO OK'
A space separates the send and expect portion. Note that a CRLF is added by default
to the send string, so it should not be explicitly specified.
This sequence executes as follows:
The EM1500 sends the string “HELLO<CRLF>” to the serial port.
The device may be in the process of sending previous data. This data is intercepted by
the EM1500 while it is looking for the OK response. The data will be discarded, or may
be passed through to the network peer.
The device eventually receives the HELLO string and sends the OK response.
The EM1500 will see the OK response. It absorbs the OK (unless pass through is
enabled), then starts passing on the data immediately following the OK as per normal.
Poll Script Syntax
The full syntax for specifying the poll script is as follows:
[ send expect ]...
where “send” is a token to send, and “expect” is a token to expect in return, before the
next send/expect pair is executed. Either “send” or “expect” may be omitted; use
empty single quotes as a place-holder.