#pragma option(mbcs)
BOOL UpEdgeRecord_Function()
{
BOOL MidTrigger,CurrentTrigger;
MidTrigger=GetTagBit("BOOLW_Taglogging_MidTrigger_1");
CurrentTrigger=GetTagBit("BOOLW_Taglogging_Trigger_1");
if(CurrentTrigger!=MidTrigger&CurrentTrigger==TRUE)
{
SetTagBit("BOOLW_Taglogging_Trigger_2",(short)!GetTagBit("BOOLW_Taglogging_Trigger_2"));
}
SetTagBit("BOOLW_Taglogging_MidTrigger_1",(short)CurrentTrigger);
return GetTagBit("BOOLW_Taglogging_Trigger_2");
}
该代码可以实现BOOLW_Taglogging_Trigger_1上升沿时将某一变量进行非周期归档,如何在上面改动可以实现BOOLW_Taglogging_Trigger_1下降沿时将对应的变量非周期归档?
最佳答案
if(CurrentTrigger!=MidTrigger&CurrentTrigger==false)就行了。
提问者对于答案的评价:
谢谢了
原创文章,作者:more0621,如若转载,请注明出处:https://www.zhaoplc.com/plc255249.html