回复:循环调用全局脚本,怎么无法实现,求指导

锋言锋语

西门子1847工业学习平台

  • 帖子

    4014
  • 精华

    54
  • 被关注

    134

论坛等级:至圣

注册时间:2011-07-31

钻石 钻石 如何晋级?

发布于 2015-11-24 13:33:59

2楼

根据你的需求, 我按自己的理解如下:

BOOL s_run = GetTagBit("run"); //启动标志

if(s_run) 
{
    SetTagFloat("Dis_WaterPos", GetTagFloat("Act_WaterPos"));//运行状态, 显示实际水位, Dis                                                              //是I棒图连接的变量;

}
else
{
    SetTagFloat("Dis_WaterPos", GetTagFloat("Set_WaterPos"));//not运行状态, 显示set水位, Dis是I棒图连接的变量;

}


//time expires., Action with one second period.

int t = GetTagWord("time");

if(t && GetTagBit("run")) // when t is not zero and the system is running, time is expiring.
{
    SetTagWord("time", --t);
}


if(!t && GetTagBit("run")) //when t is zero and the system is running, it triggles                                      //time_expired event.

{
    SetTagWord("Time_Expired", true);  // when time expires,  set a bool tag.
}


不忘初心
评论
编辑推荐: 关闭

请填写推广理由:

本版热门话题

SIMATIC WinCC / Panel

共有32979条技术帖

相关推荐

热门标签

相关帖子推荐

guzhang

恭喜,你发布的帖子

评为精华帖!

快扫描右侧二维码晒一晒吧!

再发帖或跟帖交流2条,就能晋升VIP啦!开启更多专属权限!

  • 分享

  • 只看
    楼主

top
X 图片
您收到0封站内信:
×
×
信息提示
很抱歉!您所访问的页面不存在,或网址发生了变化,请稍后再试。