"R_TRIG_DB_3"(CLK := "DD".LOU[1 ],
Q => "DD".P[1 ]);
IF "DD".P[1 ] THEN
"DD".樓層隊列[1 ] := "DD".隊列數(shù) + 1;
"DD".隊列數(shù) := "DD".隊列數(shù) + 1;
;
RETURN;
END_IF;
上面一段可以通過 "DD".LOU[1 ] 的上升沿做加一計數(shù),求助我想寫一個一組數(shù)據(jù)通過循環(huán)判斷上升沿來計數(shù),但是數(shù)量一直累積,沒法做到上面的單個效果,大佬們幫忙分析分析,給各位大佬們拜個早年。
FOR "DD".NUM := 1 TO 10 DO
;
"R_TRIG_DB_3"(CLK := "DD".LOU["DD".NUM ],
Q => "DD".P["DD".NUM ]);
IF "DD".P["DD".NUM ] THEN
"DD".樓層隊列["DD".NUM ] := "DD".隊列數(shù) + 1;
"DD".隊列數(shù) := "DD".隊列數(shù) + 1;
;
RETURN;
END_IF;
END_FOR;