PLCben79
Member
hi, i am very new to plc programming so please bear with me.
i am currently writing a simple ladder program part of which detects the speed of a slow moving conveyor using the pulses from the rotary encoder as the input.
the program i have written counts the pulses on X0 over a 5 second period. and uses that info to work out the speed and store it in memory.
this speed is then used to work out the timing of a delay before activating an output to turn on a solenoid.
my problem is that when simulating the program it appears that the program waits for 5 seconds before following the next steps in the ladder.
this will create a problem for me as if the timing delay for activating the output and switching on the solenoid is less than 5 secs then the timing will be way off.
i could reduce the timer to less than 5 seconds however it doesnt really solve the problem.
is it possible to activate a timer and let it run while the PLC scans the rest of the ladder and then uses the information stored in memory on the next scan, and similarly i dont want the time delay for the activation of the output to impact the scan time of the program.
i am using an Mitsubishi FX1S PLC and GX Works 2, i am using the internal timer M8013 for 1 second timing to increment memory address d1 and then using the line >= d1 k5 to stop the timer and start M0 which does the mathmatics to work out the speed as I know that each pulse represents 150mm
any help much appreciated
i am currently writing a simple ladder program part of which detects the speed of a slow moving conveyor using the pulses from the rotary encoder as the input.
the program i have written counts the pulses on X0 over a 5 second period. and uses that info to work out the speed and store it in memory.
this speed is then used to work out the timing of a delay before activating an output to turn on a solenoid.
my problem is that when simulating the program it appears that the program waits for 5 seconds before following the next steps in the ladder.
this will create a problem for me as if the timing delay for activating the output and switching on the solenoid is less than 5 secs then the timing will be way off.
i could reduce the timer to less than 5 seconds however it doesnt really solve the problem.
is it possible to activate a timer and let it run while the PLC scans the rest of the ladder and then uses the information stored in memory on the next scan, and similarly i dont want the time delay for the activation of the output to impact the scan time of the program.
i am using an Mitsubishi FX1S PLC and GX Works 2, i am using the internal timer M8013 for 1 second timing to increment memory address d1 and then using the line >= d1 k5 to stop the timer and start M0 which does the mathmatics to work out the speed as I know that each pulse represents 150mm
any help much appreciated