Programming. Schneider Electric TSXPBY100 Master Profibus DP communication module
Oglas
Oglas
4.4
Programming
At a Glance
Subject of this
Section
What's in this
Section?
This section describes the programming principles.
This section contains the following topics:
Topic
Profibus-DP diagnostics
Diagnostic command
Examples of diagnostics command
Communication/operation report
Software implementation
Page
35015381.01 07/2008
63
Software implementation
Profibus-DP diagnostics
General Profibus-DP diagnostic functions are used to quickly find and identify faults on devices connected to the bus. Diagnostics messages are exchanged on
Profibus DP via the TSX PBY 100 master module.
z z z z
There are four types of diagnostics:
Master diag : complete diagnostics on the TSX PBY 100 master module.
Slave diag : complete diagnostics on a single slave.
Compressed diag : compressed diagnostics on all slaves.
List of diagnostics available for each slave.
Each of these diagnostics can be read by the PL7 software or by any other debugging PC.
64
35015381.01 07/2008
Software implementation
Diagnostic command
At a Glance A diagnostics command is sent by the SEND_REQ function block.
The SEND_REQ function must be used for reading or resetting the various diagnostics counters.
In order to handle current problems, the TSX PBY 100 module provides four diagnostics counters per slave. These counters can be accessed via the
SEND_REQ function and are presented in the form of a byte table. See General
35015381.01 07/2008
65
Software implementation
Syntax The communication function syntax is presented in the following format:
SEND_REQ (ADR#rm.v, 16#0031, %MWi:3, %MWj:L, % MWk:4)
The following table describes the various parameters of the function:
Parameter
ADR#rm.v
16#0031
%MWi:3
%MWj:L
Description r m v
Rack number
Module number
Channel number (0 for Profibus-DP)
Request code
Request parameters
%MWi Type of diagnostics
%MWi:x0...x8 0...125
126
127
128
129
130
131
132
%MWi:x9 Reserved
Diagnostics on slave x
List of diagnostics available
Compressed diagnostics on all slaves
Diagnostics on master module
Total diagnostics counters
Faulty exchange counters
Downtime counters
Invalid response counters
%MWi:x10 Reserved
%MWi:x11
%MWi:x12
%MWi:x13
%MWi:x14
%MWi:x15
Reserved
If activated, reading of configuration data for slave selected by %MWi.x0..x8 (= 0 to 124)
If activated, reading of information for slave selected by
%MWi.x0..x8 = 0 to 124
If activated, resetting the list of available diagnostics or the counters specified by %MWi.x0...x8 = 126, 129 to 132
If activated, reading of the list of available diagnostics or the counters specified by %MWi.x0...x8 = 126, 129 to 132
%MWi+1 Start address in the diagnostics table (default value is 0). To access part of the diagnostics table, it is possible to specify a start word in the table (Offset start) j
%MWi+2 Length of diagnostics to be read
PL7 control words where responses are stored
Number of first word
L Number of words
66
35015381.01 07/2008
Software implementation
Parameter
%MWk:4
Description
Four words identifying the address of PL7 data used to control the function k Exchange status
35015381.01 07/2008
67
Software implementation
Examples of diagnostics command
Reading diagnostics words from a slave
Diagnostics carried out on slave 2.
%M0 p
OPERATE
%MW203:=6
OPERATE
(1)
%M0
R
(1) SEND_REQ(ADR#6.0,16#0031,%MW100:3,%MW104:32,%MW200:4)
The table below describes the parameters:
Parameters
Address
Request code
Data to be sent
Reception Zone
Report
Variables
-
-
%MW100:3
%MW104:32 -
%MW200:4 -
Values
ADR#6.0
16#0031
2 (slave address in decimal)
0 (diagnostics table address in decimal)
32 (length of diagnostics table in decimal)
68
35015381.01 07/2008
Software implementation
Diagnostics on a master
SEND_REQ(ADR#6.0,16#0031,%MW100:3,%MW104:32,%MW200:4 )
Parameters
Address
Request code
Data to be sent
Reception Zone
Report
Variables
-
Values
ADR#6.0
-
%MW100:3
16#0031
126 (master code in decimal)
0 (diagnostics table address in decimal)
32 (length of diagnostics table in decimal)
%MW104:32 -
%MW200:4 -
Resetting the diagnostics counter
SEND_REQ(ADR#6.0,16#0031,%MW100:3,%MW104:32,%MW200:4 )
Parameters
Address
Request code
Data to be sent
Reception Zone
Report
Variables
-
Values
ADR#6.0
-
%MW100:3
%MW104:32 -
%MW200:4 -
16#0031
16#4081 (initialization of the total diagnostics counter in hexadecimal)
0 (diagnostics table address in decimal)
32 (length of diagnostics table in decimal)
35015381.01 07/2008
69
Software implementation
Communication/operation report
Description These messages are common to all types of requests.
16#01
16#02
16#03
16#04
16#05
16#06
Communication report (least significant byte)
Value
16#00
Meaning
Correct exchange
Operation report (most significant byte)
Value / error code
Send request code in increments of 16#30
16#01
16#02
16#03
Meaning
Positive result
Request not processed
Incorrect response
Reserved
Exchange stopped on timeout
Exchange stopped on user request (CANCEL)
Incorrect address format
16#07
16#08
16#09
16#0A
16#0B
Incorrect target address
Incorrect management parameter format
Incorrect specific parameters
Problem with sending to destination device
Reserved
Size of receive buffer is insufficient
Size of send buffer is insufficient
No processor system resources
16#0C
16#0D
16#0E
16#0F
16#10
Incorrect exchange number
No telegram received
Incorrect length
Telegram service not configured
Network module missing
70
35015381.01 07/2008
35015381.01 07/2008
16#FF
Software implementation
Message refused
Operation report (most significant byte)
Value / error code Meaning
16#01
16#02
16#03
16#04
16#05
16#06
16#07
16#08
16#0B
16#0D
16#0F
16#11
16#12
16#FD
Lack of resources communicating with the processor
Lack of line resources
Device missing
Line error
Length error
Communication channel fault
Addressing error
Application fault
No system resources
Destination missing
Intra-station routing problem or channel not configured
Address format not handled
Lack of destination resources
Invalid parameter
71
Prenesi
Oglas