Transmit And Receive Instructions (Freeport) - Siemens SIMATIC S7-200 System Manual

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

Advertisement

S7-200 Programmable Controller System Manual

Transmit and Receive Instructions (Freeport)

The Transmit instruction (XMT) is used in Freeport mode to
transmit data by means of the communications port(s).
The Receive instruction (RCV) initiates or terminates the
receive message function. You must specify a start and an
end condition for the Receive box to operate. Messages
received through the specified port (PORT) are stored in the
data buffer (TBL). The first entry in the data buffer specifies
the number of bytes received.
Error conditions that set ENO = 0
H 0006 (indirect address)
H 0009 (simultaneous Transmit/Receive on port 0)
H 000B (simultaneous Transmit/Receive on port 1)
H Receive parameter error sets SM86.6 or SM186.6
H S7-200 CPU is not in Freeport mode
Table 6-12
Valid Operands for the Transmit and Receive Instructions
Inputs/Outputs
TBL
PORT
For more information about using Freeport mode, see the section Creating User-Defined
Protocols with Freeport Mode on page 226 in Chapter 7.
Using Freeport Mode to Control the Serial Communications Port
You can select the Freeport mode to control the serial communications port of the S7-200 by
means of the user program. When you select Freeport mode, your program controls the operation
of the communications port through the use of the receive interrupts, the transmit interrupts, the
Transmit instruction, and the Receive instruction. The communications protocol is entirely
controlled by the ladder program while in Freeport mode. SMB30 (for port 0) and SMB130 (for port
1 if your S7-200 has two ports) are used to select the baud rate and parity.
The Freeport mode is disabled and normal communications are re-established (for example,
programming device access) when the S7-200 is in STOP mode.
In the simplest case, you can send a message to a printer or a display using only the Transmit
(XMT) instruction. Other examples include a connection to a bar code reader, a weighing scale,
and a welder. In each case, you must write your program to support the protocol that is used by
the device with which the S7-200 communicates while in Freeport mode.
Freeport communications are possible only when the S7-200 is in RUN mode. Enable the
Freeport mode by setting a value of 01 in the protocol select field of SMB30 (Port 0) or SMB130
(Port 1). While in Freeport mode, communications with the programming device are not possible.
Tip
Freeport mode can be controlled using special memory bit SM0.7, which reflects the current
position of the operating mode switch. When SM0.7 is equal to 0, the switch is in TERM
position; when SM0.7 = 1, the operating mode switch is in RUN position. If you enable Freeport
mode only when the switch is in RUN position, you can use the programming device to monitor
or control the S7-200 operation by changing the switch to any other position.
86
Data Type
Operands
BYTE
IB, QB, VB, MB, SMB, SB, *VD, *LD, *AC
BYTE
Constant
for CPU 221, CPU 222, CPU 224:
for CPU 224XP, CPU 226:
0
0 or 1

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents