I am using UR5e for a sand blasting process. I wanted to record the amount of time the sand blaster is on during the process, store it and keep adding to it until a certain value is reached after that controller can raise a flag for maintenance checks associated with the blaster.
Code that I came up with includes timer function that is recording the time only when blaster is ON. However, the problem is the timer keeps resetting to 0 when the robot is stopped and played again. Erasing the previous recorded time.
Is there a way someone can advice to keep updating time irrespective of stop/start of robot?
I think what you are looking to use would be installation variables as these should keep their values even if the program is stopped. You should be able to create them under the Installation Tab → General → Variables.
nrivas is correct that installation variable is what you need to use so that the value isn’t reset when restarting programs, loading programs, and/or cycling power on the robot.
However, one thing to keep in mind is that a timer is only going to be recording while a program is running. If you’re blaster is configured in a way where it can accumulate runtime while a robot program is not running, the variable in the robot program will not reflect this. If this is the case, you may end up needing an external device.
Thanks for pointing out the timing thing about the blaster. The station is stand alone so it will only run when the robot is running. Installation variables should sort this out.
Thanks.