恭喜,你发布的帖子
发布于 2015-11-24 18:01:56
6楼
根据你的需求, 我按自己的理解如下:
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.
}
Act_WaterPos的值是怎么来的?我主要就是实际水量增加以及时间减少不太会。
我给你解释下我的程序,麻烦你看看:
先定义swz保存设定的水量(shuiwei变量,棒图也是连接这个变量的),按下启动后shuiwei变量值清零,定义h保存实际水量并与swz比较,h<swz时触发全局脚本进行水量增加,cf是全局脚本的触发变量。for循环是用来延时的,不知道对不对、。。。。
请填写推广理由:
分享
只看
楼主