Profibus—dp协议
工业通信协议Modbus,Profibus-DP,Devicenet和Ethernet

工业通信协议Modbus,Profibus-DP,Devicenet和Ethernet工业通信协议Modbus,Profibus-DP,Devicenet和Ethernet目前在工业领域使用较为广泛的RS485接口,很多支持Modbus,Profibus-DP,Devicenet 和Ethernet这几种协议;不知道大家是否对这些协议有没有研究,小弟愿意与你一起切磋切磋!还有那个4-20mA,支持HART协议方面的!谢谢,互助合作,相互提高!通信协议所谓通信协议是指通信双方的一种约定。
约定包括对数据格式、同步方式、传送速度、传送步骤、检纠错方式以及控制字符定义等问题做出统一规定,通信双方必须共同遵守。
因此,也叫做通信控制规程,或称传输控制规程,它属于ISO'S OSI七层参考模型中的数据链路层。
目前,采用的通信协议有两类:异步协议和同步协议。
同步协议又有面向字符和面向比特以及面向字节计数三种。
其中,面向字节计数的同步协议主要用于DEC 公司的网络体系结构中。
一、物理接口标准1.串行通信接口的基本任务(1)实现数据格式化:因为来自CPU的是普通的并行数据,所以,接口电路应具有实现不同串行通信方式下的数据格式化的任务。
在异步通信方式下,接口自动生成起止式的帧数据格式。
在面向字符的同步方式下,接口要在待传送的数据块前加上同步字符。
(2)进行串-并转换:串行传送,数据是一位一位串行传送的,而计算机处理数据是并行数据。
所以当数据由计算机送至数据发送器时,首先把串行数据转换为并行数才能送入计算机处理。
因此串并转换是串行接口电路的重要任务。
(3)控制数据传输速率:串行通信接口电路应具有对数据传输速率——波特率进行选择和控制的能力。
(4)进行错误检测:在发送时接口电路对传送的字符数据自动生成奇偶校验位或其他校验码。
在接收时,接口电路检查字符的奇偶校验或其他校验码,确定是否发生传送错误。
(5)进行TTL与EIA电平转换:CPU和终端均采用TTL电平及正逻辑,它们与EIA采用的电平及负逻辑不兼容,需在接口电路中进行转换。
Profibus-DP协议规范(草案)

Profibus-DP协议规范(草案)Profibus-DP规范(草案)1范围和目的 (6)1.1目的 (6)1.2范围 (6)1.3术语 (6)1.4概述 (10)2规范性引用文件 (12)3物理层定义 (12)3.1 RS-485物理传输方式 (12)3.2电气特性 (12)3.3总线连接器 (13)3.4总线电缆 (13)3.5接地,屏蔽 (14)3.6总线终端器 (14)3.7物理层和介质冗余 (15)4链路层定义 (16)4.1数据传输功能 (16)4.2帧结构 (17)4.2.1帧字符(UART字符) (17)4.2.2传输规则 (17)4.2.3位同步 (18)4.3帧格式 (18)4.3.1无数据字段的固定长度的帧SD1 (18)4.3.2有数据字段的固定长度的帧SD3 (19)4.3.3有可变数据字段长度的帧SD2 (19)4.3.4令牌帧SD4 (20)4.4循环和系统响应时间 (21)4.4.1令牌循环时间(Token CycleTime) (21)4.4.2报文循环时间(Message CycleTime) (21)4.4.3系统反应时间(System ReactionTimes) (22)5 PROFIBUS-DP通信模型 (23)5.1协议结构 (23)5.2通信关系 (26)5.3功能概述 (30)6 PROFIBUS-DP应用层实现 (32)6.1 Prifibus DP从站状态机 (32)6.2 Prifibus DP从站初始化报文过程 (32)6.2.1检查从站是否存在 (32)6.2.2初始化前的诊断信息 (32)6.2.3设置从站参数 (33)6.2.4校验组态数据 (33)6.2.5初始化后的诊断信息 (34)6.2.6数据交换 (34)6.2.7从站参数化中Watchdog时间因子 (35)6.3保护测控装置数据在Profibus-DP中的映射 (35)6.3.1遥信及遥测 (36)6.3.2遥控功能 (36)6.3.3远方信号复归 (37)6.3.4装置对时 (37)6.3.5电度量读取 (37)6.3.6定值读写 (37)6.3.7压板读写 (38)6.3.8保护模拟量读取 (38)6.4保护管理机DP主站功能要求 (39)1 范围和目的1.1 目的本规范定义了自动化系统统一的基于串行口的传输规范和应用层规范,使得自动化系统内的设备能够在一致的传输规范上通讯以及相互联系。
PROFIBUS-DP在企业自动化控制中的应用

