Program instructions
7.3 Communication
S7-200 SMART
System Manual, V2.3, 07/2017, A5E03822230-AF
209
The Receive instruction supports several ways to terminate a message. The message can
be terminated on one or a combination of the following:
1.
End character detection:
The end character is any character which is used to denote the
end of the message. After finding the start condition, the Receive instruction checks each
character received to see if it matches the end character. When the end character is
received, it is placed in the message buffer and the receive is terminated.
Typically, you use end character detection with ASCII protocols where every message
ends with a specific character. You can use end character detection in combination with
the intercharacter timer, the message timer or the maximum character count to terminate
a message.
Setup: ec = 1, SMB89/SMB189 = end character
2.
Intercharacter timer:
The intercharacter time is the time measured from the end of one
character (the stop bit) to the end of the next character (the stop bit). If the time between
characters (including the second character) exceeds the number of milliseconds specified
in SMW92 or SMW192, the receive message function is terminated. The intercharacter
timer is restarted on each character received. See the following figure.
You can use the intercharacter timer to terminate a message for protocols which do not
have a specific end-of-message character. This timer must be set to a value greater than
one character time at the selected baud rate since this timer always includes the time to
receive one entire character (start bit, data bits, parity and stop bits).
You can use the intercharacter timer in combination with the end character detection and
the maximum character count to terminate a message.
Setup: c/m = 0, tmr = 1, SMW92/SMW192 = timeout in milliseconds
①
Restarts the intercharacter timer
②
The intercharacter timer expires: Terminates the message and generates the Receive mes-
sage interrupt