Hello fellow wicked people,
I need a way to look up an upcoming position(s) in the program while the program is being executed. E.g. a program part that looks like this:
$advance=3
ptp {x 1000, y -980, z 1360, a -15, b 3, c 43, s 6, t 50} ; p1
lin {x 1300, y -980, z 1360, a -15, b 3, c 43} ;p2
lin {x 1300, y -380, z 1360, a -15, b 3, c 43} ;p3
lin {x 1300, y -380, z 1060, a -15, b 3, c 43} ;p4
Is there a way to read from some system variable or to write to a variable pos of p2 while the robot is moving to (p1)? How about if it's already at p1 and moving to p2? In other words, where the robot is planning to go, BEFORE it gets there. I am hoping for something simple like $pos_act (which gives the current pos of #tcp).
Some other ideas for tackling this:
1. Advance pointer outputs (if that's even a thing).
2. Parse the current running program with sread and krl_fgets and try and interpret that. Very roundabout and complicated when functions appear in the code or there is a tool or base change or commented lines. So, I would rather not go this way.
3. Put all the positions into struct (movetype, pos) arrays and execute them in a cycle. A bit backwards, but would work. Looking for something easier and/or not changing current code structure.
4. Some other option I haven't even considered yet. Open to suggestions!
Edit: Using KRC 4 and KSS 8.3.37