PROFIBUS-DP在企业自动化控制中的应用摘要:PROFIBUS-DP是一种常用的工业数据通信协议,在企业自动化控制中应用广泛。
本文将对PROFIBUS-DP的特点、优势和应用进行探讨,分析其在自动化控制中的作用及其应用案例,包括物流自动化、制造自动化和生产线控制等方面。
通过案例分析,说明PROFIBUS-DP在企业自动化控制中的应用具有广泛性、效率性和可靠性,是提高企业生产力和竞争力的重要因素。
关键词:PROFIBUS-DP;企业自动化控制;广泛性;效率性;可靠性;应用案例正文:一、PROFIBUS-DP的特点和优势PROFIBUS-DP是一种常用的工业数据通信协议,它能够连接不同的控制和感应设备,实现数据交换和信息传递。
PROFIBUS-DP的特点如下:1.通讯速度快:PROFIBUS-DP的通讯速度可以达到12Mbit/s,数据传输效率高。
2.通讯距离远:PROFIBUS-DP的最大通讯距离是1.2km,通讯距离远,适用于大规模的现场控制。
3.连续性强:PROFIBUS-DP支持高可靠性数据传输,能够实现设备持续工作,减少设备故障。
4.标准性强:PROFIBUS-DP是国际标准化协议,适用于不同厂商和不同系统的设备间通讯。
PROFIBUS-DP的优势如下:1.整合性:PROFIBUS-DP可以连接不同的设备和系统,实现数据和信息的整合,提高生产效率和质量。
2.可靠性:PROFIBUS-DP的数据传输方式可靠性高,能够减少设备故障发生,提高设备的稳定性。
3.实时性:PROFIBUS-DP的通讯速度快,能够实现实时数据传输,满足企业自动化控制的实时性要求。
二、PROFIBUS-DP在企业自动化控制中的应用1.物流自动化:PROFIBUS-DP在物流自动化中,可以实现各设备间的信息交换和数据共享,提高作业效率和质量。
例如在仓库自动化管理中,PROFIBUS-DP可将ERP系统的信息传输到设备系统中,实现物料的自动化管理和运输。
PROFIBUS DP通讯协议

PROFIBUS DP 通讯协议
PROFIBUS-DP 通讯协议是单一的、一致性通讯协议用于所有的工厂自动
化和过程自动化。
PROFIBUS DP 通讯协议PROFIBUS 所有应用都使用单一的开放的通讯协议(PROFIBUS DP,Decentralized Periphery)这种协议使用主-从模式:一个设备(主)控制一个或多个其它设备(从);协议使用令牌:令牌通过网络
传递;具有令牌控制的站有权访问网络PROFIBUS DP 以三种版本存在:DP- V0:Overall command structure,循环数据交换DP-V1:扩展到非循环数据交换等DP-V2:进一步扩展到计时,时钟同步等一种单一的协议适应所有的应用PROFIBUS DP 支持所有的DCS 或控制器与单个现场设备工厂设备和过程设备是直接地链接到PROFIBUS DP①过程自动化设备(PA),聚合在”PA簇”,通过连接器或链环到PROFIBUS DP②PROFIBUS 总线访问协议(第二层)对三种PROFIBUS 版本(FMS/DP/PA)均相同;这种通信透明和FMS/DP/PA 网络区域
容易组合;因为FMS/DP/PA 使用相同的物理介质(RS-485/FO),因此它们能组合在同一根电缆上。
tips:感谢大家的阅读,本文由我司收集整编。
仅供参阅!。
ProfibusDP通信协议网络拓扑设计

ProfibusDP通信协议网络拓扑设计在工业自动化领域中,网络通信协议的选择和网络拓扑设计是至关重要的。
而ProfibusDP作为一种常见的工业通信协议,其网络拓扑设计对于确保系统稳定性和可靠性具有重要意义。
本文将探讨ProfibusDP通信协议网络拓扑设计的相关内容。
一、ProfibusDP简介ProfibusDP是指“分布式Peripherie总线”(Decentralized Peripherie)的Profibus版本。
它是一种用于工业自动化控制领域的通信协议,常用于连接传感器、执行器和控制器等设备,实现数据交换和控制指令传输。
二、网络拓扑设计原则1. 可靠性:网络拓扑应设计成具有高可靠性,能够在设备故障或通信故障时保持系统正常运行。
2. 实时性:ProfibusDP通信协议常用于对实时性要求较高的控制系统中,因此网络拓扑设计应考虑数据传输的实时性。
3. 扩展性:随着工业自动化系统的发展,网络中可能需要增加新的设备或扩展现有设备,网络拓扑设计应具备良好的扩展性,便于系统的扩展和升级。
4. 简洁性:网络拓扑应尽可能简洁,减少网络节点和连接线路,以降低系统成本和维护成本。
5. 易于维护:网络拓扑设计应考虑到日常维护的便捷性,便于对网络进行监测、诊断和故障排除。
三、常见的网络拓扑结构1. 星型拓扑:所有设备都连接到中央集线器或交换机,适用于小型网络或对可靠性要求较高的场景。
2. 环型拓扑:设备通过环形连接,数据沿着环路传输,适用于对实时性要求较高的场景。
3. 总线型拓扑:所有设备连接到同一根总线上,适用于设备分布范围较广、数量较多的场景。
4. 混合型拓扑:结合了以上多种拓扑结构的特点,根据实际需求设计网络拓扑。
四、实际案例分析以某工业生产线为例,该生产线包括多个传感器、执行器和控制器,需要实现实时数据采集和控制指令传输。
针对该生产线的特点,可以采用总线型拓扑,将所有设备连接到同一根总线上,以满足实时性和可靠性的要求。
PROFIBUS-DP网络通讯故障分析及处理方法

