Creating User-Defined Protocols With Freeport Mode - 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

Creating User-Defined Protocols with Freeport Mode

Freeport mode allows your program to control the communications port of the S7-200 CPU. You
can use Freeport mode to implement user-defined communications protocols to communicate with
many types of intelligent devices. Freeport mode supports both ASCII and binary protocols.
To enable Freeport mode, you use special memory bytes SMB30 (for Port 0) and SMB130 (for
Port 1). Your program uses the following to control the operation of the communications port:
Transmit instruction (XMT) and the transmit interrupt: The Transmit instruction allows the
-
S7-200 to transmit up to 255 characters from the COM port. The transmit interrupt notifies
your program in the S7-200 when the transmission has been completed.
Receive character interrupt: The receive character interrupt notifies the user program that a
-
character has been received on the COM port. Your program can then act on that character,
based on the protocol being implemented.
Receive instruction (RCV): The Receive instruction receives the entire message from the
-
COM port and then generates an interrupt for your program when the message has been
completely received. You use the SM memory of the S7-200 to configure the Receive
instruction for starting and stopping the receiving of messages, based on defined
conditions. The Receive instruction allows your program to start or stop a message based
on specific characters or time intervals. Most protocols can be implemented with the
Receive instruction.
Freeport mode is active only when the S7-200 is in RUN mode. Setting the S7-200 to STOP mode
halts all Freeport communications, and the communications port then reverts to the PPI protocol
with the settings which were configured in the system block of the S7-200.
Table 7-10
Using Freeport Mode
Network Configuration
Using Freeport over
an RS-232
connection
Using USS protocol
Creating a user
program that
emulates a slave
device on another
network
226
Scale
PC/PPI
Cable
S7-200
MicroMaster
MicroMaster
S7-200
MicroMaster
Modbus Network
Modbus
Device
S7-200
S7-200
Description
Example: Using an S7-200 with an electronic
scale that has an RS-232 port.
RS-232/PPI Multi-Master cable connects
S
the RS-232 port on the scale to the RS-485
port on the S7-200 CPU. (Set the cable to
PPI/Freeport mode, switch 5=0.)
S7-200 CPU uses Freeport to
S
communicate with the scale.
Baud rate can be from 1200 baud to
S
115.2 kbaud.
User program defines the protocol.
S
Example: Using an S7-200 with SIMODRIVE
MicroMaster drives.
STEP 7- -Micro/WIN provides a USS library.
S
S7-200 CPU is a master, and the drives
S
are slaves.
Refer to the Programming Tips on
the documentation CD for a sample
USS program. See Tip 28.
Programming
Tips
Example: Connecting S7-200 CPUs to a
Modbus network.
User program in the S7-200 emulates a
S
Modbus slave.
STEP 7- -Micro/WIN provides a Modbus
S
library.
Refer to the Programming Tips on
the documentation CD for a sample
Modbus program. See Tip 41.
Programming
Tips

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents