ifix中判断与PLC的通讯状态 点击:1146 | 回复:4



6355288

    
  • 精华:2帖
  • 求助:0帖
  • 帖子:43帖 | 24回
  • 年度积分:0
  • 历史总积分:714
  • 注册:2008年3月07日
发表于:2008-10-20 19:55:56
楼主
ifix中判断与PLC的通讯状态


在PLC的程序中建一个点,周期变化数值(如:1秒钟变化一次)。在IFIX中建立一个点读PLC中该点的值,用调度判断该点数值是否变化,若无变化,则表示PLC停机!

这种上位机和下位机的交互起较重要的作用。比如,使用SQT、SQD等周期性数据处理,下位机停机后上位机仍然在运行,可以通过这种简单的交互停止资源的消耗!

方法二:
Using a digital input block reading a hardware register, the A_cualm field will be utilized. Chain the DI block to an event action block to a digital output tag using the SIM driver. In the event action block use the following script:
IF the A_cualm =com
Then set DO =1
Else set the DO=0
A data link can be made to the Sim block. The value of this block will determine the status of the communcation.

方法三:

The Scheduler can be used to trigger a script on loss of connection to a device.

Create tags for each device (which has no activity behind it in the PLC) and monitor it for a COMM alarm. Create an On-True event in the scheduler that watches the F_NALM field (new alarm) to be 1, and have it run a script like the following:

dim strAlmType as String

strAlmType = ReadValue("Fix32.Node.Tag.A_CUALM")
If InStr (1, strAlmType, "COMM") Then
MsgBox "Connection Was Lost!" ‘ your real code would go here, but this will test the concept
EndIf

Because most A_fields are padded with spaces you would not fire an event directly off of the A_CUALM = "COMM" because it would not be translated correctly. The method used here will work well and be immune to the padded space problem. It will also only fire once per unacknowledged alarm (F_NALM will be reset to 0 on ack).





siren

  • 精华:36帖
  • 求助:0帖
  • 帖子:426帖 | 6724回
  • 年度积分:0
  • 历史总积分:21846
  • 注册:2002年3月09日
发表于:2008-10-20 21:04:37
1楼

用客户端读一下, 看是否是坏值即可判断是否是通信成功.

功夫熊猫

  • 精华:0帖
  • 求助:0帖
  • 帖子:29帖 | 188回
  • 年度积分:0
  • 历史总积分:0
  • 注册:1900年1月01日
发表于:2008-10-22 08:50:36
2楼
不错,我正需要这方面的资料呢 ,谢谢 !

club

  • 精华:0帖
  • 求助:0帖
  • 帖子:47帖 | 739回
  • 年度积分:0
  • 历史总积分:0
  • 注册:1900年1月01日
发表于:2008-11-12 12:10:53
3楼
我以前用的就是第一种方法 ,。不错

功夫熊猫

  • 精华:0帖
  • 求助:0帖
  • 帖子:29帖 | 188回
  • 年度积分:0
  • 历史总积分:0
  • 注册:1900年1月01日
发表于:2008-11-12 16:22:10
4楼
不错,我正需要这方面的资料呢 ,谢谢 !

热门招聘
相关主题

官方公众号

智造工程师