550 987 03

 

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.

 

Note:

Slave definitions must start in the first record (DP_Slaves[1]) 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:

Variable name

Variable description

Setup

Specification of communication relationship

Input

Data received from the slave

Output

Data send to the slave

Info

Status information and diagnostic data

 

 

 

Setup:

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).

 

Variable name

Variable description

SlaveAddr

Profibus node address (slave address)

SlaveName

Text to identify the slave

IdentNo

Profibus device ID

WatchDog1

Watchdog

WatchDog2

Watchdog

maxTSDR

Device's maximum TSDR

Parameters

Device's parameters

Configuration

Device's configuration

 

 

 

SlaveAddr

 

 

SlaveAddr:

Byte;

 

 

Profibus node address of this device. Permitted values: 0 .. 125.

Slave address does not have to be the same as the array index number.

 

 

SlaveName

 

 

SlaveName:

String[50];

 

 

Descriptive text for the slave.

The driver is mainly for user information.

From driver version 1.06: If the first character in the name is “@”, the input data is not set

to zero (fail safe value) in case of communication error between the PD 667 and the slave.

To utilise this feature, the SlaveName must start with an “@”, for example

“@ProcessValve17”.

 

 

IdentNo

 

 

IdentNo:

Word;

 

 

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.

 

 

WatchDog1

WatchDog2

 

 

WatchDog1

Byte;

 

 

WatchDog2

Byte;

 

 

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.

 

 

MaxTSDR

 

 

MaxTSDR:

Word;

 (* unit: bit times *)

 

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.

 

 

 

Parameters

 

 

Record:

 

 

 

Size : Byte;

Number of Parameters

 

 

List : Array[1..244] of Byte;

List of parameters

 

End;

 

 

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.

 

Size: determines how many user parameter bytes from the list the master should send to the slave when initialising the connection. Size can be from 0 to 244.

 

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.

 

 

Configuration

 

 

Record:

 

 

 

Size       : Byte;

Number of Parameters

 

 

List       : Array[1..100] of Byte

List of parameters

 

 

OutputSize : Byte;

Number of output bytes

 

 

InputSize  : Byte;

Number of input bytes

 

End;

 

 

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:

 

7

 

 

 

 

 

 

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0-3:

Length of data.

00 = 1  byte or word  

15 = 16 bytes or words

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

4-5:

Input or Output:

00 = special identifier format

01 = input

10 = output

11 = input and output

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

6:

Data format

0  = byte,  

1  = word

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

7:

Consistency

0  = consistency over byte/word

1  = consistency over total length

 

 

 

 

 

 

 

 

 

 

 

 

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.)

 

7

 

 

 

 

 

 

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0-3:

Length of vendor specific data

00 = no vendor specific data follows

1..14 bytes of vendor specific data follows

15 = no vendor specific data follows

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

4-5:

Fixed to 00

Always = 00

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

6-7:

Input or output

00 = blank,  

01 = a length byte follows for inputs

10 = a length byte follows for outputs

11 = a length byte follows for I and O resp.

 

 

 

 

 

 

 

 

 

 

 

 

A length byte has the following structure:

 

7

 

 

 

 

 

 

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0-5:

Length of I/O data

00 = 1 byte or word

63 = 64 bytes or words

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

6:

Data format

0  = byte,  

1  = word

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

7:

Consistency

0  = consistency over byte/word

1  = consistency over total length

 

 

 

 

 

 

 

 

 

 

 

 

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.

 

Note:

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

 

 

Input : Array[1..244] of byte;

 

 

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

 

 

Output : Array[1..244] of byte;

 

 

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

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.

 

Variable name

Variable description

State

Current state of the state machine to this slave

Status

Status of this slave

Diagnosis

Diagnostic data received from the slave

ErrorCounters

Counters for different error events

FCB

Internal variable to avoid duplicated messages

DiagCount

Interval variable. Allow a number of cycles to accept config.

Reserved

Reserved space for future extensions.

 

 

State

 

 

State : byte;

 

 

State contains the current position of the state machine for the slave.

 

0

=

Looking for the slave – not yet detected

1

=

Sending parameters

2

=

Sending configuration

3

=

Checking if the slave accepts parameters and configuration

4

=

Data exchange

5

=

Fetching diagnostic data, when in data exchange  (return to state 4)

 

During normal operation the state must be 4.

If the state is 0, the slave is not detected on the network.

 

 

Status

 

 

Status : bit8;

 

 

Status contains 8 bits, each with a specific status indicator from the slave.

 

7

 

 

 

 

 

 

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0:

Slave in data exchange

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2:

Fetch diagnosis (request from user)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

3:

New diagnosis data received

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

4:

New data received

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

5:

Slave is existing

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

6:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

7:

 

 

 

 

 

 

 

 

 

 

 

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.

 

Diagnostic

 

 

Record:

 

 

 

Size : Byte;

Number of diagnostic data

 

 

List : Array[1..244] of Byte;

List of diagnostic data

 

End;

 

 

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:

List[1]

8 error bits

List[2]

8 status / info bits

List[3]

Diagnosis extended overflow

List[4]

Master's address.       (0xFF/255 = not yet in data exchange. )

List[5]

Ident number of this device (High byte)

List[6]

Ident number of this device (Low byte)

List[7]

External diagnosis: header length

List[8]

Start of User specific diagnosis

........

User specific diagnosis

List[244]

Last possible byte in User specific diagnosis

 

 

ErrorCounters

 

Record

 

 

FCerrors    : byte;

 

 

NoResponses : word;

 

 

Inits       : word;

 

End;

 

 

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

 

 

FCB : boolean;

 

 

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.

 

 

DiagCount

 

 

DiagCount : byte;

 

 

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.