Slave
As a slave, the PROFIBUS DP and PROFIBUS DPV1 protocols are supported.
PROFIBUS DP
In order to configure the slave for cyclic DP operation, proceed as follows in the TwinCAT system manager:
Configure DP slave
It is first necessary to configure a "PROFIBUS Slave FC310x, PCI" I/O device (selecting "I/O devices" with the right hand mouse button, and then selecting "Insert device"). This will cause the device and a box to be added. The GSD file "TCDPSLAV.GSD" must be present in the "TwinCAT\Io\PROFIBUS" directory for this purpose:
The appropriate channel can be searched for on the device's "FC310x" tab ("Search" button). The station address will need to be adjusted, and so, possibly, may the baud rate, which is set to 12 Mbaud as standard. The tab "FC310x" is described for TwinCAT 2.8 and TwinCAT 2.9.
Add modules
Modules are to be a added to the box corresponding to the data that is to be transferred cyclically. This is done by clicking with the right mouse button on the box, and then selecting "Add modules":
Configuring the Master
The GSD file "TCDPSLAV.GSD" is to be taken out of the "TwinCAT\Io\PROFIBUS" directory to configure the master. The modules must be inserted in the master configuration in the same sequence as they are in the configuration of the slave in the System Manager.
Error Reactions
In the default setting, the DP slave's inputs are set to 0 when the DP slave is not involved in data exchange. It is possible to change this input error reaction to "No changes" under Changes of the Input Data on the "Features" tab for the box:
PROFIBUS DPV1
The DP slave supports a DPV1-MSAC_C1 server connection that is established along with the cyclic connection. This can be used so that larger quantities of acyclic data can be transferred alongside the cyclic data. A DPV1 read telegram received by the master is reported to the PLC as an ADS read indication, while a DPV1 write telegram is reported to the PLC as an ADS write indication. The PLC program is then responsible for the read or write response. To do this, the ADS read response or ADS write response functions are to be called.
MSAC-C1 Read
A DPV1-MSAC_C1 read indication is represented in an ADS read indication as follows:
ADS read indication parameter | Meaning |
---|---|
Source-Net-ID (NETID) | Net-ID of the slave (see the device's ADS tab) |
Source-Port (PORT) | 0x200 |
Invoke-ID (INVOKEID) | A unique number that must reappear in the response |
IndexGroup (IDXGRP) | Slot number (DPV1 parameter) |
IndexOffset (IDXOFFS) | Index (DPV1 parameter) |
Length (LENGTH) | Length of the data that is to be read |
An ADS read response is represented in a DPV1-MSAC_C1 read response as follows:
ADS read response parameter | Meaning |
---|---|
Destination-Net-ID (NETID) | Net-ID of the slave (see the device's ADS tab) |
Destination-Port (PORT) | 0x200 |
Invoke-ID (INVOKEID) | A unique number, as under indication |
Result (RESULT) | Result of the read: 0 = no error, otherwise: bits 0-15 = standard ADS error codes, bits 16-23 = Error_Code_1, bits 24-31 = Error_Code_2, see description of the DPV1 error codes |
Length (LENGTH) | Length of the data that has been read |
Data (DATAADDR) | read data |
MSAC-C1 Write
A DPV1-MSAC_C1 write indication is represented in an ADS write indication as follows:
ADS write indication parameter | Meaning |
---|---|
Source-Net-ID (NETID) | Net-ID of the slave (see the device's ADS tab) |
Source-Port (PORT) | 0x200 |
Invoke-ID (INVOKEID) | A unique number that must reappear in the response |
IndexGroup (IDXGRP) | Slot number (DPV1 parameter) |
IndexOffset (IDXOFFS) | Index (DPV1 parameter) |
Length (LENGTH) | Length of the data that is to be written |
Data (DATAADDR) | data that is to be written |
An ADS read response is represented in a DPV1-MSAC_C1 read response as follows:
ADS read response parameter | Meaning |
---|---|
Destination-Net-ID (NETID) | Net-ID of the slave (see the device's ADS tab) |
Destination-Port (PORT) | 0x200 |
Invoke-ID (INVOKEID) | A unique number, as under indication |
Result (RESULT) | Result of the read: 0 = no error, otherwise: bits 0-15 = standard ADS error code, bits 16-23 = Error_Code_1, bits 24-31 = Error_Code_2, see description of the DPV1 error codes |
Length (LENGTH) | Length of the data that has been read |
ADS Interface from TwinCAT 2.9
Communication can also take place via ADS in TwinCAT systems. The functionality is extremely similar to that of an ADS connection between two PCs over Ethernet, although transmission takes place over PROFIBUS, with the exception that the requester that initiates the ADS job is always the DP master PC. An FC310x DP master is then linked to an FC310x-DP slave.
In the DP master, the ADS Interface should be activated on the "ADS" tab of the box, and the Net-ID of the DP slave PC is to be entered:
At the DP slave the Net-ID of the DP master PC is to be added under Add. NetIds on the device's "ADS" tab: