Siemens Simatic S7-200 System Manual page 96

Hide thumbs Also See for Simatic S7-200:
Table of Contents

Advertisement

S7-200 Programmable Controller System Manual
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.
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 Figure 6-11.
You can use the intercharacter timer to terminate a message for protocols which do not have a
6
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.
Figure 6-11
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 have passed. See Figure 6-12.
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.
84
Setup:
ec = 1, SMB89/SMB189 = end character
Setup:
c/m = 0, tmr = 1, SMW92/SMW192 = timeout in milliseconds
Characters
Restarts the intercharacter
timer
Using the Intercharacter Timer to Terminate the Receive Instruction
Setup:
c/m = 1, tmr = 1, SMW92/SMW192 = timeout in milliseconds
Characters
The intercharacter timer expires:
Terminates the message and generates the
Receive Message interrupt

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents