Distinguish a cold start from a download of a modified program from WorkVisual

  • Hi


    I have a Kuka robot with a KRC4 controller which controls an external parallel gripper. All quite simple except for that that gripper might be gripping a part by opening the gripper OR by closing the gripper, depending on which part to pick.


    The robot program keeps track of that as long as it's running and is always able to "release" the part based on persistent variables that tell which direction the current grip is. When hibernating, this also works flawlessly as well as during a cold boot.


    The problem comes when downloading a new program from WorkVisual to the robot controller: At that state, the variables for the grip direction are overridden by potentially earlier values, potentially making the robot "release" afterwards in the wrong direction.


    The gripper is an electrical gripper and therefore it doesn't handle it well if I tell it to release in some direction that it can't move. Also, I unfortunately get no state info from it that I can use in this case. So, I was hoping that I could instead detect when a new program has been downloaded to the robot from WorkVisual and then just ask the operator (who would then be an "expert programmer") which direction to move the gripper when that happens


    But, long story short, is there ANY way to distinguish a "download of new files to the robot" from "the controller has been cold booted"? Both reset all outputs and both would restart the submit interpreter. So I can't seem to find a good way of telling whether I can trust my persistent variables.


    Thanks in advance!

  • As far I can tell, there isn't a way to tell the robot if a program was edited internally (from SmartPad) or externally (from WorkVisual or any other editor).


    Since I don't know the code running at your robot, I'm just guessing, but looks like the variables overwritten when You download the program in the robot controller are declared on the .dat file that compose that particular program module.


    A good way to avoid this would declare these variables globally somewhere else. On as specific file, or at $config.dat itself.

  • A good way to avoid this would declare these variables globally somewhere else. On as specific file, or at $config.dat itself.

    Mmmm... but doing a Project Deploy in WoV sends every file, including $CONFIG.DAT. So moving those variables to a different file won't protect them if the gripper state has changed in between the Upload of the project that is being edited, and the Deploy of the edits.


    Probably the formally correct way to do this would be to go to the robot, stop the robot, Upload the active project, insert the changes, then Deploy, then resume the robot. As long as the changes being added don't overwrite any of the memory variables, this should work.


    The trick is to ensure that the project being Deployed has the same memory state as the real state of the gripper. Or, don't do full-Project Deploys, and only push changes to a single module (if the module being pushed includes the memory states of the gripper, then making a special standalone Global module that only contains the gripper memory states might be worthwhile)

  • all you can do in this case is use external memory. something that is not affected by WoV. why not use small PLC that handles gripper and provides feedback to KRC of current state?


    not sure of any variable that tells if and when WoV project was deployed.


    did not think much abut it but i am inclined to follow Registry path as seen in the archive:

    \LocalMachine\SOFTWARE\KUKA ROBOTER GMBH\WorkVisual

    it contains key CurrentProjectName etc.


    this can be exported to a text file using reg command for example

    https://docs.microsoft.com/en-…ndows-commands/reg-export


    and the text file can be read by CWRITE


    this is just to illustrate that there is a way though it maybe long wound or unconventional

    1) read pinned topic: READ FIRST...

    2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

    3) read 1 and 2

  • and this part works:

    reg export "HKLM\SOFTWARE\KUKA ROBOTER GMBH\WorkVisual\CurrentProje

    ctName" filename.txt


    or better


    reg export "HKLM\SOFTWARE\KUKA ROBOTER GMBH\WorkVisual\CurrentProje

    ctName" filename.txt /y


    1) read pinned topic: READ FIRST...

    2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

    3) read 1 and 2

  • Or, don't do full-Project Deploys, and only push changes to a single module (if the module being pushed includes the memory states of the gripper, then making a special standalone Global module that only contains the gripper memory states might be worthwhile)

    If I understood correctly, OP is having problems downloading single programs in the robot, not complete WoV projects.


    When I wrote specific file on may previous message, I was meaning a global .dat just for the gripper states, as You mentioned above.


    A thing to be observed is if the robot has more than one program, and all these programs have local variables with same name, this approach will need the creation/renaming of some variables.

  • if transferring individual files rather than deploying WoV project, it is enough to move declarations to a separate DAT file

    1) read pinned topic: READ FIRST...

    2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

    3) read 1 and 2

  • Impressive, I had no idea that that would be possible! I guess that then, if it becomes very important, this would be the way to go.

    If I understood correctly, OP is having problems downloading single programs in the robot, not complete WoV projects.

    Actually, I have problems when downloading entire WoV-projects. Otherwise, I agree that those state-variables should just be in a .dat-file of their own.

    Edited once, last by Moller ().

  • The formal, correct best-practice way to handle this is to have the gripper report its state in real time, and always check that state before commanding any action. As a rule, relying on memory states is considered poor practice (not that that stops some designers), and your current situation is a case in point.


    So, making the memory states less vulnerable to being reset by a Project Deploy would be a partial fix, the kind we're often stuck with b/c the bean counters refuse to fund the correct solution. But the real solution would be to put sensors on the gripper that report its position, and the presence/absence of a part in the gripper, at all times.

  • i second that.... having sensor is always the best possible option.


    sometimes having sensor on the EOAT may not be practical for variety of reasons... but even then having sensor is still the best option. an example is gripper that goes into oven. no sensor would endure the heat that turns gripper red hot, but sensor does not need to go in there. can be external and still do its job from the safe place - robot can bring part/gripper to sensor for inspection.

    1) read pinned topic: READ FIRST...

    2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

    3) read 1 and 2

Advertising from our partners