Hi all,
In order to get better understanding of the production problems in our plant, I am planning to write a Karel program that would write all the errors to log file. I know we already have a log file built-in with the Fanuc controller (I am running mostly R-30iA in our plant) and it is quite good, but not exactly what I would like to have.
I would like to have timestamp with one second resolution (not one minute as the built-in log file has) and what's more important, I also need another timestamp for each error: the time when the robot started production again after the error. All that should be pretty straightforward with PMC and firing my Karel program with macro calls, but I need some advice with Karel programming.
I have some background with Karel and handling files, so the basics should come out pretty okay. However, I will be starting the Karel program with PMC and macro, so every time the robot stops with fault, the Karel macro is fired. Is there some way to find out (in Karel) which program is running and on what line we are right now? It would be even better if we could actually read the contents of the program line.
I tried to read the manual, but so far I did not find good solution to my problem.
Example: robot is running program PRODUCT4 and on line 27 it has a collision detection error. The fault DO with PMC fires the Karel program. Is it possible to write a program that can tell me that the program we were running was PRODUCT4 and it was running line 27 when the error occured? I would also like to read the error code, I bet it can be done, too.
After that I would launch the same program with falling edge of fault DO to write to log that the robot is back to production. With all that running for a while on all our production cells I could analyze the data and see how many minutes we are losing per day and what programs/program lines usually are causing the problem.
Thank you for your input!