Program instructions
7.3 Communication
S7-200 SMART
210
System Manual, V2.3, 07/2017, A5E03822230-AF
3.
Message timer:
The message timer terminates a message at a specified time after the
start of the message. The message timer starts as soon as the start condition(s) for the
receive message function have been met. The message timer expires when the number
of milliseconds specified in SMW92 or SMW192 has passed. See the following figure.
Typically, you use a message timer when the communications devices cannot guarantee
that there will not be time gaps between characters or when operating over modems. For
modems, you can use a message timer to specify a maximum time allowed to receive the
message after the message has started. A typical value for a message timer would be
about 1.5 times the time required to receive the longest possible message at the selected
baud rate.
You can use the message timer in combination with the end character detection and the
maximum character count to terminate a message.
Setup: c/m = 1, tmr = 1, SMW92/SMW192 = timeout in milliseconds
①
Start of the message: Starts the message timer
②
The message timer expires: Terminates the message and generates the Receive message
interrupt
4.
Maximum character count:
The Receive instruction must be told the maximum number of
characters to receive (SMB94 or SMB194). When this value is met or exceeded, the
receive message function is terminated. The Receive instruction requires that the user
specify a maximum character count even if this is not specifically used as a terminating
condition. This is because the Receive instruction needs to know the maximum size of
the receive message so that user data placed after the message buffer is not overwritten.
The maximum character count can be used to terminate messages for protocols where
the message length is known and always the same. The maximum character count is
always used in combination with the end character detection, intercharacter timer, or
message timer.
5.
Parity errors:
The Receive instruction automatically terminates when the hardware signals
a parity, framing, or overrun error; or if a break condition is detected after the start of a
message. Parity errors occur only if parity is enabled in SMB30 or SMB130. Framing
errors occur if the stop bit is not correct. Overrun errors occur if characters come in to
quickly for the hardware to handle. A break condition terminates a message because it
resembles a parity or framing error to the hardware. There is no way to disable this
function.
6.
User termination:
The user program can terminate a receive message function by
executing another Receive instruction with the enable bit (EN) in SMB87 or SMB187 set
to zero. This immediately terminates the receive message function.