PROFIBUS-DP 网络通讯故障分析及处理方法发布时间:2023-01-28T08:22:50.278Z 来源:《科技新时代》2022年9月16期作者:张文学朱仕鑫王帅[导读] 对于自动化设备张文学朱仕鑫王帅重庆钢铁股份有限公司重庆 401220摘要:对于自动化设备,总线的可靠性会直接影响设备的运行和生产安全,总线一旦发生故障,比电气故障更难解决,从而导致生产设备长时间停机。
发生网络故障的概率远低于一般电气故障。
这使得很多现场设备管理维护人员更关注各种设备电气故障或机械故障的预防及处理,忽视总线的维护或及时有效地处理网络故障,从而导致通讯故障处理时间延迟。
在此基础上,有必要对PROFIBUS-DP网络通信故障分析及处理方法进行研究。
关键词:PROFIBUS-DP;网络通讯;故障分析;处理方法引言PROFIBUS-DP总线具有可用于设备级控制系统和分布式I/O通信的高速低成本特征,与PROFIBUS-PA、PROFIBUS-FMS一起构成了PROFIBUS标准。
PROFIBUS-DP总线可用于现场层的高速数据传输。
主站可以根据设置的周期读取从站输入的信息,并向从站发送输出信号。
除了周期数据传输功能外,PROFIBUS-DP总线还可以提供一些智能化设备运行所需的非周期通信。
1、PROFIBUS-DP网络介绍1.1 DP网络基本原理介绍PROFIBUS-DP协议将网络上的设备分为主设备和从设备两种。
主站通常是CPU(中央控制器)或CP板(通信模板),从站通常是“远程I/O”。
PROFIBUS-DP主节点必须知道PROFIBUS网络的DP辅地址、DP辅类型、数据交换区域和诊断缓存区域。
DP网络有单主站和多主站传输模式。
对于多主站系统,主站之间通过令牌(Token)传递对总线的控制权。
PROFIBUS-DP主节点启动整个网络的通信,并初始化DP从节点。
首先,根据DP地址将硬件配置信息(参数和IO配置)写入相应的从属服务器。
PROFIBUSDP协议简介剖析

