105BCommunication processor
12.3 Point-to-Point (PtP) communication
S7-1200 Programmable controller
534
System Manual, 11/2011, A5E02486680-05
12.3.1.2
PORT_CFG instruction
Table 12- 7 PORT_CFG (Port Configuration) instruction
LAD / FBD
SCL
Description
"PORT_CFG_DB"(
REQ:=_bool_in_,
PORT:=_uint_in_,
PROTOCOL:=_uint_in_,
BAUD:=_uint_in_,
PARITY:=_uint_in_,
DATABITS:=_uint_in_,
STOPBITS:=_uint_in_,
FLOWCTRL:=_uint_in_,
XONCHAR:=_char_in_,
XOFFCHAR:=_char_in_,
WAITTIME:=_uint_in_,
DONE=>_bool_out_,
ERROR=>_bool_out_,
STATUS=>_word_out_);
PORT_CFG allows you to change port parameters
such as baud rate from your program.
You can set up the initial static configuration of the
port in the device configuration properties, or just use
the default values. You can execute the PORT_CFG
instruction in your program to change the
configuration.
1
STEP 7 automatically creates the DB when you insert the instruction.
The PORT_CFG configuration changes are not permanently stored in the CPU. The
parameters configured in the device configuration are restored when the CPU transitions
from RUN to STOP mode and after a power cycle. See Configuring the communication ports
(Page 549) and Managing flow control (Page 550) for more information.
Table 12- 8 Data types for the parameters
Parameter and type
Data type
Description
REQ
IN
Bool
Activate the configuration change on rising edge of this input. (Default value:
False)
PORT
IN
PORT
After you install and configure a CM or CB communication device, the port
identifier appears in the parameter helper drop-list available at the PORT
box connection. The assigned CM or CB port value is the device
configuration property "hardware identifier". The port symbolic name is
assigned in the "System constants" tab of the PLC tag table. (Default value:
0)
PROTOCOL
IN
UInt
0 - Point-to-Point communication protocol (Default value)
1..n - future definition for specific protocols
BAUD
IN
UInt
Port baud rate (Default value: 0):
1 = 300 baud, 2 = 600 baud, 3 = 1200 baud, 4 = 2400 baud, 5 = 4800 baud,
6 = 9600 baud, 7 = 19200 baud, 8 = 38400 baud, 9 = 57600 baud,
10 = 76800 baud, 11 = 115200 baud
PARITY
IN
UInt
Port parity (Default value: 0):
1 = No parity, 2 = Even parity, 3 = Odd parity, 4 = Mark parity,
5 = Space parity
DATABITS
IN
UInt
Bits per character (Default value:):
1 = 8 data bits, 2 = 7 data bits
STOPBITS
IN
UInt
Stop bits (Default value: 0):
1 = 1 stop bit, 2 = 2 stop bits