550 987 02
PD 667 Profibus – Slave data:
Array name: DP_Slaves.
Softwire number: 400.
DP_Slaves is an array of records.
Each slave on the network occupies one record in the array.
A slave record contains all information regarding that specific slave.
Slave definitions must start in the first record (DP_Slaves) and continue without any gaps until the required number of slaves are defined.
The slaves network address (SlaveAddr) does not have to be the same as the array index number.
Each slave record is divided into four main topics:
Setup contains the data needed to specify a communication relationship between a Profibus master and a slave.
Most data for the setup can be retrieved from the device's GSD file.
(GSD file is an ASCII file, supplied by the device manufactures, describing the attributes of the slave. The last letter may be used as language descriptor, so files names like GSF, GSE etc. may be seen).
Profibus node address of this device. Permitted values: 0 .. 125.
Slave address does not have to be the same as the array index number.
Descriptive text for the slave.
The driver does not use this variable. It is for user information only.
Profibus device ID for this node. Value is extracted from the GSD file.
Note: Normally the value in the GSD file is in hexadecimal form and must therefore be converted to a decimal number.
Timer value for the communication monitor inside the slave.
If one or both of WatchDog1 and WatchDog2 are set to 0, the master disables the watchdog in the slave during connection initialisation.
The slave calculates its timeout as: WatchDog1 * WatchDog2 * 10mS.
If the watchdog is enabled, the slave monitors whether data is received from the master within at least the calculated interval (poll interval). If not, the outputs are switched to fail-safe status. After a timeout, the slave needs a new configuration from the master to re-enter data exchange mode.
The poll interval can be influenced by communication errors and timeouts when some of the slaves are disconnected from the network etc. To allow for this, the watchdog timer should be set to some seconds higher that the ideal poll interval.
Timeout for one slave is 0.2 second at 19200 / 0.4 second at 9600.
Value is extracted from the GSD file.
Allowed interval: 11 to 800.
MaxTSDR is information available for the master about the maximum delay this slave will have between the reception of a request until the start of the response.
TSDR: Time Station Delay Responder.
When a master wants to establish a connection with a Profibus DP slave, it initially sends the parameter list. Parameters are constant values that the slave uses for internal setup.
Parameters consist of 7 mandatory parameter bytes followed by optionally 0 to 244 device specific parameter bytes.
The PD 667 generates automatically the 7 mandatory Profibus parameters.
Parameters size and Parameters list is only concerning the device specific user parameters called “User_PRM_data”. If no device specific parameters is required size must be = 0.
Parameter values could be: Measure range of an analogue channel (e.g. 0-20mA or 0-10V), data format for data exchange (e.g. word or real format), module configuration of an I/O block etc.
List: parameter data for the slave.
Parameter data are extracted from the GSD file.
Often, the first 3 user parameter bytes are set to 0, because they may be used for Profibus DP-V1.
When a master wants to establish a connection with a Profibus DP slave, it initially sends the configuration list. Configuration list describes: number of, size of and characteristics of the data objects to be used in Data Exchange mode.
Each byte in the configuration list describes one data object. Using a standard configuration byte structure, each object can contain 1 to 16 bytes or words, with or without consistency. As a special configuration (occupies 2 bytes + optional user specific data) 1 to 64 bytes or words, with or without consistency can be defined.
Size: determines how many bytes from the list the master must send to the slave when initialising the connection. Size can be from 1 to 100.
List: configuration data for the slave.
Configuration data are extracted from the GSD file.
Structure of a standard configuration byte:
Structure of a special identifier byte:
(None, or up to two length bytes plus optional vendor specific bytes, may follow a special identifier byte. If vendor specific data follows, there are no restraints on the content of these data.)
A length byte has the following structure:
OutputSize: Number of data bytes that must be transferred from the master to the slave, when in data exchange.
InputSize: Number of data bytes received by the master from the slave, when in data exchange.
InputSize and OutputSizes must always match the sum of input and output data specified by the configuration bytes.
The PD 667 master accepts configuration of 'input only' as well as 'output only' slaves.
The slaves GSD file may specify a maximum of output bytes, maximum of input bytes, and maximum sum of input and output bytes. The configuration must never exceed these limits.
GSD keywords: Max_Input_Len / Max_Output_Len / Max_Data_Len /
Input is the data sent from the slave to the master, when in data exchange.
Input data is a stream of bytes without gaps.
Only the number of bytes specified by InputSize is valid. The rest of the array contains arbitrary data.
When the slave is not in data exchange mode all input bytes are set to 0.
Output is the data sent from the master to the slave, when in data exchange.
Output data is a stream of bytes without gaps.
The number of bytes specified by OutputSize is sent.
Info contains slave status information, error counters and other data that can be used to monitor the slave and provide assistance to troubleshoot a connection.
State contains the current position of the state machine for the slave.
During normal operation the state must be 4.
If the state is 0, the slave is not detected on the network.
Status contains 8 bits, each with a specific status indicator from the slave.
Bit 2 is set by the user to request the driver to fetch diagnosis data from the slave. The driver resets the bit when the command is performed.
Bit 3 and 4 may be reset by the user and will be set by the driver, next time new data is ready.
Bit 4 is only set true when the received data is different to the existing data in input.
Size shows the number of bytes of diagnostic data received from the slave. The size includes the standard diagnostic part.
List contains all data received in the diagnostic telegram. Device specific data starts at index 8.
Diagnosis data layout:
FCerrors: counts the number of messages received with a bad checksum.
NoResponses: counts the number of times the slave has not responded to a request.
Inits: counts the number the connection to the device has been initialized.
All error counters are set to 0 when the driver is started.
FCB is a bit used to detect duplicated messages.
For each new message to a slave the master inverts the FCB bit. If the slave receives two or more consecutive valid messages with the same FCB, they are supposed to be repeated. All repeated messages are disregarded.
The slave is allowed a number of network scan loops to process the parameters and the configuration telegrams. DiagCounts counts how many loops the device has used before it made a positive response to the Check_Config message.
If a positive response is not received before the DiagCount reaches the maximum limit, the slave state is changed to 0.