(dCusF)1
' The ADC 0 to 4096 correspond to 1.0 to 100.0 seconds.
DM[1]=ADC(1)/40 'connect to the potentiometer.
IF getTimerSV(1) <> DM[1]
setTimerSV 1, DM[1] 'save data in data memory 1 to Timer SV
ENDIF
(CusF)2
STEPSPEED 1,DM[2],20 'Just to simulate stepper motor is moving & changing the speed
STEPMOVE 1,100000,10 'with simulated encoder feedback.
A=STEPCOUNTABS(1) 'Analog encoder pulse input(1).
(dCusF)3
A=B
IF A=0 THEN 'A is the variable for STEPCOUNT &
C=DM[1] 'B is the variable for DELAY timer setting
ELSE 'A is set 0 for stop to moving position
C=200000/B
ENDIF
IF getTimerSV(1) <> C
setTimerSV 1, C
ENDIF
My task is to change the time delay of the timer (in turns activate an output) once there is a change in the speed of the conveyor which is fitted with an encoder.
So when the speed of the conveyor increase,the delay time become shorter.
From my above commands, i am just trying to get a sampling time,say in 1 minute how many stepcounts, so can u suggest a way to do it?
Kindly reply, thanks alot!