ganutenator
Lifetime Supporting Member
Code:
(*convert rpm into inches per sec //1.5708 * rpm /1800 * 12"*)
BridgeWriteSpdInSec:= 1.5708 * INT_TO_REAL(Bridge_write_speed_rpm) /1800.0 * 12.0;
If (PassNum = 1) & ((MachineMotionStep = 120) or (MachineMotionStep = 130) ) Then
RecordCar:= true;
Else
RecordCar:= false;
End_if;
TimerForDist (IN := RecordCar & not OneInchReset,
PT := t#10m);
If RecordCar Then
RecordDist:= BridgeWriteSpdInSec * Time_To_Real(TimerForDist.et) / 1000.0; (*distance = rate x time*)
If (RecordDist>= InchesCompare) Then
sim_pulse:= true;
RecordDist:= 0.0;
(*OneInchReset:= true;*)
InchesCompare:= InchesCompare + 1.0;
Else
sim_pulse:= false;
OneInchReset:= false;
End_if;
end_if;
(*r_trigs*)
sim_pulse_re (CLK := sim_pulse);
RecordCarRE (CLK := RecordCar);
(*Determines what speed to run the Hi Press Pump for the Top*)
If RecordCar Then
IF (not XP4_clear) THEN
ProfileTopRec:= 5;
ELSIF (not XP3_clear) THEN
ProfileTopRec:= 4;
ELSIF (not XP2_clear) THEN
ProfileTopRec:= 3;
ELSIF (not XP1_clear) THEN
ProfileTopRec:= 2;
else
ProfileTopRec:= 1;
END_IF;
else
ProfileTopRec:= 0;
end_if;
If RecordCar & sim_pulse_re.q Then
RecordedProfile[profPointer]:= ProfileTopRec;
inc(profPointer);
End_if;
(*clear array at beginning of next recording*)
If RecordCarRE.q Then
InchesCompare:= 1.0;
profPointer:=0;
RecClearPntr:=0;
While RecClearPntr < 1001 Do
RecordedProfile[RecClearPntr]:= 0;
inc(RecClearPntr);
End_while;
End_if;
Last edited: