R_Trig_1(clk:=xStart and not di_emergency);
if R_Trig_1.Q and not doMotorStart then
if xSpeedUp then
xHighFreq := TRUE;
else
xLowFreq := TRUE;
end_if;
doMotorStart := TRUE;
end_if;
if not di_Stop or not di_Emergency then (*Stop and emergency contact are normally closed *)
xLowFreq := FALSE;
xHighFreq := FALSE;
doMotorStart := FALSE;
end_if;
if xLowFreq and xSpeedUp then
xHighFreq := TRUE;
end_if;
do_LowFreq := xLowFreq;
do_HighFreq := xHighFreq;