Files
infineon_plc/PLC/01_Stationen/HeatCoolPlates/FB_PWM.TcPOU
m.heisig c1850f780b First bigger step to automation
- Aligned X and Y NC Axis with aligner camera coordination system
- Added robot plc jobs and feedback
- Began Meca500 robot interface
- Changed hotplate control to slow PWM
- PackML statemachine now starts in aborted state
- Fixed StateML start method
2026-02-04 19:31:13 +01:00

35 lines
763 B
XML

<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1">
<POU Name="FB_PWM" Id="{39ea0d97-8eb7-44fa-b55f-8461b6c6c8ae}" SpecialFunc="None">
<Declaration><![CDATA[FUNCTION_BLOCK FB_PWM
VAR_INPUT
rPWM : REAL;
timPeriod : TIME;
END_VAR
VAR_OUTPUT
xOutput : BOOL;
END_VAR
VAR
_tonTimer : TON;
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[_tonTimer(IN := TRUE, PT := timPeriod);
IF _tonTimer.Q THEN
_tonTimer(IN := FALSE);
END_IF
IF rPWM = 0.0 THEN
xOutput := FALSE;
ELSIF rPWM >= 100.0 THEN
xOutput := TRUE;
ELSE
IF (1.0 - (TIME_TO_REAL(_tonTimer.ET) / TIME_TO_REAL(timPeriod))) <= (rPWM * 0.01) THEN
xOutput := TRUE;
ELSE
xOutput := FALSE;
END_IF
END_IF]]></ST>
</Implementation>
</POU>
</TcPlcObject>