MAIN.TcPOU 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.12">
  3. <POU Name="MAIN" Id="{a2b09358-5c9b-458e-83dc-1d7d6fc5ad2b}" SpecialFunc="None">
  4. <Declaration><![CDATA[PROGRAM MAIN
  5. VAR
  6. FFU:FFU;
  7. tHeatbeat :Ton;
  8. tON :TON;
  9. bAdsCommErr :BOOL;
  10. tOFF :TON;
  11. //CE远程桌面开启
  12. bEnableCerDisp:BOOL;
  13. NT_StartProcess_Test:NT_StartProcess;
  14. END_VAR
  15. ]]></Declaration>
  16. <Implementation>
  17. <ST><![CDATA[FFU();
  18. IOMapping();
  19. Interlock();
  20. // PLC建立心跳
  21. tHeatbeat(IN:=NOT tHeatbeat.Q , PT:=T#1S , Q=> , ET=> );
  22. IF tHeatbeat.Q THEN
  23. GVL.stPLCtoPMC.bHeartBeatMonitor :=NOT GVL.stPLCtoPMC.bHeartBeatMonitor;
  24. END_IF
  25. // PLC监控PMC心跳
  26. IF GVL.stPMCtoPLC.bHeartBeatMonitor THEN
  27. tON(IN:=GVL.stPMCtoPLC.bHeartBeatMonitor , PT:=T#2S , Q=> , ET=> );
  28. tOFF(IN:=FALSE , PT:=T#2S , Q=> , ET=> );
  29. IF tON.Q THEN
  30. bAdsCommErr :=TRUE;
  31. ELSE
  32. bAdsCommErr :=FALSE;
  33. END_IF
  34. ELSE
  35. tOFF(IN:=NOT GVL.stPMCtoPLC.bHeartBeatMonitor , PT:=T#2S , Q=> , ET=> );
  36. tON(IN:=FALSE , PT:=T#2S , Q=> , ET=> );
  37. IF tOFF.Q THEN
  38. bAdsCommErr :=TRUE;
  39. ELSE
  40. bAdsCommErr :=FALSE;
  41. END_IF
  42. END_IF
  43. //CE远程桌面开启
  44. NT_StartProcess_Test(
  45. NETID:= ,
  46. PATHSTR:='\windows\CerDisp.exe' ,
  47. DIRNAME:='\windows' ,
  48. COMNDLINE:= ,
  49. START:=bEnableCerDisp ,
  50. TMOUT:= ,
  51. BUSY=> ,
  52. ERR=> ,
  53. ERRID=> );]]></ST>
  54. </Implementation>
  55. <LineIds Name="MAIN">
  56. <LineId Id="2" Count="0" />
  57. <LineId Id="93" Count="0" />
  58. <LineId Id="54" Count="0" />
  59. <LineId Id="37" Count="1" />
  60. <LineId Id="18" Count="4" />
  61. <LineId Id="39" Count="0" />
  62. <LineId Id="23" Count="5" />
  63. <LineId Id="40" Count="1" />
  64. <LineId Id="29" Count="4" />
  65. <LineId Id="43" Count="2" />
  66. <LineId Id="35" Count="1" />
  67. <LineId Id="68" Count="1" />
  68. <LineId Id="7" Count="0" />
  69. <LineId Id="71" Count="8" />
  70. <LineId Id="70" Count="0" />
  71. </LineIds>
  72. </POU>
  73. </TcPlcObject>