Hello All,
I have a r200ib 200T R30ia robot that handles material for 4 cnc horizontal milling machines. My problem is the machine priority. I would like to start a timer for each machine when it becomes ready for service, a total of four timers. Then have the robot constantly monitor those 4 timers and determine which machine it should service first by the machine that has been ready for service the longest. Thank you for the help!!
How can I Constantly monitor a timer??
-
robmx57 -
April 17, 2018 at 3:10 PM -
Thread is marked as Resolved.
-
-
You can create a BG program that writes a register to the value of a timer.
R[1]=TIMER[1]
R[2]=TIMER[2]
R[3]=TIMER[3]
R[4]=TIMER[4]Then just use the TP program to reset each timer when you are finished loading the machine.
LBL 5
IF R1>XXX JMP LBL 1 ------Load machine 1
IF R2>XXX JMP LBL 2 ------Load machine 2
IF R3>XXX JMP LBL 3 ------Load machine 3
IF R4>XXX JMP LBL 4 ------Load machine 4
JMP LBL 5So which ever machine exceeds you set value (XXX) it will jump to the section of the program.
-
You could setup a program or system level condition monitors to watch the service IO.
Code: WHEN DI[11:M1 Service]=ON+, CALL START_TIME1 ; : WHEN DI[12:M2 Service]=ON+, CALL START_TIME2 ; : WHEN DI[13:M3 Service]=ON+, CALL START_TIME3 ; : WHEN DI[14:M4 Service]=ON+, CALL START_TIME4 ; : WHEN DI[11:M1 Service]=OFF-, CALL RESET_TIME1 ; : WHEN DI[12:M2 Service]=OFF-, CALL RESET_TIME2 ; : WHEN DI[13:M3 Service]=OFF-, CALL RESET_TIME3 ; : WHEN DI[14:M4 Service]=OFF-, CALL RESET_TIME4 ;
START_TIMEX would start the appropriate timer, and RESET_TIMEX would reset and stop it. You may want to set these timers as global (from the status->timer screen) so they still time while the robot is paused or aborted.
Code
Display More:!Store Machine timers ; : R[11:M1 Time]=TIMER[1] ; : R[12:M2 Time]=TIMER[2] ; : R[13:M3 Time]=TIMER[3] ; : R[14:M4 Time]=TIMER[4] ; : ; : !Figure out which machine to tend ; :IF (R[11:M1 Time]>R[14:M4 Time]), R[15:Mach to tend]=1; :IF (R[12:M2 Time]>R[11:M1 Time]), R[15:Mach to tend]=2; :IF (R[13:M3 Time]>R[12:M2 Time]), R[15:Mach to tend]=3; :IF (R[14:M4 Time]>R[13:M3 Time]), R[15:Mach to tend]=4; : ; : SELECT R[15:Mach to tend]=1, CALL TEND1 ; : =R[15:Mach to tend]=2, CALL TEND2 ; : =R[15:Mach to tend]=3, CALL TEND3 ; : =R[15:Mach to tend]=4, CALL TEND4 ;
-
This is great. Where could I find the "When" instruction?
-
Create a program with no groups, and then set it to the COND sub type. Keep in mind you will still have to start the condition program (either via the program, or manually setting it up as a system condition).
-
Nation, thank you for the information on changing the Timer to Global. We've been fighting with that for several years and never saw that in the Detail window.
-
NATION,
THANK YOU FOR YOUR ADVICE. HOW DO I CALL THE CONDITION PROGRAM IN MY MAIN TP PROGRAM? OR SET IT UP AS A SYSTEM CONDITION, AS YOU STATED? -
To use it in a program, use the MONITOR command. You can use the END MONITOR command to stop it. The condition monitor will only stick around as long as the program that started it is running.
For a system level condition monitor, first set $TPP_MON.$global_mt to 1, and then go configure it in the status screen area, under the condition type, and then F2 for system condition monitors.
Nation, thank you for the information on changing the Timer to Global. We've been fighting with that for several years and never saw that in the Detail window.Happy to help.