Page 1
SERIAL-PROFIBUS-INTERFACE | SPI 3 Doc. Version 4.0 for Fieldbus Devices with a Serial Interface – MODBUS RTU Contents SPI 3 – all Controls (up to SPI 3 Release 16) Contents Online Documentation...
Page 2
Trebing & Himstedt Prozessautomation GmbH & Co. KG. The right is reserved to make changes to this manual and to the SPI 3 device at any time without prior notification.
SPI 3 Configuration ..................14 SPI 3 Parameters ..................15 Checking the SPI 3 for correct operation ..............18 Using data channel with »MODBUS_Master + Kanal« module and FB 127 ..20 Parameters for data transfer for SIMATIC S7 ..........21 Error diagnosis and remedies ................
Data are exchanged between the DP master and the SPI 3 in the form of telegrams through a data channel, the size of which can be configured. Data exchange between MODBUS slave and SPI 3 (MODBUS master) is controlled by the SPI 3.
SPI 3 and on parameter setting. The online documentation uses the following keywords and symbols: Danger! Risk of injury to personnel due to electric shock. Warning! Risk of damage to equipment. Note! Indicates useful tips. MODBUS RTU | SPI 3 | Trebing & Himstedt...
Safety notes Safety notes Safety notes for the planning stage Observe the general rules for PROFIBUS components when planning the SPI 3 installation. Please observe the following to avoid risk to personnel and damage to equipment and to ensure that the SPI 3 functions correctly: –...
Page 7
VDE 0100 regulations for handling electrical equipment. – Always mount the SPI 3 on a suitable top-hat rail. – The cables used to connect up the SPI 3 should not apply any mechanical forces to the device. Danger! Never open the case of the SPI 3 and do not make any modifications to the device.
(RS232, RS422 or RS485 see label on SPI 3) Mounting the device – Stop lever for releasing/fixing the SPI 3 from/on a 35 mm DIN top-hat rail (top- hat rail not included in delivery) Operating elements – Two rotary switches for setting the PROFIBUS address –...
– Connect the SPI 3 to power supply (see »Connecting up the power feed« on page 10). – Connect the SPI 3 to the serial field device (see »Connecting up to a fieldbus device with serial interface (MODBUS slave)« on page 11).
Installing the SPI 3 Installing the SPI 3 Mounting the SPI 3 – Place the SPI 3 with the gap onto the top-hat rail and swivel the SPI 3 downward until the stop lever locks on the top-hat rail. SPI 3...
We recommend the use of connectors from ERNI and Siemens. If the SPI 3 is installed at the beginning or end of the PROFIBUS cable segment, you should use PROFIBUS connectors which contain an integrated terminating resistor. We recommend using connectors from ERNI and Siemens.
Page 12
Note! Please observe the following when using the depicted passive terminating resistor: Is the feeding voltage (+5 V) supplied by the device (SPI 3), the PROFIBUS is shorted via the resistors when the device is disconnected from voltage. PROFIBUS communication can be interrupted or completely break down until the device is re-energized.
Starting up the SPI 3 Starting up the SPI 3 To start up the SPI 3, you need to configure the device and set parameters. Configuration and parameterization are done via PROFIBUS configurator (PLC programming tool). – Start the PROFIBUS configurator of the DP master (PLC programming tool).
»MODBUS_Master + Kanal«. After module selection, you need to set the parameters specific for this module (see »SPI 3 Parameters« on page 15). Now you can use the modules listed in the table (SPI 3 Release 15 and higher). Module Name Description...
The first 7 bytes (bytes 0…6) of the parameter telegram contain bus-related parameters which are standardized in PROFIBUS norm. The following 10 bytes (byte 7 to byte 16) in the table of the parameterizing telegram contain SPI 3 specific parameters. When using the »MODBUS_Master + Kanal« module, an additional function block needs to be installed or generated (see »Installing the FB 127 function...
Page 16
MODBUS slave address 1-247 0x01 1 (0x01) 0xF7 SPI 3 specific parameters for modules with I/O field The following 3 bytes (byte 17 to byte 19) of the parameterizing telegram contain Trebing & Himstedt | SPI 3 | MODBUS RTU...
Page 17
– Load the project into the PLC. After successful loading and subsequent SPS RUN, the LEDs RUN and PB will light on the SPI 3 (see also: »Checking PROFIBUS communication« on page 18). MODBUS RTU | SPI 3 | Trebing & Himstedt...
– Connect up the PROFIBUS interface cable and the serial interface cable. – Switch on the power feed for the SPI 3 (RUN-LED lights up). – Start the DP master which has previously been configured for the SPI 3 (PB-LED lights up).
Page 19
25 for details of how to locate the fault. If no errors were detected, the SPI 3 is ready for use. During data transfer, the TX or RX LEDs will flash (see »Indicating elements« on page 9).
– FB 127 allows processing of MODBUS telegrams which have been sent or received via the SPI 3. This FB uses an I/O field with 4 words. SFC14 and 15 for data consistency are already included in the FB 127.
Parameters for data transfer for SIMATIC S7 Upon data transfer, the user data to be exchanged are copied into a data area (data block or marker area) from where they are sent to the SPI 3 by the PLC through the DP master.
Page 22
0x06 Slave busy, repeat service later 0x07 Negative MODBUS receipt 0x08 Memory parity error 0xFF Timeout, slave did not respond within timeout range Bit 3, 5…7 Internal use by the FB, do not change Trebing & Himstedt | SPI 3 | MODBUS RTU...
Page 23
– If the operation completed with errors (ANZW bit 2==1), evaluate the error ANZW message and remedy the error. Bit 0==0 ANZW Bit 1==1 ANZW Bit 2==1 Evaluate error code comparison MODBUS RTU | SPI 3 | Trebing & Himstedt...
Page 24
Set ANZW bit 4 to 1 to reset the operation. Bit 4 is reset to 0 by the FB when the operation has been reset. ANZW Bit 1==1 Read Data ANZW Bit 2==1 Evaluate error code comparison Trebing & Himstedt | SPI 3 | MODBUS RTU...
Error diagnosis and remedies Error diagnosis and remedies If errors are detected, the pattern of flashing of the PB and RUN LED’s on the SPI 3 can be used for error diagnosis. The LED’s can flash with the following patterns:...
Page 26
Evaluation of this diagnosis depends on the used DP master. When using a bus monitor (e.g. the PROFIBUS Scope), you can additionally evaluate diagnosis telegrams. For data of this device-related diagnosis, see »Evaluating PROFIBUS diagnosis telegrams« on page 19. Trebing & Himstedt | SPI 3 | MODBUS RTU...
RTS (out) REC-N BUS-N Pin 9 Unused TRANS-N Unused Other Certifcates Connectable field devices units * See label on the SPI 3 for information on the serial interface which is fitted MODBUS RTU | SPI 3 | Trebing & Himstedt...
Kanal« module. Creating function blocks Data between DP master and SPI 3 are exchanged via data channel in the form of telegrams or telegram fragments. The size of the data channel between DP master and SPI 3 is defined as 4 words by the »MODBUS_Master + Kanal« module.
Telegram Telegram for data transfer without fragmentation Precondition: The I/O range of the bytes to be transferred + 2 bytes (for control data and telegram length) must not exceed 4 words. MODBUS RTU | SPI 3 | Trebing & Himstedt...
Page 33
Receipt telegram 2 Send further user data in telegram fragments – until telegram 2 has been sent completely (only toggle Bit 1 in Byte 0, specify further user data from Byte 1 onward) MODBUS RTU | SPI 3 | Trebing & Himstedt...
Page 34
1 Byte 0 …1 …2 …3 …n … Bit 7 …6 …5 …4 …3 …2 …1 …0 Response (SPI 3) User data Receipt telegram 1 Receipt telegram fragment Trebing & Himstedt | SPI 3 | MODBUS RTU...
Page 35
User data Receive further user data in telegram fragments – until telegram 2 has been received completely (only toggle Bit 3 in Byte 0, specify further user data from Byte 1 onward) MODBUS RTU | SPI 3 | Trebing & Himstedt...
Page 36
When you re-set the SPI 3, any running send and receipt commands are interrupted. The 4-word I/O field for the data channel in the SPI 3 is deleted and re-initialized. To do so, set Bit 4 in Byte 0 to 1 and send this telegram to the SPI 3. DP Master...
(or bytes) of memory. Data channel A logical channel for exchanging data with the SPI 3. The size of the data channel (i.e. I/O area) is dependent on the Trebing & Himstedt | SPI 3 | MODBUS RTU...
Page 43
PROFIBUS device uniquely and completely in a clearly specified syntax. You can download a GSD file for the SPI 3 from the internet (www.t-h.de); it is required to set up the device. Handshake Method used to synchronize data exchange.
Page 44
DP slave. The parameter master can write to and read from the slave and change the configuration of the slave. Parameter setting To set the behavior of a DP slave and its modules. Trebing & Himstedt | SPI 3 | MODBUS RTU...
Page 45
The Fieldbus device receives a telegram from the DP master through the SPI 3. Receive channel Data channel for data which the SPI 3 receives. Remote peripheral I/O device which is not directly integrated in the PLC CPU, but is accessed remotely via the bus.
Page 46
The DP master sends a telegram to a Fieldbus device through the SPI 3. Send channel Data channel for data which is sent to the SPI 3. Slave Bus station which is only allowed to exchange data with a master, and only on request of the master.
Page 47
With software flow control, the Xon control character indicates readiness to receive; complement of Xoff. Xoff With software flow control, the Xoff control character indicates unreadiness to receive; complement of Xon. MODBUS RTU | SPI 3 | Trebing & Himstedt...
Please contact Trebing & Himstedt Prozeßautomation GmbH & Co. KG for further information. Warranty Our products are subject to warranty in accordance with our general business and delivery terms. Trebing & Himstedt | SPI 3 | MODBUS RTU...
Need help?
Do you have a question about the SPI 3 and is the answer not in the manual?
Questions and answers