Hide thumbs Also See for S7-1200:
Table of Contents
Modbus master communication rules
● MB_COMM_LOAD must be executed to configure a port before a MB_MASTER
● If a port is to be used to initiate Modbus master requests, that port should not be used by
● The Modbus instructions do not use communication interrupt events to control the
● It is recommended that you call all MB_MASTER execution for a given port from a
● Once a master instruction initiates a transmission, this instance must be continually
REQ parameter
0 = No request; 1 = Request to transmit data to Modbus Slave
You may control this input either through the use of a level or edge triggered contact.
Whenever this input is enabled, a state machine is started to ensure that no other
MB_MASTER using the same instance DB is allowed to issue a request, until the current
request is completed. All other input states are captured and held internally for the current
request, until the response is received or an error detected.
If the same instance of MB_MASTER is executed again with REQ input = 1 before the
completion of the current request, then no subsequent transmissions are made. However,
when the request is completed, a new request is issued whenever MB_MASTER is executed
again with REQ input = 1.
S7-1200 Programmable controller
System Manual, 03/2014, A5E02486680-AG
instruction can communicate with that port.
MB_SLAVE. One or more instances of MB_MASTER execution can be used with that
port, but all MB_MASTER execution must use the same MB_MASTER instance DB for
that port.
communication process. Your program must poll the MB_MASTER instruction for transmit
and receive complete conditions.
program cycle OB. Modbus master instructions may execute in only one of the program
cycle or cyclic/time delay execution levels. They must not execute in both execution
priority levels. Pre-emption of a Modbus Master instruction by another Modbus master
instruction in a higher priority execution priority level will result in improper operation.
Modbus master instructions must not execute in the startup, diagnostic or time error
execution priority levels.
executed with the EN input enabled until a DONE=1 state or ERROR=1 state is returned.
A particular MB_MASTER instance is considered active until one of these two events
occurs. While the original instance is active, any call to any other instance with the REQ
input enabled will result in an error. If the continuous execution of the original instance
stops, the request state remains active for a period of time specified by the static variable
Blocked_Proc_Timeout. Once this period of time expires, the next master instruction
called with an enabled REQ input will become the active instance. This prevents a single
Modbus master instance from monopolizing or locking access to a port. If the original
active instance is not enabled within the period of time specified by the static variable
"Blocked_Proc_Timeout", then the next execution by this instance (with REQ not set) will
clear the active state. If (REQ is set), then this execution initiates a new master request
as if no other instance was active.
Communication processor and Modbus TCP
12.5 Modbus communication
751
Table of Contents
loading

Table of Contents