Great feedback guys! I like the PTP directly to $axis_act! I honestly haven't seen any major cycle time delays when running, but once fractions of a second start to count, I'll add in the IF.
Posts by spencmi
-
-
I don't know about you, but I hate the BCO move. So, with these 3 lines of code, it's no longer as annoying as it once was.
It's super simple, hardly worth mentioning but for me, it's made a huge difference in my sanity. LOL
;FOLD BCO KILLER
BAS(#INITMOV);SET SPEED
CURRENT_POS = $AXIS_ACT_MEAS
PTP CURRENT_POS; EXPECT NO MOTION
;ENDFOLD BCO KILLERIt actually has a couple of nice functions,
1. You get your BCO without even moving the robot. Select a program, hit start without even looking with confidence, then block select wherever you like...
2. You can get back to the same point that you started with at the start of your program, pretty much anytime. Which is usually the last point of the previous program, so this lets you not have to copy the same point, or use a global point.
3. I have used it as a temporary position while programming a path.
4. You can have a program full of nothing but LIN's and still get to them...
5. Since I used $AXIS_ACT or $AXIS_ACT_MEAS, the robot can get to this point no matter how twisted up you can get it. I originally used $POS_ACT but found some situations that would cause the robot to fault with pulse limits, axis type move fixed the issue.
*Note- make sure to declare CURRENT_POS as an E6AXIS Global position.
I put this code at the top of every program. Where it's been most useful is while running in Auto, the start of our program goes through an initialization for our SMC servo grippers to send them home. Without the BCO killer, you have to hold the Start button until the robot make it's first move, now, you can tap start twice and walk away!
Of course, use this at your own risk, know where your robot is and where it's going to go, i.e. know your program...
Enjoy!
-
Thanks, I like that method. I decided to play nice with my PLC guy and let him control the motion enable. I'm still checking that it's false before calling my program. I may still add your example in later...
My final code for anyone interested:
;FOLD STOP PROGRAM
IF $IN[15] == TRUE THEN ;PROGRAM STOP INPUT
IF $OUT[18] == TRUE THEN ;PROGRAM RUNNING
IF $MODE_OP == #EX THEN
IF ($PRO_STATE1 <> #P_FREE) THEN ; If a program is selected
CWRITE($CMD,STAT,MODE,"STOP 1")
ENDIF
ENDIF
ENDIF
ENDIF
;ENDFOLD STOP PROGRAM
;FOLD CANCEL PROGRAM
IF $IN[13] == TRUE THEN ;CANCEL PROGRAM
IF $OUT[18] == FALSE THEN ;PROGRAM RUNNING
IF $MODE_OP == #EX THEN
IF ($PRO_STATE1 <> #P_FREE) THEN ; If a program is selected
CWRITE($CMD,STAT,MODE,"CANCEL 1")
ENDIF
ENDIF
ENDIF
ENDIF
;ENDFOLD CANCEL PROGRAM
;FOLD TOP OF MASTER
;SET OUTPUT FOR AT TOP OF MASTER PROGRAM
IF ($PRO_STATE1 <> #P_FREE) THEN ; If a program is selected
IF (StrComp($PRO_NAME1[],"MASTER",#NOT_CASE_SENS)==TRUE) THEN
IF $PROG_INFO[1].PRO_IP_SNR == 3 THEN ;PROGRAM LINE NUMBER
$OUT[14] = TRUE; AT TOP OF MASTER
ENDIF
ENDIF
ENDIF
IF ($PRO_STATE1 <> #P_FREE) THEN ; If a program is selected
IF (StrComp($PRO_NAME1[],"MASTER",#NOT_CASE_SENS)==TRUE) THEN
IF $PROG_INFO[1].PRO_IP_SNR <> 3 THEN ;PROGRAM LINE NUMBER
$OUT[14] = FALSE ;NOT AT TOP OF MASTER
ENDIF
ENDIF
ENDIF
IF ($PRO_STATE1 <> #P_FREE) THEN ; If a program is selected
IF (StrComp($PRO_NAME1[],"MASTER",#NOT_CASE_SENS)==FALSE) THEN
$OUT[14] = FALSE ;NOT AT TOP OF MASTER
ENDIF
ENDIF
IF ($PRO_STATE1 == #P_FREE) THEN ; If a program is NOT selected
$OUT[14] = FALSE ;NOT AT TOP OF MASTER
ENDIF
;ENDFOLD TOP OF MASTER
;FOLD MASTER PROGRAM CALL FROM PLC
IF $IN[14] == TRUE THEN ;CALL MASTER PROGRAM
IF $MODE_OP == #EX THEN
IF $MOVE_ENABLE == FALSE THEN ;KEEPS PROGRAM FROM STARTING
IF ($PRO_STATE1 <> #P_FREE) THEN ; If a program is selected
IF (StrComp($PRO_NAME1[],"MASTER",#NOT_CASE_SENS)==FALSE) THEN
CWRITE($CMD,STAT,MODE,"STOP 1")
WAIT SEC 1
CWRITE($CMD,STAT,MODE,"CANCEL 1")
WAIT SEC 1
ENDIF
ENDIF
ENDIF
IF ($PRO_STATE1 == #P_FREE) THEN ; If a program is not selected
CWRITE($CMD,STAT,MODE,"RUN /R1/MASTER()")
ENDIF
ENDIF
ENDIF -
-
Thank you Panic Mode & SkyeFire!
Executing the CWRITE with motion enable disabled, selects the program perfectly.
I'm really trying to keep as much of the code in the KRC as possible, can we control $MOVE_ENABLE inside the KRC? Currently, it's mapped in External Automatic as input 1. If possible, I'd like to make $MOVE_ENABLE = FALSE when calling my program, then back to whatever the input value from the PLC is afterwards.
-
Hi guys!,
I'm a former Motoman guy, trying to become a Kuka guy... So before you even ask, yes I know about the Cell program and how Kuka wants me to do it...
But I don't want to do it Kuka's way. LOL,
What I'm looking for is how to select a program from the plc while in external auto without the program starting to run. I want to select the program and verify it's on the correct line before pressing START.
The default SPS has : CWRITE($CMD,STAT,MODE,"RUN /R1/CELL()") ; code used by Kuka to start the cell.
I want to make it something like: CWRITE($CMD,STAT,MODE,"SELECT /R1/MASTER()") ;but I know Select isn't an option.
I have read the cread/cwrite manual but it doesn't get into enough detail to figure this out with my limited knowledge.
I have a couple of ways to do it, but looking for the cleanest, proper, etc. way to do it.
I'm told to try executing the command with motion enable off, not sure if this will alarm or just work,
I could put a HALT at the top of my program, but don't like that as it's too easy to forget to add or edit out later...
Here's a bit of my code for reference, the first fold is for TOP of Master job, this works great, and the second fold is CALL MASTER job. (Motoman terms...LOL)
my software version: KRC 5 Micro 8.7.4
;FOLD TOP OF MASTER
;SET OUTPUT FOR AT TOP OF MASTER PROGRAM
IF ($PRO_STATE1 <> #P_FREE) THEN ; If a program is selected
IF (StrComp($PRO_NAME1[],"MASTER",#NOT_CASE_SENS)==TRUE) THEN
IF $PROG_INFO[1].PRO_IP_SNR == 3 THEN ;PROGRAM LINE NUMBER
$OUT[14] = TRUE; AT TOP OF MASTER
ENDIF
ENDIF
ENDIF
IF ($PRO_STATE1 <> #P_FREE) THEN ; If a program is selected
IF (StrComp($PRO_NAME1[],"MASTER",#NOT_CASE_SENS)==TRUE) THEN
IF $PROG_INFO[1].PRO_IP_SNR <> 3 THEN ;PROGRAM LINE NUMBER
$OUT[14] = FALSE ;NOT AT TOP OF MASTER
ENDIF
ENDIF
ENDIF
IF ($PRO_STATE1 <> #P_FREE) THEN ; If a program is selected
IF (StrComp($PRO_NAME1[],"MASTER",#NOT_CASE_SENS)==FALSE) THEN
$OUT[14] = FALSE ;NOT AT TOP OF MASTER
ENDIF
ENDIF
IF ($PRO_STATE1 == #P_FREE) THEN ; If a program is NOT selected
$OUT[14] = FALSE ;NOT AT TOP OF MASTER
ENDIF
;ENDFOLD TOP OF MASTER
;FOLD MASTER PROGRAM CALL FROM PLC
IF $IN[14] == TRUE THEN
IF $MODE_OP == #EX THEN
IF ($PRO_STATE1 <> #P_FREE) THEN ; If a program is selected
IF (StrComp($PRO_NAME1[],"MASTER",#NOT_CASE_SENS)==FALSE) THEN
CWRITE($CMD,STAT,MODE,"STOP 1")
WAIT SEC 1
CWRITE($CMD,STAT,MODE,"CANCEL 1")
WAIT SEC 1
ENDIF
ENDIF
IF ($PRO_STATE1 == #P_FREE) THEN ; If a program is not selected
CWRITE($CMD,STAT,MODE,"SELECT /R1/MASTER()")
ENDIF
ENDIF
ENDIF
;ENDFOLD MASTER PROGRAM CALL FROM PLC
Thanks in advance for your help!
-
-
This is more of an annoyance than anything but I'm working on a 5 robot system. When I browse for a project, the search window works fine, I see 5 separate Cells to connect to. However, when I go into the Programming and diagnosis mode, Create Connection popup window, I get what looks like 3 cells, where two robots are nested inside the others. I've attached a screenshot to hopefully better explain what I see.
Does anyone know what causes this or where it's controlled. Maybe something in my setup? I'm clueless...
edit: well, I thought I uploaded a screenshot... doesn't seem to be shown....
Thank you!