I have a KCP2 controller. My process requires me to pick up 5 diferant tools and to use them in up to 45 differant programs.
Last night, they were running the robot and all was well till they stopped the robot mid program, or so I am told.
When I pick up a tool I call a $flag[]=true and when I drop the tool I call $flag=false.
after the crash last night they turned the power off on the robot.
When I powered the robot up this morning it powered up on the wrong screen.
When I went to drop of the tool the robot would not move because the $flag[]=false. but the tool was on the robot.
I am certain this will be operator related but is there anyway that when shut of and powered up that the flag could have changed?
Are alarms stored somewhere that I can see what happenend to cause the crash?
Lost flag in program
-
9566317 -
January 23, 2014 at 10:06 PM -
Thread is marked as Resolved.
-
-
how is the flag declared? with or without initial assignment?
if you have
DECL GLOBAL BOOL $flag
then value will not be retained through power outage
if you want it to keep value even when robot is powered down you need to initial the value, something like:DECL GLOBAL BOOL $flag = false
note that assigned initial value will change as you run program so on next powerup it will be the last value (perhaps true)
-
correct you need to make the variable retentive
-
Problem is, $FLAG is a system variable array, so you can't change how it's declared. I think that $FLAG is supposed to be retentive anyway, but I don't recall ever testing it explicitly.
Honestly, I generally recommend against using memory flags of any kind for this kind of operation -- checking the sensor inputs of the tool changer directly, in realtime, is far more reliable. Of course, sometimes you may be stuck with a hardware configuration that does not make this option possible.
-
Thank you all. I did a lot of investigation into this and I could not make the robot loose the flag. I really believe it is related to the crash and the operator.
In saying this I am looking for a way of stopping this from happening again. In the beginning of of my main program I have the logic dropping the tool
and starting empty. This was the cause of the crash as I do not have a lot of safety moves in the program.
Mythought is now to have the beginning of the program to call a message up if there is a tool on the robot.
How do I call up a message that stops and does not let the robot move anymore and the controller screen calls a message.
IE
If $flag[10] or $flag[11] then
stop and do nothing
call programing helpIs there a way of doing this?
-
If flag [10] or flag [11] then
Repeat
;** Tool on robot call maintenance
Until not flag [10] and not flag [11]
EndifCould work
Sent from my Nexus 5 using Tapatalk
-
-
Thank you all, I have a stop and check system in place now and should eliminate operator error.