Monitoring Alarm in sps program

  • I am trying to turn on an output if an Alarm exists in the KUKA Robot. So in normal operation robot running ok, if an Alarm happens i need to turn on a physical output on the onboard beckhoff output card. Is there a variable that i can monitor in the sps program like $Alarm or something like this?

  • if by "alarm" you mean message, look for message number then for example add in your submit something like


    $OUT[whatever]=ISMESSAGESET(message_number)

    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

  • The application is for a polishing tool on the EOAT, rotary motor that I MUST stop if the robot stops moving. If Robot Errors, Alarms, Motion stops all axis, then turn on Digital Output. Need to monitor continuously so was thinking of placing this code in the sps.

  • The application is for a polishing tool on the EOAT, rotary motor that I MUST stop if the robot stops moving. If Robot Errors, Alarms, Motion stops all axis, then turn on Digital Output. Need to monitor continuously so was thinking of placing this code in the sps.

    Doesn't necessarily need to be the SPS. Depending on your system configuration, you might be able to use $ALARM_STOP (program stopped by some error), or $PROC_ACT (program running), or $PRO_MOVE (robot physically in motion).

  • Thanks guys.


    If not monitoring in the sps continuously how would I monitor those Alarm Stop or PRO_Move if the programming that is running is busy doing other motion and reading points.

    I thought this would have to be done in spa to have it monitor continuously in the background.

  • Any signal or variable that starts with $ is a System Signal or Variable. Many of these are constantly updated by the operating system, regardless of what the robot program or SPS are doing.


    For example, if you use an SPS program to monitor a state and set an output, it can still be possible for the robot to run even with the SPS halted. But the System Signals like $PRO_ACT are always being updated, no matter what -- the only way to stop them is to crash the operating system or turn the robot off entirely.


    Which leads to another item: do you want to set an output when an error happens? Because using the SPS, if someone stops the SPS, or just turns off the robot, that output obviously will not get set. Usual practice is to use a System Signal that is set when there is no error, and is reset when an error is present.


    $ALARM_STOP, for example, is always True unless an E-Stop occurs, at which point it becomes False. OTOH, $STOPMESS is False when no errors are active, and becomes True when an error is active.


    In your case, you want to ensure the polisher stops whenever something goes wrong with the robot. I would suggest using $PRO_ACT, and tie that signal into the power circuit for the polisher. $PRO_ACT is always True when the program in the Robot Interpreter is running. Anything that stops the program will turn $PRO_ACT off. And if the robot is turned off, $PRO_ACT will also go False then, too.


    OTOH, $PRO_ACT will not go False if the program simply gets stuck at a WAIT statement. So $PRO_MOVE, which goes True when the robot is physically moving, might be a better choice.


    But $PRO_MOVE will not go False if the robot speed is reduced to 0. So you begin to see some of the complexity.


    A different approach might be to use a PULSE command with a short time duration in the SPS. Firing a PULSE before the previous PULSE expires keeps the signal high. So something like

    PULSE ($OUT[1], TRUE, 0.1) would keep output 1 True until 100ms after the SPS was stopped. So that would detect the SPS being stopped, with a short time delay.

    You could do combination logic as well:

    bMyBooleanVariable = $PRO_ACT AND $PRO_MOVE AND NOT $STOPMESS

    PULSE ($OUT[1], bMyBooleanVariable, 0.1)

  • in decently fresh kss versions you also have $ROB_STOPPED which could be of use to monitor, this variable is true whenever the robot is standing still. Observe i might have misstyped the variable as this is of the top of my head.


    Another useful feature would be ir_stopm(). Check ini section of a program. There you can do certain stuff if it is triggered. E.g. stop the polisher or similar.

Advertising from our partners