资源描述:
《iec103通信流程详解》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、控制系统保护设备一、首先进行初始化过程发送复位if使用复位通信单元thenif对全部设备进行复位thenbeginManageGuDingZhen(varGuDingzh:TGuDingzh,0,$FF,$40)Elseif对单个设备进行复位thenBeginGetAddr(设备地址);ManageGuDingZhen(varGuDingzh:TGuDingzh,0,$FF,$40);End;Endelseif使用复位帧计数位进行复位thenif对全部设备进行复位thenbeginManageGuDingZhen(varGuDingzh:TGuDingzh,7,$FF,$47)Elseif对单
2、个设备进行复位thenBeginGetAddr(设备地址);ManageGuDingZhen(varGuDingzh:TGuDingzh,7,$FF,$47);超时间不回答End;重发超过Twz引起发送复位通信单元或者复位帧计数位,过程如上确认if控制系统发送的ASDU0thenbeginifASDU0的地址为$FFthenif没有一级数据thenbeginif接受缓冲区已经满thenManageGuDingZhen(varGuDingzh:TGuDingzh,0,$FF,$10)Elseif接受缓冲区仍然能接受数据ManageGuDingZhen(varGuDingzh:TGuDingzh,
3、0,$FF,$00);endElseif有一级数据thenbeginif接受缓冲区已经满thenManageGuDingZhen(varGuDingzh:TGuDingzh,0,$FF,$20)Elseif接受缓冲区仍然能接受数据ManageGuDingZhen(varGuDingzh:TGuDingzh,0,$FF,$30);End;IfASDU0的地址为某一个具体设备的地址Athenif没有一级数据thenbeginif接受缓冲区已经满thenManageGuDingZhen(varGuDingzh:TGuDingzh,0,A,$10)Elseif接受缓冲区仍然能接受数据ManageGuD
4、ingZhen(varGuDingzh:TGuDingzh,0,A,$00);endElseif有一级数据thenbeginif接受缓冲区已经满thenManageGuDingZhen(varGuDingzh:TGuDingzh,0,A,$20)Elseif接受缓冲区仍然能接受数据ManageGuDingZhen(varGuDingzh:TGuDingzh,0,A,$30);End;清空发送缓冲区;Endelseif控制系统发送的ASDU7thenbeginifASDU0的地址为$FFthenif没有一级数据thenbeginif接受缓冲区已经满thenManageGuDingZhen(var
5、GuDingzh:TGuDingzh,0,$FF,$10)Elseif接受缓冲区仍然能接受数据ManageGuDingZhen(varGuDingzh:TGuDingzh,0,$FF,$00);endElseif有一级数据thenbeginif接受缓冲区已经满thenManageGuDingZhen(varGuDingzh:TGuDingzh,0,$FF,$20)Elseif接受缓冲区仍然能接受数据ManageGuDingZhen(varGuDingzh:TGuDingzh,0,$FF,$30);End;IfASDU0的地址为某一个具体设备的地址Athenif没有一级数据thenbeginif
6、接受缓冲区已经满thenManageGuDingZhen(varGuDingzh:TGuDingzh,0,A,$10)Elseif接受缓冲区仍然能接受数据ManageGuDingZhen(varGuDingzh:TGuDingzh,0,A,$00);endElseif有一级数据thenbeginif接受缓冲区已经满thenManageGuDingZhen(varGuDingzh:TGuDingzh,0,A,$20)Elseif接受缓冲区仍然能接受数据ManageGuDingZhen(varGuDingzh:TGuDingzh,0,A,$30);End;请求1级或者2级数据End;If保护设备发
7、送过来的ASDU0的ACD位为0then//表明没有一级数据BeginIfASDU0的DFC位为0thenbeginIfASDU0的地址为$FFthen请求2级数据ManageGuDingZhen(varGuDingzh:TGuDingzh,11,$FF,$5B)elseASDU0的地址为某一个具体设备的地址Athen请求2级数据ManageGuDingZhen(varGuDingzh:TGuDi