Siemens RDF302 Bedienungsanleitung

Stöbern Sie online oder laden Sie Bedienungsanleitung nach Thermostate Siemens RDF302 herunter. Using the Modbus Master Protocol Library (v1.2 Benutzerhandbuch

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 14
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 0
Using the Modbus Master Protocol Library (v1.2)
STEP 7–Micro/WIN Instruction Libraries makes communicating to Modbus slave devices easier by including
pre-configured subroutines and interrupt routines that are specifically designed for Modbus communications.
With the Modbus Master Protocol instructions, you can configure the S7-200 to act as a Modbus RTU
master device and communicate to one or more Modbus slave devices.
The Modbus Master Protocol instructions can be installed into the Libraries folder of the STEP 7–Micro/WIN
instruction tree. These new instructions allow you to make the S7-200 act as a Modbus master. When you
select a Modbus Master instruction, one or more associated subroutines are automatically added to your
project to support the Modbus Master Protocol.
There are two versions of the Modbus Master Protocol Library. One version utilizes port 0 of the CPU and
the other utilizes port 1 of the CPU. This document describes both libraries. The port 1 library has an “_P1”
appended to the POU names (i.e. MBUS_CTRL_P1) to denote that the POU utilizes port 1 on the CPU.
The libraries are identical in all other respects.
Requirements for Using the Modbus Master Protocol
The Modbus Master Protocol instructions use the following resources from the S7-200:
Initializing the Modbus Master Protocol dedicates the specific CPU port for Modbus Master Protocol
communications. When the CPU port is being used for Modbus Master Protocol communications,
it cannot be used for any other purpose, including communications with STEP 7-Micro/WIN. The
MBUS_CTRL instruction controls assignment of Port 0 to Modbus Master Protocol or PPI. The
MBUS_CTRL_P1 instruction (from the port 1 library) controls assignment of Port 1 to Modbus
Master Protocol or PPI.
The Modbus Master Protocol instructions affect all of the SM locations associated with Freeport
communications on the affected CPU communication port.
The Modbus Master Protocol instructions use 3 subroutines and 1 interrupt routine.
The Modbus Master Protocol instructions require about 1620 bytes of program space for the two
Modbus Master instructions and the support routines.
The variables for the Modbus Master Protocol instructions require a 284 byte block of V memory.
The starting address for this block is assigned by the user and is reserved for Modbus variables.
The S7-200 CPU must be firmware revision 2.00 or greater to support the Modbus Master Protocol
Library (CPU MLFB 21x-2xx23-0XB0).
The Modbus master library utilizes the user interrupts for some functions. The user interrupts must
not be disabled by the user program.
Note: To change the operation of CPU communication port back to PPI so that you can
communicate with STEP 7-Micro/WIN, set the Mode parameter of the MBUS_CTRL
instruction to a zero (0).
You can also set the mode switch on the S7-200 to the STOP mode position. Either of these
methods will set the CPU communication port to communicate with STEP 7-Micro/WIN.
Seitenansicht 0
1 2 3 4 5 6 ... 13 14

Inhaltsverzeichnis

Seite 1

Using the Modbus Master Protocol Library (v1.2) STEP 7–Micro/WIN Instruction Libraries makes communicating to Modbus slave devices easier by includin

Seite 2 - Modbus Addressing

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.

Seite 3

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

Seite 4

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

Seite 5 - MBUS_CTRL Instruction

Advanced Information This section contains information for advanced uses of the Modbus Master Protocol Library. Most users of the Modbus Master Prot

Seite 6

Accumulator Usage The accumulators (AC0, AC1, AC2, AC3) are utilized by the Modbus Master instructions and appear in the Cross Reference listing. Th

Seite 7 - MBUS_MSG Instruction

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

Seite 8

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

Seite 9

Using the Modbus Master Protocol Instructions To use the Modbus Master Protocol instructions in your S7-200 program, follow these steps: 1. Install

Seite 10

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

Seite 11 - Example Program

When the MBUS_CTRL instruction completes, the Done output is turned on. The Error output contains the result of executing the instruction. The fol

Seite 12

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.

Seite 13 - Advanced Information

The parameter Addr is the starting Modbus address. The following ranges of values are allowed: • 00001 to 09999 for discrete outputs (coils) • 1

Seite 14 - Accumulator Usage

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

Keine Kommentare