1. 变量声明及调用技巧

1.4. 每次运行第一个循环为true后续为false的标志位用哪个

可以直接使用系统变量,类型为PlcTaskSystemInfo,然后可以调用firstcycle,infosys说明:

https://infosys.beckhoff.com/content/1033/tc3_plc_intro/714821259.html?id=7349667482175727446

使用firstcycle变量,程序在第一个扫描周期提供高电平信号的功能。

FirstCycle:During the first PLC task cycle, this variable has the value TRUE.