网站标志
导航菜单
当前日期时间
当前时间:
购物车
购物车中有 0 件商品 去结算 我的订单
商品搜索
商品搜索:
文章正文
怎么检测WinCC与PLC的通信状态
作者:管理员    发布于:2015-08-09 11:04:21    文字:【】【】【
 问:怎么检测WinCC与PLC的通信状态,当通信断开时在报警中显示“通信中断”,通信再次连接正常时在报警中显示“通信连接”,并计算出中间的间隔时间。
 
答:可以将信号质量状态取出,进行编程。
 #include "apdefap.h"
 
 
 
int gscAction( void )
 {
 
unsigned long status[1];
 
GetTagBitState("S7$Program(1)_Switch",&status[0]); //Return type :short int printf("%d",*status);
 
if (*status==1)
 SetTagBit("ConnectionBool",1); //Return type :BOOL
 else
 SetTagBit("ConnectionBool",0); //Return type :BOOL
 
return(0);
 }
浏览 (67) | 评论 (0) | 评分(0) | 支持(0) | 反对(0) | 发布人:管理员
将本文加入收藏夹
新闻详情
脚注栏目
|
脚注信息
机电工程网(C) 2015-2020 All Rights Reserved.    联系我们