PROFIBUS-DP协议简介一.PROFIBUS – DP用于现场层的高速数据传送。
主站周期地读取从站的输入信息并周期地向从站发送输出信息。
总线循环时间必须要比主站(PLC程序循环时间短。
除周期性用户数据传输外, PROFIBUS-Dp还提供智能化设备所需的非周期性通信以进行组态.诊断和报警处理。
①传输技术:RS-485双绞线.双线电缆或光缆。
波特率从9.6K bit/s到12Mbit/s。
②总线存取:各主站间令牌传递,主站与从站间为主-从传送。
支持单主或多主系统。
总线上最多站点(主-从设备数为126。
③通信:点对点(用户数据传送或广播(控制指令。
循环主-从用户数据传送和非循环主-主数据传送。
④运行模式:运行.清除.停止。
⑤同步:控制指令允许输入和输出同步。
同步模式:输出同步;锁定模式:输入同步。
⑥功能:DP主站和DP从站间的循环用户有数据传送。
各DP从站的动态激活和可激活。
DP从站组态的检查。
强大的诊断功能,三级诊断诊断信息。
输入或输出的同步。
通过总线给DP从站赋予地址。
通过部线对DP主站(DPM1进行配置,每个DP从站的输入和输出数据最大为246字节。
⑦可靠性和保护机制:所有信息的传输按海明距离HD=4进行。
DP从站带看门狗定时器(Watchdog Timer。
对DP从站的输入/输出进行存取保护。
DP主站上带可变定时器的用户数据传送监视。
⑧设备类型:第二类DP主站(DPM2是可进行编程.组态.诊断的设备。
第一类DP主站(DPM1是中央可编程控制器,如PLC.PC等。
DP从站是带二进制值或模拟量输入输出的驱动器.阀门等。
(1PROFIBUS – DP基本特征①速率:在一个有着32个站点的分布系统中,PROFIBUS-DP对所有站点传送512 bit/s 输入和512bit/s输出,在12M bit/s时只需1毫秒。
②诊断功能:经过扩展的PROFIBUS-DP诊断能对故障进行快速定位。
诊断信息在总线上传输并由主站采集。
PROFIBUS-DP介绍

2
一、PROFIBUS-DP简介
DP是Decentralized Periphery(分布式外部设备)的缩写。 PROFIBUS-DP(简称为DP)主要用于制造业自动化系统中单元 级和现场级通信。特别适合PLC与现场级分布式I/O设备之间的 快速循环效据交换。DP是PROFIBUS中应用最广的通信方式。
7
三、PROFIBUS-DP设备的分类
PROFIBUS-DP网络的硬件由主站、从站、网 络部件和网络组态与诊断工具组成。网络部 件包括通信电缆、总线连接器、中继器、耦 合器,以及用于连接串行通信、以太网、AS-i、 EIB等网络系统的网络连接器。
PROFIBUS-DP设备分为以下3种不同类型的 站:
16
4.2、PLC的PROFIBUS通信处理器
S7-200的PROFIBUS通信处理器为EM277,在网络中只 能作从站。
S7-300的PROFIBUS通信处理器为CP342-5、CP343-5 和有光纤接口的CP 342-5 FO。
S7-400的PROFIBUS通信处理器为CP443-5基本型、CP 443-5扩展型、IM 467和IM467-FO。CP 443-5支持冗余 的总线拓扑结构。
12
3.3、DP从站
DP从站是PROFIBUS网络上的被动节点,用于输入信息 的采集和输出信息的发送,DP从站只与它的DP主站交 换用户数据,向主站报告本地诊断中断和过程中断。典 型的从站设备是传感器、执行器和测量变送器。在DP通 信过程中,从站是被动的。
非智能型的分布式I/O没有程序存储和程序执行功能,通 信适配器或接口模块用来接收主站的指令,按主站指令 驱动I/O,并将I/O输入及故障诊断等信息返回给主站。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
BusWorks TM 900PB SeriesProfiBus/RS485 Network I/O ModulesTechnical ReferenceINTRODUCTION TO PROFIBUS DPACROMAG INCORPORATED Tel: (248) 624-1541 30765 South Wixom Road Fax: (248) 624-9234 P.O. BOX 437Wixom, MI 48393-7037 U.S.A.Copyright 2002, Acromag, Inc., Printed in the USA.Data and specifications are subject to change without notice. 8500-698-A02M000Introduction To ProfiBus DP__________________________________________________________________2INTRODUCTION TO PROFIBUS DP ABOUT PROFIBUS.……………………………………………3PROFIBUS DP SLAVE STATE MACHINE..…………………7Power ON/Reset State…………………………………..7Parameterization State………………………………….7I/O Configuration State………………………………….7Data Exchange State…………………………………….8Fail Safe Operation…………………..…………………..8Watchdog……………………………..…………………..9GSD FILES………………………………………………………10REQUIRED SOFTWARE…..………………..…………………13TYPES OF TRANSMISSION………………..…………………14SRD Send and Request Data w/Acknowledge……..14SDN Send Data w/No Acknowledge…………………..14PROFIBUS DP DATA CHARACTER FORMAT…………….14ProfiBus Data Error Checking………….……………..15PROFIBUS TELEGRAM STRUCTURE……………………..15Start Delimiter…………………………………………….16Length Of Telegram……………………………………..18Destination Address & Source Address……………..18Function Code Or Frame Control……………………..18Service Access Points…………………………………..19Data Unit…………………………………………………..19Frame Check Sequence…………………………………19End Delimiter……………………………………………..20DP COMMAND FUNCTIONS………………………………….20Function Status…………………………………………..20OPERATING STATES AND APPLICABLE FUNCTIONS....21Initial Power ON/Reset…………………………………..21Set_Slave_Add Telegram…………………………22Parameterization……..…………………………………..23Set_Prm Telegram………………………………….24I/O Configuration……..…………………………………..26Chk_Cfg Telegram………………………………….26Get_Cfg Telegram………………………………….27Diag_Data Telegram……………………………….27Data Exchange State..…………………………………..33Data_Exchange Telegram……..………………….33Read_Inp Telegram……..………………………….33Read_Outp Telegram…………..………………….34Global_Control Services..……..………………….34Use Of Freeze..……..……..………………….35Use Of Sync/Unsync.……..………………….35BUS TIMING (36)This information is provided as a service to our customers and to othersinterested in learning more about Profibus. Acromag assumes noresponsibility for any errors that may occur in this document, and makes nocommitment to update or keep this information current.Be sure to visit Acromag on the web at .Windows® is a registered trademark of Microsoft Corporation.Modbus® is a registered trademark of Modicon, Incorporated.TABLE OFCONTENTSIntroduction To ProfiBus DP___________________________________________________________________3 The following information describes the operation of ProfiBus DP as itrelates to Acromag Series 900PB DP slave I/O modules. For more detailedinformation on ProfiBus, you may refer to the ProfiBus Trade Organization atthe PTO website .Acromag manufactures a line of I/O modules that support Profibus DPover RS485. Feel free to visit our website at to obtainthe latest information about these and other Acromag products.Acromag Series 900PB modules utilize the popular ProfiBus DPABOUT PROFIBUS FieldBus communication format. ProfiBus was created in 1989 by theGerman government in cooperation with several manufacturers ofautomation equipment. It is a messaging format specifically designed forhigh-speed serial I/O in factory and building automation applications. It is anopen standard and is recognized as the fastest FieldBus in operation today.It is based on RS485 and the European EN50170 Electrical Specification.The DP suffix refers to “Decentralized Periphery”, which is used to describedistributed I/O devices connected via a fast serial data link with a centralcontroller. To contrast, a programmable logic controller (PLC) normally hasits input/output channels arranged centrally. By introducing a network busbetween the main controller (master) and its I/O channels (slaves), we havedecentralized the I/O.ProfiBus is based on universal international standards and oriented tothe OSI (Open System Interconnection) reference model per internationalstandard ISO 7498. In this model, every layer handles precisely definedtasks. Layer 1 of this model is the physical layer and defines the physicaltransmission characteristics. Layer 2 is the data link layer and defines thebus access protocol. Layer 7 is the application layer and defines theapplication functions. ProfiBus DP uses only layers 1 & 2 of this model, plusthe user interface. Layers 3 to 7 are not used.A ProfiBus system uses a bus master to poll slave devices distributed inmulti-drop fashion on an RS485 serial bus. A ProfiBus slave is anyperipheral device (I/O transducer, valve, network drive, or other measuringdevice) which processes information and sends its output to the master.The slave forms a “passive station” on the network since it does not havebus access rights, and can only acknowledge received messages, or sendresponse messages to the master upon request. It is important to note thatall ProfiBus slaves have the same priority, and all network communicationoriginates from the master. Acromag I/O modules form intelligent slavedevices.Acromag modules implement the ProfiBus protocol via an industry-standard SPC3 ASIC from Siemens. This ASIC acts like a RAM or UARTchip to the internal microcontroller and completely handles the requirementsof the protocol standard. The ASIC will transfer network data to and fromthe microcontroller and automatically provide the response to the busaccording to the ProfiBus specification.4Introduction To ProfiBus DP __________________________________________________________________A ProfiBus master forms an “active station” on the network. ProfiBusDP defines two classes of masters. A class 1 master handles the normalcommunication or exchange of data with the slaves assigned to it. A class 2master is a special device primarily used for commissioning slaves and fordiagnostic purposes. Some masters may support both class 1 and class 2functionality. Master-to-master communication is normally not permitted inProfibus, except in order to grant bus access rights to another master via theexchange of a token. However, master-to-master communication betweentwo mono-master systems can be facilitated using a DP-DP gateway. Notethat the exchange of bus access rights via this “token ring” only appliesbetween masters on the bus.A class 1 master device is normally a central programmable controller(PLC), or a PC running special software. The class 1 master sets the baudrate and the slave’s auto-detect this rate. The class 1 master handles thedata exchange with the slaves assigned to it, and acts as the main controllerfor the exchange of I/O information with its distributed slaves, cyclicallyretrieving user I/O data according to a defined message cycle. A master cancommunicate actively with its assigned slaves, but only passively (uponrequest) with another class 2 master device.The class 2 master is usually a configuration device, perhaps a laptopor programming console, and is provided for commissioning, maintenance,or diagnostic purposes. It acts like a “supervisory” master in that it canactively communicate with class 1 masters and their slaves, in addition to itsown slaves, but usually only for the purpose of configuration, problemdiagnosis, and data/parameter exchange. That is, class 2 masters may onlybriefly take over control of a slave. All exchanges between a class 2 masterand class 1 master originate with the class 2 master.ProfiBus DP normally operates using a cyclic transfer of data betweenmaster(s) and slave(s) on an RS485 network. That is, an assigned masterperiodically requests (polls) each node (slave) on the network. All datacommunication exchanges between a master and slave originate from themaster device. Each slave device is assigned to one master and only thatmaster may write output data to that slave. Other masters may readinformation from any slave, but can only write output data to their ownassigned slaves.Masters can address individual slaves, a defined group of slaves (multi-cast), or can broadcast a telegram to all connected slaves. Slaves will returna response to all telegrams addressed to them individually, but do notrespond to broadcast or multi-cast telegrams from a master device.ProfiBus sends Broadcast and Multi-Cast messages as global controltelegrams using address 127 and an optional group number for a targetedgroup of slaves.Because ProfiBus uses a cyclic (periodic) polling mechanism betweenmasters and slaves, it is also deterministic. That is, the behavior of aProfiBus system can be reliably predicted over time. In fact, ProfiBus wasdesigned to guarantee a deterministic response. To contrast, CAN andEthernet are event-driven bus systems and consequently form non-deterministic systems.Introduction To ProfiBus DP___________________________________________________________________5The length (and timing) of the I/O data to be transferred from a singleslave to a master is predefined in the slave’s device data base or GSD file.The GSD files of each device connected via the network (slaves and class 1masters only) are compiled into a master parameter record which containsparameterization and configuration data, an address allocation list, and thebus parameters for all connected stations. A master uses this information toset up communication with each slave during startup.After a master receives its master parameter record, it is ready to beginexchanging data with its slaves. During startup, after a system reset, orupon return to power, a master will attempt to re-establish contact with all theslaves assigned to it before assuming the cyclic exchange of I/O data. Eachslave must already have a unique valid address from 0-125 in order tocommunicate with the master. Any slave that has a default address of 126will await the Set_Slave_Address command from a class 2 master before itcan be parameterized. In attempting to establish communication, the masterstarts with the lowest address slave and ends with the highest addressslave. A master will send parameterization and configuration telegrams to allof its assigned slaves (a slave may only be write-accessed by its assignedmaster, the master that parameterized and configured it during startup). Theparameterization and configuration telegrams ensure that the functionalityand configuration of a slave is known to the master. If an additional slave isadded to the network bus and is not already accounted for in the masterrecord, a new master record must be generated and a new configurationperformed so that the master is informed of the status of the new device.ProfiBus DP most often uses a single class 1 master device (mono-master), cyclically polling many distributed slaves. However, ProfiBus alsoallows for acyclic communication between class 2 masters and slaves,making more than one active station or master possible. A class 1 masterwill automatically detect the presence of a new active station connected tothe network bus (a class 2 master). When the class 1 master completes itspolling cycle, it will pass a “token” to the class 2 master granting it temporaryaccess to the bus. Deterministic behavior is maintained because the class 2master can only use the time allotted to it via the gap time specified.Although, mono-master operation is generally recommended, it is notmandatory. That is, a ProfiBus system may have more than one class 1master, but master to master communication is not permitted, except for thegranting of bus access rights via token exchange.To illustrate the idea of communication between masters in a ProfiBusDP system, a class 1 master cyclically exchanges data with all of the slavesassigned to it, one at a time, according to its list of assigned slaves takenfrom the master record. At the end of this data cycle, additional time (gaptime) is allotted to provide for acyclic communication between a class 2master and the same slaves. During this time, the class 1 master will pass atoken to the class 2 master granting it bus access rights. The class 2master which currently holds the token has the opportunity to exchange datawith all the slaves within a specific period of time called the token half-time ortoken hold-time (T H). The class 2 master may then proceed to read data ordiagnostic information from any of the slaves, and then at the completion ofits cycle, it will pass the token back to the class 1 master.6Introduction To ProfiBus DP __________________________________________________________________Since there usually is not enough time during the gap to complete a full dataexchange, this process of data retrieval by the class 2 master may continueover several cycles. At the end of record transfer, the class 2 master willclear the connection. Note however, that the class 2 master may onlyestablish communication with the slaves during the gap time.As stated earlier, it is possible for a class 2 master to temporarily takeover control of a DP slave. During this time, the DP slave will stop its normaldata exchange with its class 1 master. The class 1 master recognizes thisand will proceed to cyclically request diagnostics from the slave, checkingthe Master Address field for as long as another valid address is present.After the class 2 master finishes its communication with the slave, it sets theMaster Address field of the slave to invalid (255). This causes the class 1master to attempt to regain control of the slave and it will reparameterize andreconfigure the slave before resuming data exchange with it.ProfiBus DP –Key Concepts•Open standard based on EN 50170.•Fastest Fieldbus standard to date with data rates up to 12MB.•Plug & play operation.•Up to 244 bytes of input/output data per message.•Up to 126 stations may connect to the bus.•Up to 32 stations per bus segment.Class 1 Master –•Central controller that exchanges I/O data with connected slaves.•Determines the baud rate (slaves auto-detect this rate).•Manages the token transfer between masters. Detects anothermaster during the gap time.Class 2 Master –•Diagnostic, configuration, or startup tool.•Can only control one slave at a time.•Does not have write-access to the slave.•Does not have a GSD file.Slave -• A passive station which can only respond per a master request andacknowledge messages. A slave has no bus control rights.•The GSD file defines the slave for the master.Introduction To ProfiBus DP___________________________________________________________________7The following state machine helps illustrates how ProfiBus DP operateswith respect to the slaves.Note the four main states:Power ON/Reset,Parameterization, I/O Configuration, and Data Exchange.The master uses the following general telegram sequence during startup:1. Request Diagnostics.2. Change Station Address (optional service, Class 2Master only).3. Parameterize the Slaves.4. Configure the Slaves.5. Request Diagnosticsagain before dataexchange to ensure thatsystem startup was OK.6. Data exchange.7. Global Control (optional).Power ON/Reset StateThe power on/reset state is the initial state following power up for theDP slave. In this state, the slave may receive a telegram from a class 2master to change its station address. A slave will be held in this state if itdoes not have a valid address from 0-125. After completion of its power-oninitialization routine and if the slave has a valid station address, the slave willproceed to the Wait for Parameterization state.Parameterization StateIn this state, the DP slave awaits the parameterization telegram fromthe master which identifies the slave’s master and the mode the slave is tooperate in. A slave in this state will reject all other telegrams except arequest telegram for diagnostics or configuration. After its parameters havebeen set, the slave will proceed to the I/O Configuration State.I/O Configuration StateIn this state, the slave awaits a configuration telegram that specifies thenumber of input and output bytes that are to be exchanged in each datatelegram cycle with the slave. The configuration telegram also causes theslave to check the configuration which was sent against the storedconfiguration. A slave in this state will accept a request telegram fordiagnostics or configuration, or a set parameters telegram.PROFIBUS DP SLAVE STATE MACHINE8Introduction To ProfiBus DP __________________________________________________________________Data Exchange StateAfter parameterization and configuration have been accomplished, theslave cyclically exchanges I/O data with the master. This is a cyclic transferof I/O data and possible diagnostic information.Fail Safe OperationA ProfiBus master runs in two modes: Operate and Clear. Withrespect to the master of a ProfiBus DP system, the term fail-safe simplyrefers to whether the class 1 master sends 0 length data, or data set to 0,when it is in Clear Mode. With respect to a DP slave device, the term fail-safe refers to whether the slave will process output telegrams with zerolength data, or not. Whether the combined master/slave system isconsidered fail-safe depends on the actions taken by the slaves if the masterfails, or if the master switches to Clear Mode. Ideally, the failure of a mastershould not cause errors in any of its slaves and the slave outputs should goto a predictable (defined) state. Using a fail-safe mode, the slave outputscan automatically switch to a fail-safe state in the event of master failure, orwhen the master switches to Clear Mode.A slave may assume a fail-safe state if its watchdog time expireswithout having received a message from its assigned master. Normally thistimer is reset every time the master talks to the slave. If this time expires,this means the master has not communicated with the slave recently, andthe slave is not being controlled. The slave will then leave the dataexchange mode and its outputs will go to a pre-defined state (either theirreset state, or another user-defined state). This state is usually set via user-defined parameters of the parameterization telegram and its GSD file, orsometimes via hardware switches on the slave. Some slaves may provideparameters or switches that also allow the slave outputs to retain their laststate, but this is not considered fail-safe.A slave may also assume a fail-safe state if its master switches fromOperate Mode to Clear Mode. With normal operation in Data_Exchangemode, a class 1 master is in Operate Mode and cyclically exchanges I/Odata with its assigned slaves. The class 1 master may use a global controltelegram to inform the slaves that it is switching from Operate Mode to ClearMode. A master may elect to switch to Clear Mode while it is bringing slavesonline and not all slaves have been parameterized and configured yet. Itmay also switch to Clear Mode as a result of a run/stop switch on themaster. In the Clear State, the master may attempt to parameterize andconfigure the remaining slaves assigned to it in an effort to reinitiate dataexchange, while it continues data exchange with the other slaves (they willbe receiving output data of 0, or output data of zero length). Operate modedoes not resume until all slaves are online and exchanging data, or until themaster is told to resume operation via a run/stop switch or under programcontrol. Further, some masters may go to Clear Mode if a slave is disabled,rather than continue to control a partial system (this response may bespecified as a parameter in the master’s GSD file and parameterizationtelegram, via a mechanical switch, or as part of its master program).Introduction To ProfiBus DP___________________________________________________________________9When a master switches to Clear Mode, it sends a global controltelegram to all slaves with the first data byte (octet 1) = 2 and the seconddata byte (octet 2) = 0. In the next data cycle, the master sends datatelegrams to all stations with either the output data equal to 0, or the outputdata length equal to 0 (i.e. only the telegram header and no data). If theslave GSD file contains “Fail_Safe = 0”, the master sends output telegramswith the data set to 0 in Clear Mode. However, if the slave GSD file contains“Fail_Safe = 1” (supports Fail-Safe Mode), the master will send outputtelegrams with a data length of 0 in Clear Mode. . Slaves that do not supportfail-safe mode do not process data telegrams with no data. Some oldermasters do not make this distinction of fail-safe mode and will send datatelegrams with the output data set to 0 in Clear Mode. This will force allslave outputs to go to 0 in Clear Mode and this may not be desirable forsome critical control applications.By the master sending output telegrams with no data in Clear Mode, afail-safe slave has the option of either setting all outputs to 0, retaining thelast output state (though this response is not fail-safe), or going to a pre-defined default “fail-safe” state. This state may be defined in the GSD fileand included in the user-parameters portion of the parameterizationtelegram, or it may be set via switches at the slave. The slave will stay inthis state until it receives a global control broadcast telegram from themaster telling it the master is returning to Operate Mode and it receives anoutput telegram with the correct output data length, whereupon it updates itsoutputs normally as part of data exchange mode.To summarize, fail-safe mode in ProfiBus DP simply refers to whetherthe master sends output data messages of zero length in Clear Mode or not,and whether a slave is able to process output messages of zero length. Theactions taken by the slave in response to these messages is optional andspecific to the slave implementation. Note that a “fail-safe” slave may notactually act in a fail-safe manner (for example, it may retain the last stateprior to Clear Mode). In any case, for PTO compliance, a fail-safe slavemust at least give the option of clearing the outputs if the master fails orswitches to Clear Mode.WatchdogA slave may assume a defined state if its watchdog time expires withouthaving received a message from its assigned master. Normally this timer isreset by the slave every time the master talks to the slave. If this timeexpires, this means the master has not communicated with the slaverecently, and the slave is not being controlled. A communication error isdetected by the slave and reported with a diagnostic telegram (see functioncodes). The slave will then leave the data exchange mode and its outputswill go to a predefined state (either the reset/clear state, or a user-definedstate) and await reparameterization and reconfiguration by the master. Thetimeout state is clear by default, or it may be set via user-defined parametersof the parameterization telegram and GSD file, or sometimes via hardwareswitches on the slave. Some slaves may provide parameters or switchesthat also allow the slave outputs to retain their last state, but this is notconsidered fail-safe.10Introduction To ProfiBus DP __________________________________________________________________During parameterization, a master sets up the communication andmonitoring times for the slave including the watchdog time (T WD set byWatchdog Factors in DU bytes 2 & 3 of the Set_Prm Telegram). The slaveASIC implements a watchdog function where the slave will monitor the buscommunications with the master over time, and in the event of master failure(timeout), the slave outputs go to a defined state. If the watchdog timer isnot retriggered by the slave station via bus communication with the masterwithin the time specified, then the slave will set its outputs to a defined stateand return to the Wait_Prm state (Wait For Parameterization). In settingwatchdog time T WD, you need to consider the bus cycle time, plus a safetyfactor for repeated telegrams (usually 25% minimum).Before we examine slave operation in detail, we need to get a littlebackground information on a device’s GSD file and how the software is usedto build a ProfiBus system.The GSD file is an electronic device data sheet or device data base file GSD FILESthat identifies the ProfiBus device. All ProfiBus devices (class 1 masters andslaves) have their own GSD files. The GSD file is the fundamental buildingblock for the master parameter record. Use of the GSD file by a ProfiBusconfiguration tool permits plug & play interoperability among differentdevices from different manufacturers. This file does not reside within thedevice itself, but usually on a separate disk/drive. It is an ASCII text file thatcontains device-specific data, such as, vendor identification information,supported baud rates, supported message length, number of input/outputdata, meaning of diagnostic messages, timing information, plus options andfeatures supported, data formats, and available I/O signals. For modularProfiBus systems, a GSD file may contain several configurations (one foreach I/O module), one of which will be found valid during startup.A GSD file is named by combining a vendor name identifier with thedevice’s ident_ number. For example, “ACRO06F3.GSD” is used for theAcromag 981PB-1012 device. The suffix “.GSD” denotes a languageindependent GSD file. A “.GSE” file would specify an English file, “.GSF” forFrench, “.GSS” for Spanish, “.GSI” for Italian, and “.GSG” for German.The GSD file begins with the specifier “#Profibus_DP”. In the body ofthe file, the parameters are specified as parameters of a keyword (as in“keyword = parameter”, see below). Comment lines begin with a semicolon.Case is not significant and the sequence of parameters is not important.Lines are limited to 80 characters, but may be continued by placing abackslash character “\” at the end of the line to be continued. A GSD file isdivided into sections as follows:GSD General SpecificationsKeyword Keyword Vendor_name 187.5_supp Model_Name 500_supp Revision 1.5M_supp Ident_Number MaxTsdr_9.6Protocol_Ident MaxTsdr_19.2Station_type MaxTsdr_93.75FMS_Support MaxTsdr_187.5Hardware_Release MaxTsdr_500Software_Release MaxTsdr_1.5M 9.6_suppRedundancy 19.2_supp Repeater_Ctrl_Sig This section containsinformation on vendor anddevice names, hardware andsoftware revisions,ident_number, supported baudrates, reaction time intervals atsupported baud rates formonitoring times, and optionalsignal support at the busconnector.93.75_supp 24V_Pins GSD Slave Specifications KeywordKeyword Freeze_Mode_suppMax_Input_Len Sync_Mode_suppMax_Output_Len Auto_Baud_suppMax_Data_Len Set_Slave_Add_suppUnit_Diag_Bit User_Prm_Data_LenDiag_Text User_Prm_DataUnit_Diag_Area Min_Slave_IntervallModule Modular_StationChannel_Diag This section contains all slave-related specifications,such as the number and type of I/O channels, specification of diagnostic text, auto-baud support, alternate mode support and information on available modules with modular devices.Max_Module Master Specifications (Master Devices Only): This section contains allmaster-related parameters, such as: the maximum number of slaves thatcan be connected, or upload/download options. This section is not presentfor slave devices and not covered here.The GSD files of all connected devices are compiled together to formthe master parameter record. The master parameter record contains theparameterization and configuration data taken from the all the GSD files, andincludes an address allocation list, plus the bus parameters for all theconnected slaves. During startup, a master will use this information to setup communication with each of its assigned slaves prior to exchangingactual I/O data with them.The ProfiBus Trade Organization offers an easy to use, menu-driveneditor which can be used to prepare GSD files. This GSD-Editor alsocontains a GSD-Checker which guarantees the conformance of the GSD fileto the ProfiBus standard. The format of GSD files is precisely specified inthe EN50170 standard and described in ProfiBus Guideline 2.041.The ProfiBus Trade Organization also maintains a library of GSD filesfor all certified slave devices. You can access these files via the internet at .GSD FILES。