Siemens SIMATIC S7-200 System Manual page 101

Programmable controller
Hide thumbs Also See for SIMATIC S7-200:
Table of Contents

Advertisement

Changing PPI Communications to Freeport Mode
SMB30 and SMB130 configure the communications ports, 0 and 1 respectively, for Freeport
operation and provide selection of baud rate, parity, and number of data bits. Figure 6-8 describes
the Freeport control byte. One stop bit is generated for all configurations.
MSB
7
p
p
d
b
b
b
SMB30
=
Port 0
SMB130 =
Port 1
pp:
Parity select
00 =
no parity
01 =
even parity
10 =
no parity
11 =
odd parity
d:
Data bits per character
0 =
8 bits per character
1 =
7 bits per character
Figure 6-8
SM Control Byte for Freeport Mode (SMB30 or SMB130)
Transmitting Data
The Transmit instruction lets you send a buffer of one or more characters, up to a maximum of
255.
Figure 6-9 shows the format of the
Transmit buffer.
If an interrupt routine is attached to the
transmit complete event, the S7-200
generates an interrupt (interrupt event 9
for port 0 and interrupt event 26 for port
1) after the last character of the buffer is
1) after the last character of the buffer is
sent.
You can make transmissions without using interrupts (for example, sending a message to a
printer) by monitoring SM4.5 or SM4.6 to signal when transmission is complete.
You can use the Transmit instruction to generate a BREAK condition by setting the number of
characters to zero and then executing the Transmit instruction. This generates a BREAK condition
on the line for 16-bit times at the current baud rate. Transmitting a BREAK is handled in the same
manner as transmitting any other message, in that a Transmit interrupt is generated when the
BREAK is complete and SM4.5 or SM4.6 signals the current status of the Transmit operation.
Receiving Data
The Receive instruction lets you receive a buffer of one or more characters, up to a maximum of
255.
Figure 6-10 shows the format of the
Receive buffer.
If an interrupt routine is attached to the
receive message complete event, the
S7-200 generates an interrupt (interrupt
event 23 for port 0 and interrupt event 24
for port 1) after the last character of the
for port 1) after the last character of the
buffer is received.
You can receive messages without using interrupts by monitoring SMB86 (port 0) or SMB186
(port 1). This byte is non-zero when the Receive instruction is inactive or has been terminated. It is
zero when a receive is in progress.
LSB
0
bbb: Freeport baud rate
m
m
000 =
001 =
010 =
011 =
100 =
101 =
110 =
111 =
mm: Protocol selection
00 =
01 =
10 =
11 =
Count
Figure 6-9
Count
Figure 6-10 Format for the Receive Buffer
S7-200 Instruction Set
38,400 baud
19,200 baud
9,600 baud
4,800 baud
2,400 baud
1,200 baud
1
Requires S7-200
1
115.2 kbaud
CPUs version 1.2
1
57.6 kbaud
or later
PPI/slave mode
Freeport protocol
PPI/master mode
Reserved (defaults to PPI/slave mode)
M
E
S
S
Characters of the message
Number of bytes to transmit (byte field)
Format for the Transmit Buffer
Start
M
E
S
S
A
Char
Characters of the message
Number of bytes received (byte field)
Chapter 6
A
G
E
End
G
E
Char
87

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents