introduction into profibus technology · drives, valves, operator panels, etc. ... fcs frame check...
TRANSCRIPT
2
Introduction
Masters and slavesTopologyToken passingMaster slave communicationFDL-layerBusparameter
Introduction into PROFIBUS technology
PROFIBUS DPV0
PROFIBUS DPV1
PROFIBUS DPV2
State machineDiagnosticParameterConfiguration
ServicesDiagnostics
Isochronous ModeDataExchange Broadcast (DxB)
3
Introduction
VPCLS2VPC3+CMPI12x
PROFICHIP asics
RS 485SchematicD-Sub connectorM12 connector
VPC3 applicationSchematic 8032Schematic 80C165
GSD
4
Introduction
Profichip evaluation boardPROFITRACE/PROFICORE
Development tools
Certification
Questions & discussion
VPC3+C
Buffer structureService Set Slave AddressService DiagnosticsService ConfigurationService Global ControlService DataExchange
5
PROFIBUS
What to do when developing a PROFIBUS product?
Apply for memberchip to your regional PROFIBUS organization (freedocumentation and low cost Ident Number).Requesting/purchasing an Ident Number
Investment in test and development toolsDeveloping the product (hardware and software)Developing the GSD-fileDeveloping configuration software (optional)
Writing a manualDeveloping application examples for controllers (popular PLCs)Product certification (EMC, PROFIBUS)
6
PROFIBUS
PROFIBUS is used in a wide range of applications
More than 300,000 applications are already operational
Manufacturing AutomationCar manufacturingBottling systemsStorage systems
Building AutomationTraffic automationHeating, air-conditioning
Process Automation Purification plantsChemical and petrochemical plantsPaper and textile plants
Power Generation and Power DistributionPower plantsSwitch Gear
Case studies are listed in the Electronic Product Guide
Lime Production
Polymer Storage
Glue Production
Breweries
Car manufacturing, at General Motors, BMW, Ford, FIAT....
Waste Water Purification
Bottling Plants
Food ProductionBuilding Automation
7
5 Mio
10 Mio
15 Mio
PROFIBUS, overall
DeviceNet,Rockwell Automation only
DeviceNet, overallCC-Link, overallInterbus, overall
Fieldbus Foundation H1PROFIBUS PA
1990 2000 200419991994
15,4 Mio
2005
PROFIBUS
Installed nodes:
8
PROTOCOL ARCHITECTURE
Application ProfilesApplication Profiles
IEC Interface
IEC 1158-2
User
Laye
r
(3)-(6)
Application(7)
Data Link(2)
Physical(1)
EN 50 170 and PROFIBUS Guidelines PROFIBUS Profiles
Fieldbus Data Link (FDL)
FMS
RS-485 / Fiber Optic
DP-GrundfunktionenDP-Functions
Building Manufacturing Process
ISO/O
SI model
Open communication based on international standardsOpen communication based on international standards
9
PROFIBUS
Data Exchange BroadcastIsochronous Mode (Equidistance),Clock Synchronisation,Time Stamps,HART on DP,Upload/Download (Segmentation),Redundancy
Acyclic Data ExchangeEngineering (EDD, FDT),Fail-Safe Communication (PROFIsafe)Alarms
Cyclic Data ExchangeGSD,Configuration,Parameter and Diagnosis
Functionality with PROFIBUS DP
PROFIBUS DP
DP-V0
DP-V2
DP-V1
10
PROFIBUS-DP defines three device types
DP-Master Class 1 (DPM1)Central Controller which exchanges datawith the distributed I/O devices (DP-Slaves)Several DPM1 are permitted. Typicaldevices are PLC, PC, VME
DP-Master Class 2 (DPM2)Configuration, Monitoring or Engineering tool which is used to set up the network orparameterize / monitor the DP-Slaves
DP-SlavePeripherial device directly interfacing the I/O signalsTypical devices are Inputs, Outputs, Drives, Valves, Operator Panels, etc.
PROFIBUS DP
11
PROFIBUS DP
PROFIBUS-DP Monomaster SystemDP-Master (Class 1) Monomaster Systems achieve the
shortest bus cycle timeThey consist of:
1 DP-Master (Class 1)1 to max. 125 DP-SlavesDP-Master (Class 2) - optional
Distributed Inputs and Outputs
DP - Slaves
PROFIBUS-DP
PLC
12
PROFIBUS DP
PROFIBUS-DP Multimaster SystemPROFIBUS-DP Multimaster systems consist of:
- multiple Masters (Class 1 or 2)- 1 to max. 124 DP-Slaves- max. 126 devices on the same bus
DP-Master(Class 2)
DP-Master(Class 1)
DP-Master(Class 1)
distributed inputs and outputs distributed inputs and outputs
PROFIBUS-P
PLC
PROFIBUS - DP
PC
CNC
DP - Slaves
13
PROFIBUS DP
PROFIBUS
Passive stations (Slave Devices) are polled
Active stations, Master Devices
PLCPLC PC
14
PROFIBUS DP
Token passing
Pass token to master with address 0
master with address 0 sends data
15
PROFIBUS DP
DP
slav
e 1
DP
mas
ter
imm
edia
tere
spon
se
Request Frame
trailer Output data header
Response Frame
trailerInput dataheader
Per slave:Max. 244 bytes output dataMax. 244 bytes input data
Per slave:Max. 244 bytes output dataMax. 244 bytes input data
imm
edia
tere
spon
se
Request Frame
trailer Output data header
Response Frame
trailerInput dataheader
DP
slav
e 2
imm
edia
tere
spon
se
Request Frame
trailer Output data header
Response Frame
trailerInput dataheader
DP
slav
e 3
imm
edia
tere
spon
se
Request Frame
trailer Output data header
Response Frame
trailerInput dataheader DP
slav
e nr
. x
The handling of all the slaves is called a cycle. The required time is dependent of:
the baudrate;the number of slaves; the netto data;
The handling of all the slaves is called a cycle. The required time is dependent of:
the baudrate;the number of slaves; the netto data;
Principle of Master Slave communication
16
PROFIBUS DP
Master Slave communication
Master send Diag.request
Slave send Diag.response
17
PROFIBUS DP
Conditions: Each DP-Slave has 2 byte input and 2 byte output dataThe minimum Slave_Interval time is 200 micro secondsTID1= 75 Bit times, Tsdr = 11 Bit times
Typical Bus Cycle Time of a PROFIBUS-DP Monomaster System
Bus cycle time[ms]
DP-Slaves
12 MBit/s
1.5 MBit/s
500 kBit/s
18
PROFIBUS FDL
19
PROFIBUS FDL
PROFIBUS messages
Multiple frame (message) types in order to communicate efficiently ( SD1, SD2, SD4 and SC.
Error checking: parity, checksum, start/end delimiter.
The messages comply to Hamming Distance 4 ( HD4 ).
Quiescent state of 33 bit times before sending ( master side ).
In a quiescent state the bus signal is a logical `1` ( positive voltage ).
20
PROFIBUS Character
PROFIBUS FDL
1 Tbit at 1.5Mbit/s = 0.6667µs 1 character = 7.33µs
1 Tbit at 12Mbit/s = 83ns 1 character = 0,917µs
A PROFIBUS character has a size of 11 bits and complies to ISO 1177 and ISO 2022.
B1 B2 B3 B4 B5 B8B7B6 P 10
octet
startbit (ST) stopbit (SP)parity bit (even)
LSB MSB
bit sequence: 1 2 3 4 5 6 7 8 9 10 11
21
SD1 message (status request or acknowledgement)
EDSD1 FCSADA FCS
SD1 Start Delimiter (10H)
DA Destination Address
SA Source Address
FC Frame Control
FCS Frame Check Sequence
ED End Delimiter (16H)
L Information length (L = 3)
L
PROFIBUS FDL
22
SD2 message (data transfer)
EDSD2 FCSADA
SD2 Start Delimiter (68H)
LE Information length (4 to 249)
LEr Information length repeated
DA Destination Address
SA Source Address
FC Frame Control
DATA_UNIT Data field (maximum length 246)
FCS Frame Check Sequence
ED End Delimiter (16H)
L Information length (L = 4 to 249)
L
PROFIBUS FDL
FCSLE LErSD2 DATA_UNIT
23
SD4 message (token transfer)
SD4 SADA
SD4 Start Delimiter (DCH)
DA Destination Address
SA Source Address
PROFIBUS FDL
SC message (short acknowledgement)
SD4
SC Short acknowledgement (E5H)
24
PROFIBUS FDL
PLCPLC
ED SD2FC SA DAFCS LELEr SD2DATA_UNIT
SC
PLCPLC
ED SD2FC SA DAFCS LELEr SD2DATA_UNIT
EDSD2 FCSADA FCSLE LErSD2 DATA_UNIT
Example of message transaction
25
PROFIBUS FDL
Example of message transaction
26
PROFIBUS FDL
DA/SA (Destination Address and Source Addres
EDSD2 FCSADA FCSLE LErSD2 DATA_UNIT
DA = 0 to 127 (0 to 7F hex )SA = 0 to 126 (0 to 7E hex )
127 = Broadcast address
EXT = Source and destination SAP are present in the data field.
EXT 26 20
bit 7 bit 6 bit 5 bit 4 bit3 bit2 bit 1 bit 0
27
PROFIBUS FDL
SAP (Service Access Point )
THE SAP TECHNOLOGY IS THE BASIS OF THE PROFIBUS SUCCESS!
The function of the sap structureis to couple processes to 1communication channel.
With PROFIBUS FMS/DP-V1 the SAPs are connections between processes.With PROFIBUS DP/PA the SAPs are command codes.
PROCESS 1SAP5
PROCESS 1SAP10
PROCESS 1SAP13
PROFIBUS
Interface
28
PROFIBUS FDL
Locations of the SAPs in the data unit
The SAPs are placed on the first 2 character places of the data unit.
244 characters remain.
DA SA FC DSAP, SSAPDATA_UNIT
EXT = 1 EXT = 1
29
PROFIBUS FDL
PROFIBUS DP functions with appropriate SAPs
Functions SSAP DSAP
Data exchange - -
Check Config 62 ( 3E ) 62 ( 3E )
Set Parameters 62 ( 3E ) 61 ( 3D )
Get Diagnostics 62 ( 3E ) 60 ( 3C )
Get Config 62 ( 3E ) 59 ( 3B )
Set Global Control 62 ( 3E ) 58( 3A )
Read Outputs 62 ( 3E ) 57 ( 39 )
Read Inputs 62 ( 3E ) 56 ( 38 )
Set Slave Address 62 ( 3E ) 55 ( 37 )
30
PROFIBUS FDL
Trace: Network with 1 master and 3 slaves
31
PROFIBUS FDL
Trace: Network with 1 master and 1 slave
32
PROFIBUS FDL
( FC ) Frame Control
The Frame Control byte in the message header, determines the function of the completemessage.
1Frame
0 Stn-TypeRes
FCB FCV 23 20
Function
b8 b7 b6 b5 b4 b1
Res: Reserved
Frame type: 1 Send/Request frame0 Acknowledgement / Response frame
Function: See next sheets
b7 = 1
FCB Frame Count Bitinverted inition bit
FCV Frame Count Bit valid0 other FCB not valid1 other FCB valid
b7 = 0
Stn-type: Station Type and FDL-Status
b6 b50 00 11 01 1
passive stationactive station not readyactive station ready for token ringactive station in token ring
33
PROFIBUS FDL
Code Function
Frame Type b7 = 1
Reserved
Send Data With Acknowledge low
Send Data With No Acknowledge low
Send Data With Acknowledge high
Send Data With No Acknowledge low
Reserved
Reserved
Request FDL-Status with Reply
Reserved
Send and Request Data low
Send and Request Data high
Request Ident with Reply
Request LSAP-Status with Reply
0,1,2
3 ( SDA )
4 ( SDN )
5 ( SDA )
6 ( SDN )
7
8
9
10,11
12 ( SRD )
13 ( SRD )
14
15
Send/Request frame
34
PROFIBUS FDL
Code Function
Frame Type b7 = 0
ACK positive
ACK negative, FDL/FMA ½-User Error
ACK negative, no resource for send data
ACK negative, no service activated
Reserved
Response FDL/FMA1/2-Data low send data ok
ACK negative, no response FDL/FMA1/2-data, send data ok
Response FDL-data high, send data ok
Reserved
Response FDL-data low, no resource for send data
Response FDL-data high, no resource for send data
Reserved
0 ( OK )
1 ( UE )
2 ( RR )
3 ( RS )
4,5,6,7
8 ( DL )
9 ( NR )
10 ( DH )
11
12 ( RDL )
13 ( RDH )
14,15
Acknowledgement / Response frame
35
PROFIBUS FDL
36
Busparameter
TS This station address ( 1 to 126 )
Baudrate Baudrate ( see next page )
TSL Slot Time 52 to 216-1 ( bit times )
min TSDR Smallest Station Delay Responder 20 to 216-1 ( bit times )
max TSDR Largest Station Delay Responder 20 to 216-1 ( bit times )
TQUI Quiet Time 0 to 28-1 ( bit times )
TSET Setup Time 20 to 28-1 ( bit times )
TTR Target Rotation Time 20 to 224-1 ( bit times )
G Gap Update Factor 1 to 100
HSA Highest Station Address 2 to 126
Max retry Limit Maximum Retries 0 to 8
37
PROFIBUS DP
Baudrate (kBit/s) 9.6 19.2 45.45 93.75 187.5 500 1500 3000 6000 12000
Segment length( m ) 1200 1200 1200 1200 1000 400 200 100 100 100
Segment length( feet ) 3940 3940 3940 3940 3280 1310 656 328 328 328
10 baudrates to choose from …
Remarks:Almost all the slaves in the market detect the baudrates automatically
Some slaves do not support all baudrates. This is because of economic reasons ortechnology limits.
38
Busparameter
max TSDR ( Largest Station Delay Reponder )
This is the maximum time the slave could need to send the first bit of a response back.
minTSDR < Response < maxTSDR
maxTSDR > TSL
PLCPLC
12
6
39
1
2
4
57
8
10
11
n 3 2 1
n321
39
Busparameter
PLCPLC
12
6
39
1
2
4
57
8
10
11
min TSDR ( Smallest Station Delay Reponder )
This is a time the slave has to wait before it can send a response back.
Standard value: 11 bit times
n 3 2 1
n321
40
Busparameter
41
Busparameter
Calculation of a DP- Message Cycle (1)
One Octet is transmitted as 11 Bits
The telegram header and trailer (Overhead) consists of 11 Bytes or 9 Bytes
1 TBit at 1.5 MBaud = 0.6667 µs (1 Octect = 1.33 µs)
1 TBit at 12 MBaud = 83 ns (1 Octect = 0.913ns)
In practice, additional time (approx 10 - 20%) for message retries and Diagnosticdata should be taken into account.The rules for exact calculations may be taken from EN 50170 Volume 2.
42
PROFIBUS DP
Calculation of a DP- Message Cycle (2)
Tsyn = 33 TBit
min TSDR = 11 TBit
max TSDR = 60 ... 800 TBit
TSDR
Response Frame =Header + Input - Data
Tid1 = 75 TBit
Request Frame =Header + Output - Data
43
Busparameter
Calculation of the Message Cycle Times (3)TMC = ( TSYN + TID1 + TSDR + Header + I x 11TBit + 0 x 11TBit ) x Slaves
TMC = Message Cycle Time in Bit TimesTID1 = Idle Time at the Master = typically 75 TBitTSDR = Station Delay Time at the Slave = typically 11TBitHeader = Telegram Overhead in Request and Response Frame = 198 TBitI = Number of Input Data Bytes per SlaveO = Number of Output Data Bytes per SlaveSlaves = Number of Slaves
PROFIBUS-DP System consisting of 1 Master and 20 Slaves eachwith 2 Byte Input and 2 Byte Output Data.TMC = ( 33 + 75 + 11 + 198 + 22 + 22 ) x 20 = 7220 TBit7220 TBit (1.5 MBaud) = (TBit = 0.66 µs) = 4.8 ms7220 TBit (12 MBaud) = (TBit = 0.83 ns) = 0.6 ms
In practice, a safety margin of approx 10 to 20% should be added for busadministration,diagnostic messages and retries.
Example:
44
PROFIBUS DPV0
45
PROFIBUS DP
PROFIBUS-DP Basic Functions
Master (Class 1) Master (Class 2)
Get_Master_Diag
Start_SeqDownloadUploadEnd_SeqAct_Para_BrctAct_Param
Data_ExchangeRD_IndRD_OutpSlave_DiagSet_PrmChk_CfgGet_CfgGlobal_ControlSet_Slave_Add (opt)
Data_ExchangeRD_InpRD_OutpSlave_DiagSet_PrmChk_CfgGet_CfgGlobal_ControlSet_Slave_Add
PC/VME
PLC
Slave
46
PROFIBUS DP
Data Transfer between DP-Master and DP-Slaves
Parameterization PhaseThe Slave is parametrized with the present bus-parameters, the monitoring timesand Slave specific parameters by the DP-Master.
Configuration PhaseThe DP-Master compares the desired and the present configuration of the DP-Slave.
User Data Transmission PhaseAfter a successful parameterization and configuration, the DP-Slavechanges its state into the user data transmission phase.In this phase the parameterization of the Slave can be changed without interruptingthe data transmission.
In all 3 Phases additional diagnostic data and controlcommands may be transmitted.
47
PROFIBUS DPV0
State Machine of a DP-Slave
Set_Slave_AddSlave_Diag
Power_on
WAIT_PRM
WAIT_CFG
DATA_EXCH
Chk_Cfg, not okSet_Prm, not ok
Slave_DiagGet_Cfg
Slave_DiagSet_PrmGet_Cfg
48
PROFIBUS DPV0
1. Diagnostics2. Parameters
3. Configuration4. Diagnostics
5. DataExchange
Trace: PROFIBUS statemachine
49
PROFIBUS DPV0
50
PROFIBUS DPV0
Diagnostic analysis – Extended Diagnostics
Diagnostic message( 6 up to 244 bytes )
DATADATA
6 bytesMandatory
Device Related(Optional)
Some devices only have the Mandatory part.Some devices only have the Mandatory part.
SD LE LEr SD DA SA FC DSAP SSAP Data-Unit FCS ED
68H x x 68H 8x 8x x 62/3E 60/3C x … x 16H
H DATAH DATAH
Identifier Related(Optional)
Channel Related(Optional)
H = Header- Identification of the block +- Length (including header)
H = Header- Identification of the block +- Length (including header)
51
PROFIBUS DPV0
PROFIBUS DP diagnostics featuresDiagnostic messages allow a quick localisation of faults and are divided in 4 levels:
Standard Diagnostic:Consist of 6 bytes (status bytes, master address, ident number …)
Device related diagnostics:Messages about general operational readiness of a station.e.g.: over temperature, low-voltage, …
Module related diagnostics:Messages that relate to a module in the device.e.g.: output module 8 is defective …
Channel related diagnostics:Messages that relate to a single input or output bite.g.: wire break at input one of module 3
52
PROFIBUS DPV0
Standard diagnosis (Octet 1)
53
PROFIBUS DPV0
Standard diagnosis (Octet 2)
54
PROFIBUS DPV0
Standard diagnosis (Octet 3..6)
55
PROFIBUS DPV0
Diagnostic analysis
Station Status 102H: 0000 0010
Station Not Ready
Station Status 205H: 0000 0101
Parameter Request
Master addressFFH: 255decimal255 means no master has parameterized this DP-slave
Ident Number0A26H
56
VPC3+C
57
PROFIBUS DPV0
Set Slave Address telegram
SSA message( 4 up to 244 bytes )
DATADATA
4 bytesmandatory
Device specific ( optional )
SD LE LEr SD DA SA FC DSAP SSAP Data-Unit FCS ED
68H x x 68H 8x 8x x 55/37 62/3E x … x 16H
Mandatory Bytes:
New Slave Address
Ident Number (High,Low)
NoAddChg (No additional address changed allowed)
58
PROFIBUS DPV0
59
PROFIBUS DPV0
Interaction with the configuration tool and the gsd-file
60
PROFIBUS DPV0
Parameter telegram
Parameter message( 7 up to 244 bytes )
DATA DATADATA
7 bytesmandatory
3 bytesReserved for DPV1
Device specific ( optional )
The first 7 bytes are mandatory for every slave. The purpose is to set the PROFIBUS behavior. Byte 8 to 10 reserved for PROFIBUS DPV1. The rest areProduct specific ( 11 up to 244 bytes ).The first 7 bytes are mandatory for every slave. The purpose is to set the PROFIBUS behavior. Byte 8 to 10 reserved for PROFIBUS DPV1. The rest areProduct specific ( 11 up to 244 bytes ).
SD LE LEr SD DA SA FC DSAP SSAP Data-Unit FCS ED
68H x x 68H 8x 8x x 61/3D 62/3E x … x 16H
61
PROFIBUS DPV0
Mandatory Parameter Data:
Byte Description
1 Station status
2 WD-Factor 1
3 WD-Factor 2
4 minTSDR
5 Ident-Number (High-Byte)
6 Ident-Number (Low-Byte)
7 Group Ident
62
PROFIBUS DPV0
7 6 5 4 3 2 1 0
WATCHDOG0: off 1: on
Freeze0: Not supported1: supported
Unlock
Station status:
Sync0: Not supported1: supported
Lock
Lock Unlock Description
0 0 The parameter minTSDR can be changed. All otherparameters remain changed.
0 1 The DP-Slave will be unlocked for other masters.
1 0 The DP-Slave is locked for other masters.
1 1 The DP-Slave is unlocked for other masters. = reserved ( set to zero )
63
PROFIBUS DPV0
Watchdog Control ( WD-Factor 1, WD-Factor 2 )
Range: 1 to 255
The values entered in these two bytes represent factors for setting thewatchdog control (TWD). The watchdog control in a DP-Slave takes care that, if the master fails, the outputs fall in the safe state after the expiration of this time.
WD-Timeout-value = WD-Factor1 * WD-Factor2 * 10ms
64
PROFIBUS DPV0
min TSDR ( Smallest Station Delay Reponder )
This is a time the slave has to wait before it can send a response back.
Standard value: 11 bit times
PLCPLC
12
6
39
1
2
4
57
8
10
11
n 3 2 1
n321
65
PROFIBUS DPV0
Ident Number
Each Type of DP-Slave and each DP-Master (class 1) must havean individual Ident Number.
By means of an Ident Number a DP-Master can identifythe type of connected DP-Slaves without a significant protocoloverhead.
The DP-Master will only start with user data transfer ifthe correct device types with the correct addresses areready for operation on the bus.
Ident numbers are in the range from 0 ... FFFF Hex.
Ident Numbers are issued by the PROFIBUS User Organisationin Germany (PNO) or in the US (PTO).
66
PROFIBUS DPV0
Structure of Set Parameter Telegram (DPV1)
67
PROFIBUS DPV0
68
PROFIBUS DPV0
Configuration data is stated in the GSD-File
69
PROFIBUS DPV0
Configuration analysis – Simple format
SD LE LEr SD DA SA FC DSAP SSAP Data-Unit FCS ED
68H x x 68H 8x 8x x 62/3E 62/3E x … x 16H
7 6 5 4 3 2 1 0
No. of Data Units00: 1 unit of data15: 16 units of data
Input/Output or Special Format00: Special Format01: Input10: Output11: Input/Output
Data Unit Size0: Byte1: Word
Consistency Over0: Byte/Word1: Whole length of Identifier Definition
Simple Identifier Byte
Example:14h = 5byte input27h = 8byte output
Example:14h = 5byte input27h = 8byte output
70
PROFIBUS DPV0
Configuration analysis – Special format
SD LE LEr SD DA SA FC DSAP SSAP Data-Unit FCS ED
68H x x 68H 8x 8x x 62/3E 62/3E x … x 16H
7 6 5 4 3 2 1 0
No. of Data Units00: No data1-14: Number of bytes
of vendor specific data15: No data
Fixed00: Special Format
Input/Output00: no I/O01: one length byte for inputs follows10: one length byte for outputs follows11: one length byte for outputs followed
by one length byte for inputs
Simple Identifier Byte
7 6 5 4 3 2 1 0
No. of Data Units00: 1 unit of data63: 64 units of data
Data Unit Size0: Byte1: Word
Consistency Over0: Byte/Word1: Whole length of Identifier Definition
Input/Output length byte format
Example:C0h, 87h, 84h = 8byte out, 5byte inExample:C0h, 87h, 84h = 8byte out, 5byte in
71
PROFIBUS DPV0
C3h, 00h, 00h, 00h, BFh, C9H = 1byte out, 1byte inC3h, 41h, 41h, 00h, 45h, DBh = 2 word out, 2 word inC3h, 00h, 00h, 00h, BFh, C9H = 1byte out, 1byte inC3h, 41h, 41h, 00h, 45h, DBh = 2 word out, 2 word in
How many bytes will be transferred between master and slave?
72
PROFIBUS DPV0
73
PROFIBUS DPV0
Global Control Command - Telegram
Sent as broadcast (= message to all stations).Used to inform field devices of the current operation mode of themaster (CLEAR and OPERATE).Used to select groups of field devices for operation in SYNC and/orFREEZE mode.
Command Group definition
7 6 5 4 3 2 1 0
Not Used
CLEAR
UNFREEZE
FREEZE
UNSYNC
SYNC
Not Used
Not Used
0 = all field devices addressed
Each bit = 1 addresses ONE group(8 different groups are possible)
SD LE LEr SD DA SA FC DSAP SSAP Data-Unit FCS ED
68H x x 68H 8x 8x x 58/3A 62/3E x … x 16H
74
PROFIBUS DPV1
75
PROFIBUS DPV1
DP
-MA
STER
Request Telegram
Response Telegram
Sequence of a Read Service
FunctionNumber
SlotNumber Index Length
Function
NumberSlot
NumberIndex Length Data D
P -S
LAVE
Poll until Data is available
Extended DP Functions ( DPV1 )
76
PROFIBUS DPV1
Trace: DPV1 Read.req
1. Read.req
2. Poll Read.res
3. Read.res
77
PROFIBUS DPV1
Addressing the I/O with acyclic Read and Write Services
Base Module Module 1
8 DO
Module 2
16 DO
Module 3
8 DI
Module 4
1 AI
Inde
x
Slot Number
1 Byte Output 2 Byte OutputModule 1 Module 2
1 Byte Output 2 Byte OutputModule 1 Module 2
1 Byte Input 4 Byte InputModule 3 Module 4
1 Byte Input 4 Byte InputModule 3 Module 4
Request:
Response:
78
PROFIBUS DPV1
Acyclical DP-V1 functions ( class 1, class 2 and alarms )
Class 1 Functions
MSAC1_READMSAC1_WRITE
Class 2 Functions
MSAC2_InitiateMSAC2_AbortMSAC2_ReadMSAC2_WriteMSAC2_DataTransport ( combined read & write )
Class 1 alarm functions
MSAC1_AlarmMSAC1_Alarm_Ack
Note: Class 2 functionality is presently the most commonly used technology. It is used by PROFIBUS PA and remoteI/O devices.
79
PROFIBUS DPV1
Trace: DPV1 CLass 2 master service1. Initiate.req
2. Initiate.resp
3. Read.req
4. Read.rsp
n. Abort
80
PROFIBUS DPV1
Basis Diagnosis Mechanism
81
PROFIBUS DPV1
DPV1 Alarm Communication
82
PROFIBUS DPV1
Diagnostic overview
83
PROFIBUS DPV2
84
PROFIBUS DPV2
Isochronous Mode
85
PROFIBUS DPV2
Slave to Slave communication (DxB)
DxB = Data exchange broadcast
Publisher: sends input data via broadcast message to master and subscriber.
Publisher: sends input data via broadcast message to master and subscriber.
Subscriber: receives publisher data.Subscriber: receives publisher data.
86
GSD
„The slave description for configuration tools“
87
GSD
PROFIBUS configuration tool
System configuration
Electronic Device Data Sheets (GSD-files)
PLC
PROFIBUS
GSD GSD GSD GSD GSD GSD
PLC
88
GSD
GSD
- File name is 8 characters + extension
- File extension defines the language
- For support of more languages
Maximum 4 characters identify the manufacturer (VIPA, SIEM, EH__)4 characters the IDENT-NUMBER (081DH, 806AH, 1501H)Total: VIPA081D, SIEM806A, EH__1501
„.GSD“ is standard (must be in English if this is the only one GSD)
English = „.gse“French = „.gsf“German = „.gsg“Italian = „.gsi“Portuguese = „.gsp“Spanish = „.gss“
89
GSD
GSD
Structure of GSD-File
Text Description FOR Parameters (O)
(M) = Mandatory (O) = Optional
Extended Parameter Definition (O)
General Data (M)
Field Device Related Data (M&O)
Module (I/O) Definition (M)
#PROFIBUS DP
;<Prm-Text-Def-List>PrmText= …
EndPrmText
;<Ext-User-Prm-Data-Def-List>ExtUserPrmData= …
EndExtUserPrmData
;<Unit-Definition-ListGSD_Revision = …
;Slave-specificationFreeze_Mode_Supp = …
;Module-Definition-ListModule = ……EndModule
90
GSD
GSD
Keywords – „Slave Family“
This keyword describes the „device group“ in which the GSD file is placed.
Defined codes:0 = General1 = Drives2 = Switching Devices3 = I/O4 = Valves5 = Controller6 = HMI
7 = Encoders
8 = NC/RC9 = Gateway10 = PLC11 = Ident Systems12 = PA
13-255 = reserved
Example: Slave_Family = 3 Group „I/O“
91
GSD
GSD
Keywords – „Set_Slave_Add_Supp“ & „Auto_Baud_Supp“
Set_Slave_Add_SuppThis keyword indicates if the slave supports the Set Slave Address function.
Possible codes:0 = No1 = Yes
Auto_Baud_SuppThis keyword indicates if the slave automatically detects the baudrate (also after change).
Possible codes:0 = No1 = Yes
92
GSD
GSD
Keywords – „Modular Station“ & „Module“
This keyword indicates if the slave supports more than 1 module.
Possible codes:0 = No1 = Yes
Simple configurationModule = „1 Byte DI“ 0x10EndModuleModule = „2 Byte DO“ 0x21EndModuleModule = „3 Byte DX“ 0x32EndModule
Extended configurationModule = „profichip module 1 Byte DO “ 0x83, 0x00, 0x00, 0x2F, 0x33EndModule
Module = „special module“ 0x04, 0x12, 0x13, 0x14, 0x00EndModule
93
GSD
GSD
Keywords – „Min_Slave_Interval“
This keyword indicates the time in which it can receive a new message without havinginternal timing problems. The value has to be multiplied with 100µs.
The minimal and most effective value is 1 (100µs).
Maximum allowed values:12Mbit/s maximum 6 (0.6ms)6Mbit/s maximum 10 (1ms)3Mbit/s maximum 15 (1.5ms)1.5Mbit/s maximum 20 (2ms)500kbit/s maximum 60 (6ms)187kbit/s maximum 200 (20ms)
94
GSD
GSD
Keywords – „Max_Diag_Data_Len“ & diagnosis definitions
This keyword indicates how much diagnosis the slave supports.
The minimum value is 6 (standard PROFIBUS diagnostic).The maximum value is 244.
Textual definitions of the Device Specific Diagnostics:
Unit_Diag_Bit(090)=„Channel1 – Short circuit to P“Unit_Diag_Bit(090)=„Channel1 – Short circuit to M“Unit_Diag_Bit(090)=„Channel1 – Broken wire“
Unit_Diag_Area = 26-27Value(1)=„Slot 2: Failure“Value(2)=„Slot 2: Wrong Module“Value(3)=„Slot 2: No Module“Unit_Diag_Area_End
95
GSD
GSD-File Example ( 1 )
96
GSD
GSD-File Example ( 2 )
97
Configuration
Example of a DP-Master configuration tool
98
Operation principle
Operation principle of a DP master card in a control system
99
PROFIBUS FDL
100
profichip - VPCLS2
PROFIBUS-DP Protocolasync. interface acc. to PROFIBUS-DP40 bit I/O, configurable as diagn.-inputs5V supply voltagePQFP80 Package RoHS compliant
101
VPCLS 2
102
profichip - VPC3+CLF
PROFIBUS DP-V1 & DP-V2 Protocol ASIC4kB internal communication RAM 5V or 3.3V supply voltage with 5V tolerant inputsLow current consumptionPNO certified customer productsPQFP44 Package RoHS compliant
103
VPC3+C
104
profichip - MPI12x
Multi-Point-Interface controller ASICMPI communication up to 12Mbit/sPROFIBUS DP Slave Core (VPC3+C)4kB internal communication SRAMconfigurable 8 Bit µController Interface3.3V supply voltage with 5V tolerant inputsPQFP44 Package RoHS compliant
105
MPI12x
106
PROFIBUS FDL
107
RS 485 Interface
108
RS 485 Interface
: This signal is mandatory.
DB9 connector – Pin layout
The pin-layout of the DB9 connector is defined as follows:
Pin nr. Signal Description
1 Shield Shield/functional ground
2 M24 Ground for +24V output voltage
3 B-Line RxD/TxD-P Receive Transmit data - plus
4 CNTR-P Repeater control signal (direction control), RTS signal
5 DGND Digital ground
6 VP Supply voltage (+5V)
7 P24 Output voltage +24V
8 A-Line RxD/TxD-N Receive Transmit data – minus
9 CNTR-N Repeater Control signal (direction control)
the preferred connector type for PROFIBUS-DP/FMS is a 9 PIN D-Sub Connectorthe female part is located at the deviceother connectors are allowed, if they supply at least the mandatory signals
109
RS 485 Interface
M12 connector structure
With IP65 applications, the M12 system is often used.
110
RS 485 Interface
M12 connector – Pin layout
The pin layout of the M12 connector has been defined as follows:
Pin nr. Signal Description
1 VP Supply voltage (+5V)
2 A-Line RxD/TxD-N Receive Transmit data – minus
3 DGND Digital ground
4 B-Line RxD/TxD-P Receive Transmit data - plus
5 Shield Ground connection
Thread Shield Ground connection
111
PROFIBUS DP Slave
Implementation of an intelligent PROFIBUS-DP Slave
User SoftwareApplication
ApplicationInterface and
PROFIBUS-DP Software
User ApplicationHardware
MICROCONTROLLER:
Protocol Asice.g. VPC3+/C,
MPI12x
Bus InterfaceRS 485/Fibre Optic
Address
Data
PROFIBUS
112
VPC3+C
PinoutConfiguration of Processor interface
Synchronous Motorola Mode11
Asynchronous Motorola Mode01
Synchronous Intel Mode10
Asynchronous Intel Mode00
Processor Interface ModeMODEXINT/MOT
XINT/MOT
Mode
4kByte RAM extension (Pin assignment for A11)
ALE/AS24Synchronous Motorola Mode
XWR/E_CLOCK2Asynchronous Motorola Mode
ALE/AS24Asynchronous Intel Mode
XCS1Synchronous Intel Mode
Signal NamePinProcessor Interface Mode
A11
A11
113
VPC3+C
Application with 80C32 ( 4kByte-RAM-Mode )
VPC3+/C
114
VPC3+C
Application with 80C165VPC3+/C
115
PROFIBUS FDL
116
VPC3+C
VPC3+/C
2/4 kByte RAM
Housing : 44 PIN PQFP
Layer 1
Layer 2
DP/DPV1/DPV2
8 Bit Data Bus
Soft-ware
Address Function
000H…
015H
Control Parameters(latches, register)
016H…
03FH
Organizational Parameter
040H…
7FFH (FFFH)
DP-buffers
117
VPC3+C
Control parameters 1 ( read )
AddressIntel
Mot. Name Bit No. Significance (Read Access!)
00H 01H Int-Req-Reg 7..0
01H 00H Int-Req-Reg 15..8
02H 03H Int−Reg 7..0
03H 02H Int−Reg 15..8
04H 05H Status-Reg 7..0
05H 04H Status-Reg 15..8
06H 07H Mode-Reg 0 7..0
07H 06H Mode-Reg 0 15..8Mode Register 0
Status Register
Interrupt Controller Register
118
VPC3+C
Status register:
After reset theVPC3+C must be in offline state!
After reset and during baud rate search you must read here CFhex!
119
VPC3+C
AddressIntel
Mot. Name Bit No. Significance (Read Access!)
08H Din_Buffer_SM 7..0 Buffer assignment of the DP_Din_Buffer_State_Machine
09H New_Din_Buffer_Cmd 1..0 The user makes a new DP Din buffer available in the N state.
0AH Dout_Buffer_SM 7..0 Buffer assignment of the DP_Dout_Buffer_State_Machine
0BH Next_Dout_Buffer_Cmd 3..0 The user fetches the last DP Dout-Buffer from the N state
0CH Diag_Buffer_SM 3..0 Buffer assignment for the DP_Diag_Buffer_State_Machine
0DH New_Diag_Buffer_Cmd 1..0 The user makes a new DP Diag Buffer available to the VPC 3+.
0EH User_Prm_Data_Okay 1..0 The user positively acknowledges the user parameter setting data of a Set_Param_Telegram.
0FH User_Prm_Data_Not_Okay 1..0 The user negatively acknowledges the user parameter setting data of a Set_Param_Telegram.
10H User_Cfg_Data_Okay 1..0 The user positively acknowledges the configuration data of a Check_Config_Telegram.
11H User_Cfg_Data_Not_Okay 1..0 The user negatively acknowledges the configuration data of a Check_Config_Telegram.
12H DXBout_Buffer_SM 7..0 Buffer assignment of the DXBout_Buffer_State_Machine
13H Next_DXBout_Buffer_Cmd 2..0 The user fetches the last DXBout-Buffer from the N state
14H SSA_Buffer_Free_Cmd The user has fetched the data from the SSA buffer and enables the buffer again.
15H Mode-Reg 1 7..0
Control parameters 2 ( read )
120
VPC3+C
Control parameters 1 ( write )
AddressIntel
Mot. Name Bit No. Significance (Write Access!)
00H 01H Int-Req-Reg 7..0
01H 00H Int-Req_Reg 15..8
02H 03H Int-Ack-Reg 7..0
03H 02H Int-Ack-Reg 15..8
04H 05H Int−Mask-Reg 7..0
05H 04H Int−Mask-Reg 15..8
06H 07H Mode-Reg0 7..0
07H 06H Mode-Reg0 15..8Setting parameters for individual bits
Interrupt-Controller-Register
121
VPC3+C
Control parameters 2 ( write )
AddressIntel
Mot. Name Bit No. Significance (Write Access!)
08H Mode-Reg1-S 7..0
09H Mode-Reg1-R 7..0
0AH WD_Baud_Ctrl_Val 7..0 Root value for baud rate monitoring
0BH Min_Tsdr_Val 7..0 MinTsdr time
0CH Mode-Reg2 7..0 Mode Register 2
0DH Sync_PW_Reg 7..0 Sync Pulse Width Register
0EH
0FH
10H
11H
12H
13H
14H
15H
Reserved
122
VPC3+C
Buffer structure:
Aux1
Aux2
D UDiagnosis-Buffer
ND UDin-Buffer
ND UDout-Buffer
Read-Config-Buffer
Set-Slave-Address-Buffer
Config-Buffer
Parameter-Buffer
changed by user
UART
Notice:All buffers or lists mustbegin at segment addresses(8 bytes segmentation for 2K Byte mode, 16 bytessegmentation for 4K Byte mode).
Notice:All buffers or lists mustbegin at segment addresses(8 bytes segmentation for 2K Byte mode, 16 bytessegmentation for 4K Byte mode).
123
VPC3+C
Organizational parameters 1
AddressIntel Mot. Name Bit No. Significance
16H R_TS_Adr Setup station address of the VPC 3+
17H SAP_List_Ptr Pointer to a RAM address which is preset with FFh or to SAP-List
18H 19H R_User_Wd_Value 7..0
19H 18H R_User_Wd_Value 15..8
1AH R_Len_Dout_Buf Length of the 3 Dout buffers
1BH R_Dout_Buf_Ptr1 Segment base address of Dout buffer 1
1CH R_Dout_Buf_Ptr2 Segment base address of Dout buffer 2
1DH R_Dout_Buf_Ptr3 Segment base address of Dout buffer 3
1EH R_Len_Din_Buf Length of the 3 Din buffers
1FH R_Din_Buf_Ptr1 Segment base address of Din buffer 1
20H R_Din_Buf_Ptr2 Segment base address of Din buffer 2
21H R_Din_Buf_Ptr3 Segment base address of Din buffer 3
22H R_Len_DXBout_Buf Length of the 3 DXBout buffers
23H R_DXBout_Buf_Ptr1 Segment base address of DXBout buffer 1
24H R_Len Diag_Buf1 Length of Diag buffer 1
25H R_Len Diag_Buf2 Length of Diag buffer 2
26H R_Diag_Buf_Ptr1 Segment base address of Diag buffer 1
27H R_Diag_Buf_Ptr2 Segment base address of Diag buffer 2
In DP mode an internal 16-bit watchdog timer monitors the user.
124
VPC3+C
AddressIntel Mot. Name Bit No. Significance
28H R_Len_Cntrl_Buf1 Length of Aux buffer 1 and the corre-sponding control buffer, for example SSA-Buf, Prm-Buf, Cfg-Buf, Read-Cfg-Buf
29H R_Len_Cntrl_Buf2 Length of Aux buffer 2 and the corre-sponding control buffer, for example SSA-Buf, Prm-Buf, Cfg-Buf, Read-Cfg-Buf
2AH R_Aux_Buf_Sel Bit array; defines the assignment of the Aux-buffer 1 and 2 to the control buffers SSA-Buf, Prm-Buf, Cfg-Buf
2BH R_Aux_Buf_Ptr1 Segment base address of auxiliary buffer 1
2CH R_Aux_Buf_Ptr2 Segment base address of auxiliary buffer 2
2DH R_Len_SSA_Data Length of the input data in the Set_Slave_Address-buffer
2EH R_SSA_Buf_Ptr Segment base address of the Set_Slave_Address-buffer
2FH R_Len_Prm_Data Length of the input data in the Set_Param-buffer
30H R_Prm_Buf_Ptr Segment base address of the Set_Param-buffer
31H R_Len_Cfg_Data Length of the input data in the Check_Config-buffer
32H R_Cfg_Buf_Ptr Segment base address of the Check_Config-buffer
33H R_Len_Read_Cfg_Data Length of the input data in the Get_Config-buffer
34H R_Read_Cfg_Buf_Ptr Segment base address of the Get_Config-buffer
Organizational parameters 2
125
VPC3+C
Organizational parameters 3
AddressIntel Mot. Name Bit No. Significance
35H R_Len_DXB_Link_Buf Length of the DXB_Linktable
36H R_DXB_Link_Buf_Ptr Segment base address of the DXB_Link-buffer
37H R_Len_DXB_Status_Buf Length of the DXB_Status
38H R_DXB_Status_Buf_Ptr Segment base address of the DXB_Status-buffer
39H R_Real_No_Add_Change This parameter specifies whether the DP slave address may be changed again later.
3AH R_Ident_Low The user sets the parameters for the Identnumber_Low value.
3BH R_Ident_High The user sets the parameters for the Identnumber_High value.
3CH R_GC_Command The Global_Control_Command last received
3DH R_Len_Spec_Prm_Buf If parameters are set for the Spec_Prm_Buffer_Mode (see mode register 0), this cell defines the length of the parameter buffer.
3EH R_DXBout_Buf_Ptr2 Segment base address of DXBout buffer 2
3FH R_DXBout_Buf_Ptr3 Segment base address of DXBout buffer 3
126
VPC3+C
D-Puffer: VPC 3 writes dataN-Puffer: VPC 3 swap D and N bufferU-Puffer: user can read data
buffer buffer bufferN UD
USER
buffer buffer bufferN UD
PROFI-BUS
Intelligent 3 buffer solution
exchangeby VPC3
exchangeby VPC3
exchangeby SW
exchangeby SW
127
VPC3+C
Interrupt Controller
AddressIntel/Mot.
Name Bit No.
00H 01H Interrupt-Request-Register 7..0
01H 00H Interrupt-Request-Register 15..8
02H 03H Interrupt-Register 7..0
03H 02H Interrupt-Register 15..8
Read: Write:AddressIntel/Mot. Name Bit No.
00H 01H Interrupt-Request-Register 7..0
01H 00H Interrupt-Request-Register 15..8
02H 03H Interrupt-Acknowledge-Register 7..0
03H 02H Interrupt-Acknowledge-Register 15..8
04H 05H Interrupt−Mask-Register 7..0
05H 04H Interrupt−Mask-Register 15..8
128
PROFIBUS DP
State Machine of a DP-Slave
Set_Slave_AddSlave_Diag
Power_on
WAIT_PRM
WAIT_CFG
DATA_EXCH
Chk_Cfg, not okSet_Prm, not ok
Slave_DiagGet_Cfg
Slave_DiagSet_PrmGet_Cfg
129
PROFIBUS DPV0
1. Diagnostics2. Parameters
3. Configuration4. Diagnostics
5. DataExchange
Trace: PROFIBUS statemachine
130
Software
Software structure
dp_if.hdp_if.cdp_isr.cdp_dpl.h
dp_fdl.cdp_msac1.cdp_msac2.c
main.c
dp_user.cdp_debug.c
dp_cfg.hdp_inc.hplatform.h
EASY4711.gsd
131
DP_CFG.H
Configuration header file
132
Initialization
Initialization
DP_ERROR_CODE vpc3_initialization( UBYTE slave_address, CFG_STRUCT cfg )
Function Initialization of VPC3+
slave_address Address of the slave
cfg Default configuration of the slave
ReturnValue
DP_OKDP_NOT_OFFLINE_ERRORDP_ADDRESS_ERRORDP_CALCULATE_IO_ERRORDP_DOUT_LEN_ERRORDP_DIN_LEN_ERRORDP_DIAG_LEN_ERRORDP_PRM_LEN_ERRORDP_SSA_LEN_ERRORDP_CFG_LEN_ERRORDP_LESS_MEM_ERRORDP_LESS_MEM_FDL_ERROR
Initialization OKError VPC3 is not in OFFLINE stateError, DP Slave addressError with configuration bytesError with Dout lengthError with Din lengthError with diagnostics lengthError with parameter assignment data lengthError with address data lengthError with configuration data lengthError Overall, too much memory usedError Overall, too much memory used
Parameter
NoneReturn Value
NoneParameter
Starts the VPC3+Function
START_VPC3()
133
VPC3+C
134
VPC3+C
Slave Diagnosis (SAP 60)VPC3 support 2 diagnostic bufferswith command NEW_DIAG_CMD the user can send new diagnostic data to masterwith „Diag_buffer_changed" interrupt the VPC3 confirmed to the user thebuffers are changed
Service: Slave Diagnosis
135
PROFIBUS DPV0
Diagnostic analysis
Station Status 102H: 0000 0010
Station Not Ready
Station Status 205H: 0000 0101
Parameter Request
Master addressFFH: 255decimal255 means no master has parameterized this DP-slave
Ident Number0A26H
136
VPC3+C
137
VPC3+C
Set_Parameter (SAP 61)VPC3 writes data into AUX_Puffer 1/2,VPC3 checks the data (bytes 0 .. 6)VPC3 change AUX_buffer 1/2 to SSA-bufferVPC3 writes actual data length into R_LEN_PRM_Data registerVPC3 generates New_Prm_Data interruptuser has to check the data and to acknowledge the data via
User_Prm_Data_Okay_Cmd or ...._Not_Okay_Cmd.
Service: Set Parameter
The user has to check the service Set Parameter before Check-Config!
138
VPC3+C
Software: Check Parameter Data
139
VPC3+C
140
VPC3+C
Check_Config (SAP 62)VPC3 writes CheckCfg-data into AUX-buffer 1/2,VPC3 swap AUX-buffer 1/2 to Cfg-buffer,VPC3 writes actual data length in R_Len_Cfg_Data registerVPC3+ generates New_Cfg_Data interruptuser must check the configuration data and has to acknowledge via
User_Cfg_Data_Okay_Cmd or ...._Not_Okay_Cmd.with User_Cfg_Data_Okay_Cmd the VPC3 goes into state DataExchange
Service: Check_Config
141
VPC3+C
Service: Check_Config
142
VPC3+C
143
VPC3+C
Global_Control (SAP 58)After receiving new GC-command, the VPC3 generates GC-interruptThe user can read GC-command from address 3CH.
Service: Global Control
144
VPC3+C
145
VPC3+C
• Data_Exchange (Default_SAP)VPC3 writes data into D-bufferVPC3 changes D- and N-buffer.VPC3 generates DX-Out interrupt.The user can read the data from U-buffer
Service: Data Exchange
146
VPC3+C
Service: Data Exchange
147
VPC3+C
Service: Data Exchange
148
VPC3+C
Service: Data Exchange
149
VPC3+C
150
profichip - VPC3+C Evaluation Kit
151
FPGAG
alva
nic
isol
ated
PR
OFI
BU
S In
terfa
ce
USB
Technology
RAM/CacheExpansion
Technology
PROFIBUSConnector
USBConnector
ExpansionConnector
profichip - ProfiCore Busanalyzer (1)
152
profichip – EasyConn Profibus Connector
153
VPC3+C
154
Certification
Certified Products Ensure Interoperability
PROFIBUS International has established a qualified certification system whichincludes conformance and interoperabilitytesting
Several hundred products have alreadybeen certified
Test laboratories have been established in Europe and the US
Certified products are listed with theircertificate number in the PROFIBUS Electronic Product Guide
Device
Certified byPROFIBUS
International
OK ?No
Yes
Test at test
laboratory
155
VPC3+C
156
157