20190110 贝加莱PLC C语言循环与延时应用

  • Post author:
  • Post category:其他


void _CYCLIC ProgramCyclic(void)

{


if(B)

{


i;

TON_10ms(&T1);

switch (i)

{


case 0:

T1.IN=1;

T1.PT=100;//delay 1s

if(T1.Q)

{


T1.IN=0;

i+=1;

}

break;

case 1:

T1.IN=1;

T1.PT=100;//delay 1s

if(T1.Q)

{


T1.IN=0;

i+=1;

}

break;

case 2:

T1.IN=1;

T1.PT=100;//delay 1s

if(T1.Q)

{


T1.IN=0;

i+=1;

}

break;

case 3:

T1.IN=1;

T1.PT=100;//delay 1s

if(T1.Q)

{


T1.IN=0;

i+=1;

}

break;

case 4:

T1.IN=1;

T1.PT=100;//delay 1s

if(T1.Q)

{


T1.IN=0;

i+=1;

}

break;

case 5:

T1.IN=1;

T1.PT=100;//delay 1s

if(T1.Q)



版权声明:本文为weixin_38944231原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。