Using the Modbus Master Protocol Library (v1.2) STEP 7–Micro/WIN Instruction Libraries makes communicating to Modbus slave devices easier by includin
Table 5 – MBUS_MSG Error Codes Error Code Description 0 No error 1 Parity error in response. This is only possible if even or odd parity is used.
Example Program This example program shows how to use the Modbus Master instructions to write and then read 4 holding registers to and from a Modbus
Initialize and monitor the Modbus Master by calling MBUS_CTRL on every scan. The Modbus Master is set for 9600 baud and no parity. The slave is al
Advanced Information This section contains information for advanced uses of the Modbus Master Protocol Library. Most users of the Modbus Master Prot
Accumulator Usage The accumulators (AC0, AC1, AC2, AC3) are utilized by the Modbus Master instructions and appear in the Cross Reference listing. Th
Execution Time for the Modbus Master Protocol The Modbus Master Protocol requires a small amount of time every scan to execute the MBUS_CTRL instruct
Assigning V Memory to the Modbus Master Library The Modbus Master Protocol Library requires a block of V memory to operate the Modbus Master instruc
Using the Modbus Master Protocol Instructions To use the Modbus Master Protocol instructions in your S7-200 program, follow these steps: 1. Install
Instructions for the Modbus Master Protocol MBUS_CTRL Instruction The MBUS_CTRL instruction (or MBUS_CTRL_P1 for port 1) is used to initialize, moni
When the MBUS_CTRL instruction completes, the Done output is turned on. The Error output contains the result of executing the instruction. The fol
MBUS_MSG Instruction The MBUS_MSG instruction (or MBUS_MSG_P1 for port 1)is used to initiate a request to a Modbus slave and process the response.
The parameter Addr is the starting Modbus address. The following ranges of values are allowed: • 00001 to 09999 for discrete outputs (coils) • 1
The bit data (addresses 0xxxx and 1xxxx) areas are read and written as packed bytes, that is, 8 bits are packed into each byte of data. The least sig
Kommentare zu diesen Handbüchern