The XP19.Z change is happening before the moveZ, and i reset XP19.Z with ZstartPos.Z=0 in the beginning of the program before anything happens
Posts by martenH
-
-
I would also like to add that the code worked perfectly once after i restarted the KRC2
Tool measure routine
Code
Display MoreXP19.z=Choose_Start_Height+1700 ;Moving the robot from position 1 to position 2 on the Z axis DEF MoveZ() ;Activate interrupt INTERRUPT ON 1 ;Move to starting position influenced by manual input ;FOLD LIN P19 Vel=0.05 m/s CPDAT9 Tool[1]:SpindelLInks Base[0];%{PE}%R 5.5.31,%MKUKATPBASIS,%CMOVE,%VLIN,%P 1:LIN, 2:P19, 3:, 5:0.05, 7:CPDAT9 $BWDSTART=FALSE LDAT_ACT=LCPDAT9 FDAT_ACT=FP19 BAS(#CP_PARAMS,0.05) LIN XP19 ;ENDFOLD ;Move to toolsetter with low speed ;FOLD LIN P3 Vel=0.005 m/s CPDAT1 Tool[0] Base[0];%{PE}%R 5.5.31,%MKUKATPBASIS,%CMOVE,%VLIN,%P 1:LIN, 2:P3, 3:, 5:0.005, 7:CPDAT1 $BWDSTART=FALSE LDAT_ACT=LCPDAT1 FDAT_ACT=FP3 BAS(#CP_PARAMS,0.005) LIN XP3 ;ENDFOLD END
location Data
Code;Position at toolsetter DECL E6POS XP3={X 9795.64063,Y -36.9331589,Z 1667.74902,A -92.4533463,B 59.865799,C -90.2656479,S 22,T 26,E1 -7691.95996,E2 0.0,E3 0.0,E4 0.0,E5 0.0,E6 0.0} DECL FDAT FP3={TOOL_NO 0,BASE_NO 0,IPO_FRAME #BASE,POINT2[] " ",TQ_STATE FALSE} DECL PDAT PPDAT3={VEL 100.0,ACC 100.0,APO_DIST 100.0} ;Position that is influenced by starting height DECL E6POS XP19={X 10041.6396,Y -47.7748795,Z 1400.0,A 177.792999,B 0.0935023278,C -179.915207,S 22,T 26,E1 -7691.96191,E2 0.0,E3 0.0,E4 0.0,E5 0.0,E6 0.0} DECL FDAT FP19={TOOL_NO 1,BASE_NO 0,IPO_FRAME #BASE,POINT2[] " ",TQ_STATE FALSE} DECL LDAT LCPDAT9={VEL 2.0,ACC 100.0,APO_DIST 100.0,APO_FAC 50.0,ORI_TYP #VAR,CIRC_TYP #BASE,JERK_FAC 50.0} DECL LDAT LCPDAT10={VEL 2.0,ACC 100.0,APO_DIST 100.0,APO_FAC 50.0,ORI_TYP #VAR,CIRC_TYP #BASE,JERK_FAC 50.0}
-
Hi guys i managed to do it with your suggestions however I’m running into something weird. I have set a high starting point (max toollength +100) a and then it goes to the rough measured length that he been input. From there it goes at the minimum speed to a point underneath the toolsetter so when it moves down it presses the toolsetter.
But the thing that I’m having troubles with is that I have copied the coordinates of the point below the toolsetter into the starting hight and add 100 mm to it. But the weird thing is that when it goes to the start position it doesn’t it goes up while it should be moving down...
-
got it to work had to switch the ACTIVE TOOL and ACtive tool o hmi around
-
Hi guys, Im trying to display a value on a HMI and adjust it on the HMI but it isnt working. The whole system is with PROFIBUS and KRC2 and everything works but my KRL code doesnt seem to work.
the reading of the value works without any problem but now I also want to write that same value, however when I try that it gives me the error that the value is write protected in sps. How can i read and write a value on my hmi?
-
Hi guys,
I have established a system where I can imput an integer on a HMI and the KRC2 recieves that integer. But the thing is that I want to use this integer to adjust a the FRAME of a position.
I have a toolsetter that can measure the length of a tool and the system is working perfectly. However I now have a set high from where it starts the measurment and when I have a short tool it takes a very long time to reach the toolsetter. I want use my HMI to adjust the hight that this movement starts from, All the systems are working perfectly together but I dont know how to adjust the starting point with the HMI.
How do I modify the Z VALUE in my DAT.fil of following position?
CodeDECL E6POS XP1={X 9796.91602, Y -36.7467499,Z 2246.72998,A -92.4459,B 59.854189,C -90.279007, S 22,T 26,E1 -7691.95996, E2 0.0, E3 0.0, E4 0.0, E5 0.0, E5 0.0, E6 0.0} DECL BASIS_SUGG_T LAST_BASIS={POINT1[] "P19 ",POINT2[] "P19 ",CP_PARAMS[] "CPDAT13 ",PTP_PARAMS[] "PDAT8 ",CONT[] " ",CP_VEL[] "2 ",PTP_VEL[] "100 ",SYNC_PARAMS[] "SYNCDAT ",SPL_NAME[] "S0 "} DECL FDAT FP1={TOOL_NO 2,BASE_NO 0,IPO_FRAME #BASE,POINT2[] " ",TQ_STATE FALSE} DECL PDAT PPDAT1={VEL 100.0,ACC 20.0,APO_DIST 100.0}
-
I got it to work! no need for help anymore! The program worked all of the suddern
-
Hey guys, I need some advice I am trying to write code for a robot with a millmotor with automatic toolchanger. The code is supposed to work as followed.
First it tries to put a tool in a toolclip.
If the tool is properly unchucked it will continue the main program.
If the tool isnt unchucked properly it will try it for 3 times.
- If within these 3 times it works then it will continue to the main program.
- If It doesnt succeed to unchuck the tool then it will move to an ERROR positon and it will cancel the toolchange program
I almost have it functioning but when the code reaches the point where it has to choose one of the last 2 options it gets stuck with a instruction inadmissable error message.
I tried to let te code pick which option to go for, back to the main program or to the ERROR position with an IF $IN[1]==False THEN ;Toolholder closed without tool, Statement but it gets stuck at that statement. How can i get this to work?
Thankyou in advance
MA
SRC code
Code
Display More&ACCESS RVP &REL 90 &PARAM EDITMASK = * DEF Safety_Check( ) ;FOLD INI ;FOLD BASISTECH INI GLOBAL INTERRUPT DECL 3 WHEN $STOPMESS==TRUE DO IR_STOPM ( ) INTERRUPT ON 3 BAS (#INITMOV,0 ) ;ENDFOLD (BASISTECH INI) ;FOLD USER INI ;Make your modifications here ;ENDFOLD (USER INI) ;ENDFOLD (INI) ;FOLD PTP HOME Vel=30 % DEFAULT;%{PE}%R 5.5.31,%MKUKATPBASIS,%CMOVE,%VPTP,%P 1:PTP, 2:HOME, 3:, 5:30, 7:DEFAULT $BWDSTART=FALSE PDAT_ACT=PDEFAULT FDAT_ACT=FHOME BAS(#PTP_PARAMS,30) $H_POS=XHOME PTP XHOME ;ENDFOLD ;Move to position above toolbox ;FOLD PTP P1 Vel=100 % PDAT1 Tool[2]:nitta leeg Base[0];%{PE}%R 5.5.31,%MKUKATPBASIS,%CMOVE,%VPTP,%P 1:PTP, 2:P1, 3:, 5:100, 7:PDAT1 $BWDSTART=FALSE PDAT_ACT=PPDAT1 FDAT_ACT=FP1 BAS(#PTP_PARAMS,100) PTP XP1 ;ENDFOLD ;Move to position infront of toolclip ;FOLD LIN P2 Vel=2 m/s CPDAT1 Tool[2]:nitta leeg Base[0];%{PE}%R 5.5.31,%MKUKATPBASIS,%CMOVE,%VLIN,%P 1:LIN, 2:P2, 3:, 5:2, 7:CPDAT1 $BWDSTART=FALSE LDAT_ACT=LCPDAT1 FDAT_ACT=FP2 BAS(#CP_PARAMS,2) LIN XP2 ;ENDFOLD ;Move into toolclip ;FOLD LIN P3 Vel=2 m/s CPDAT2 Tool[2]:nitta leeg Base[0];%{PE}%R 5.5.31,%MKUKATPBASIS,%CMOVE,%VLIN,%P 1:LIN, 2:P3, 3:, 5:2, 7:CPDAT2 $BWDSTART=FALSE LDAT_ACT=LCPDAT2 FDAT_ACT=FP3 BAS(#CP_PARAMS,2) LIN XP3 ;ENDFOLD ;Unchuck tool $OUT[1]=TRUE ;Move 2mm Above tool ;FOLD LIN P7 Vel=2 m/s CPDAT6 Tool[2]:nitta leeg Base[0];%{PE}%R 5.5.31,%MKUKATPBASIS,%CMOVE,%VLIN,%P 1:LIN, 2:P7, 3:, 5:2, 7:CPDAT6 $BWDSTART=FALSE LDAT_ACT=LCPDAT6 FDAT_ACT=FP7 BAS(#CP_PARAMS,2) LIN XP7 ;ENDFOLD ;Chuck tool $OUT[1]=FALSE ;Check if tool is unchucked and turn on light IF $IN[1]==FALSE THEN $OUT[2]=TRUE WAIT SEC 4 $OUT[2]=FALSE ;Move to position above toolbox ;FOLD PTP P13 Vel=100 % PDAT4 Tool[2]:nitta leeg Base[0];%{PE}%R 5.5.31,%MKUKATPBASIS,%CMOVE,%VPTP,%P 1:PTP, 2:P13, 3:, 5:100, 7:PDAT4 $BWDSTART=FALSE PDAT_ACT=PPDAT4 FDAT_ACT=FP13 BAS(#PTP_PARAMS,100) PTP XP13 ;ENDFOLD ;Check if tool is unchucked if tool isnt unchucked start retry sequence ELSE IF $IN[1]==TRUE THEN ;Make counter 0 C=0 ;Start retry sequence until tool is unchucked REPEAT ;Chuck toolholder for reconnecting $OUT[1]=TRUE ;Move back into tool ;FOLD LIN P8 Vel=2 m/s CPDAT7 Tool[2]:nitta leeg Base[0];%{PE}%R 5.5.31,%MKUKATPBASIS,%CMOVE,%VLIN,%P 1:LIN, 2:P8, 3:, 5:2, 7:CPDAT7 $BWDSTART=FALSE LDAT_ACT=LCPDAT7 FDAT_ACT=FP8 BAS(#CP_PARAMS,2) LIN XP8 ;ENDFOLD ;Chuck tool $OUT[1]=FALSE ;Move to position infront of toolclip ;FOLD LIN P9 Vel=2 m/s CPDAT8 Tool[2]:nitta leeg Base[0];%{PE}%R 5.5.31,%MKUKATPBASIS,%CMOVE,%VLIN,%P 1:LIN, 2:P9, 3:, 5:2, 7:CPDAT8 $BWDSTART=FALSE LDAT_ACT=LCPDAT8 FDAT_ACT=FP9 BAS(#CP_PARAMS,2) LIN XP9 ;ENDFOLD ;Move into toolclip ;FOLD LIN P10 Vel=2 m/s CPDAT9 Tool[2]:nitta leeg Base[0];%{PE}%R 5.5.31,%MKUKATPBASIS,%CMOVE,%VLIN,%P 1:LIN, 2:P10, 3:, 5:2, 7:CPDAT9 $BWDSTART=FALSE LDAT_ACT=LCPDAT9 FDAT_ACT=FP10 BAS(#CP_PARAMS,2) LIN XP10 ;ENDFOLD ;Unchuck tool $OUT[1]=TRUE ;Move to position above toolclip ;FOLD LIN P11 Vel=2 m/s CPDAT10 Tool[2]:nitta leeg Base[0];%{PE}%R 5.5.31,%MKUKATPBASIS,%CMOVE,%VLIN,%P 1:LIN, 2:P11, 3:, 5:2, 7:CPDAT10 $BWDSTART=FALSE LDAT_ACT=LCPDAT10 FDAT_ACT=FP11 BAS(#CP_PARAMS,2) LIN XP11 ;ENDFOLD ;Chuck tool $OUT[1]=FALSE ;Repeat counter C=C+1 ;When to stop repeat sequence UNTIL ($IN[1] == FALSE) OR (C == 3) ;Wait 1 sec ;FOLD WAIT Time=1 sec;%{PE}%R 5.5.31,%MKUKATPBASIS,%CWAIT,%VWAIT,%P 2:1 WAIT SEC 1 ;ENDFOLD ;End check for tool in toolchanger ENDIF ;When Tool is unchucked continue program IF $IN[1]==FALSE THEN ;FOLD LIN P15 Vel=2 m/s CPDAT12 Tool[2]:nitta leeg Base[0];%{PE}%R 5.5.31,%MKUKATPBASIS,%CMOVE,%VLIN,%P 1:LIN, 2:P15, 3:, 5:2, 7:CPDAT12 $BWDSTART=FALSE LDAT_ACT=LCPDAT12 FDAT_ACT=FP15 BAS(#CP_PARAMS,2) LIN XP15 ;ENDFOLD ;FOLD PTP P17 Vel=100 % PDAT6 Tool[2]:nitta leeg Base[0];%{PE}%R 5.5.31,%MKUKATPBASIS,%CMOVE,%VPTP,%P 1:PTP, 2:P17, 3:, 5:100, 7:PDAT6 $BWDSTART=FALSE PDAT_ACT=PPDAT6 FDAT_ACT=FP17 BAS(#PTP_PARAMS,100) PTP XP17 ;ENDFOLD ;If tool isnt unchucked return to ERROR position ELSE ;Move down into toolclip ;FOLD LIN P16 Vel=2 m/s CPDAT13 Tool[2]:nitta leeg Base[0];%{PE}%R 5.5.31,%MKUKATPBASIS,%CMOVE,%VLIN,%P 1:LIN, 2:P16, 3:, 5:2, 7:CPDAT13 $BWDSTART=FALSE LDAT_ACT=LCPDAT13 FDAT_ACT=FP16 BAS(#CP_PARAMS,2) LIN XP16 ;ENDFOLD ;Move out of toolclip ;FOLD PTP P19 Vel=100 % PDAT8 Tool[2]:nitta leeg Base[0];%{PE}%R 5.5.31,%MKUKATPBASIS,%CMOVE,%VPTP,%P 1:PTP, 2:P19, 3:, 5:100, 7:PDAT8 $BWDSTART=FALSE PDAT_ACT=PPDAT8 FDAT_ACT=FP19 BAS(#PTP_PARAMS,100) PTP XP19 ;ENDFOLD ;Move to ERROR positon ;FOLD PTP P18 Vel=100 % PDAT7 Tool[2]:nitta leeg Base[0];%{PE}%R 5.5.31,%MKUKATPBASIS,%CMOVE,%VPTP,%P 1:PTP, 2:P18, 3:, 5:100, 7:PDAT7 $BWDSTART=FALSE PDAT_ACT=PPDAT7 FDAT_ACT=FP18 BAS(#PTP_PARAMS,100) PTP XP18 ;ENDFOLD ENDIF ENDIF END
-
-
Yes i have established a profibus connection that is working prefectly im allready sending other values and i hava enough spare signals left. Right now im trying to activate output 3 when input 15 is activated with this code in the submit file in a continus loop however it isnt activating the output, do you happen to know why?
-
Hello guys, im writing a program and in want to display the state of my input and outputs on a HMI, how would I go about this? I'am using the first 16 in and outputs they are activated by direct signals but now I want to send the state of these inputs through profibus or through a network cable to my siemens PLC and after that i want to display the status on my HMI, for instance input 15 of the robot is activated I now want to see on my HMI that this input on the robot is activated how do I do this? I have allready established the profibus and network conncetion thankyou in advance! Im using a krc2
Kind regards MA
-
-
Hey guy, I'm walking against a big wall.
I have made a code that measures the lenght of a tool when the robot pushes a button with the tool, after that it then automaticlly calculates the lenght of the tool. However now there is a request that it measures the toollenght once the button is not pushed in anymore. So to clearify the robot will move from a starting position with a tool over the z axis until the button is pushed a signal will trigger a interrupt and then the robot will start to move back up on the z axis. Once the robot isnt activating and touchting the button anymore the POS has to be recorded and a new toollenght will be calculated. I tried to do this with a interrupt inside a interrupt but this isnt working (probably because it isnt allowed to use interrupts inside of interrupts). This way of measuring toollenght is common in CNC machines to ensure higher measurment accuracy and is requested from my costumer.
Now my question is, does anyone know how I can measure my toollenght once the button isnt pushed in anymore after being pushed in? I have attached my current code for clearification (and my working code for measurement once the toolsetter/button is pushed):
NOT WORKING CODE (when trying to measure the toollenght when not pressing a the toolsetter/button)
Code
Display MoreDEF Meting_UP_4( ) ;FOLD INI ;FOLD BASISTECH INI GLOBAL INTERRUPT DECL 3 WHEN $STOPMESS==TRUE DO IR_STOPM ( ) INTERRUPT ON 3 BAS (#INITMOV,0 ) ;ENDFOLD (BASISTECH INI) ;FOLD USER INI ;Make your modifications here ;ENDFOLD (USER INI) ;ENDFOLD (INI) ;FOLD PTP HOME Vel=30 % DEFAULT;%{PE}%R 5.5.31,%MKUKATPBASIS,%CMOVE,%VPTP,%P 1:PTP, 2:HOME, 3:, 5:30, 7:DEFAULT $BWDSTART=FALSE PDAT_ACT=PDEFAULT FDAT_ACT=FHOME BAS(#PTP_PARAMS,30) $H_POS=XHOME PTP XHOME ;ENDFOLD ;FOLD PTP P1 Vel=30 % PDAT1 Tool[0] Base[0];%{PE}%R 5.5.31,%MKUKATPBASIS,%CMOVE,%VPTP,%P 1:PTP, 2:P1, 3:, 5:30, 7:PDAT1 $BWDSTART=FALSE PDAT_ACT=PPDAT1 FDAT_ACT=FP1 BAS(#PTP_PARAMS,30) PTP XP1 ;ENDFOLD ST=$POS_ACT ;Gather robotcoördinates StartPos=ST.z ;Safe location on the Z axis as starting position ToolLenght_2Z=ST.z ;Safe location on Z axis ToolLenght_2X=ST.x ;Safe location on X axis ToolLenght_2Y=ST.y ;Safe location on Y axis INTERRUPT DECL 1 WHEN $IN[1]==TRUE DO moveUP() INTERRUPT DECL 2 when $IN[1]==FALSE DO TOOLM() MOVEZ() ;Start Z axis movement INTERRUPT OFF 1 ;Turn off interrupt INTERRUPT OFF 2 IF $OUT[2] THEN TOOLM() ELSE ENDIF ;RETURN HOME ;FOLD PTP HOME Vel=30 % DEFAULT;%{PE}%R 5.5.31,%MKUKATPBASIS,%CMOVE,%VPTP,%P 1:PTP, 2:HOME, 3:, 5:30, 7:DEFAULT $BWDSTART=FALSE PDAT_ACT=PDEFAULT FDAT_ACT=FHOME BAS(#PTP_PARAMS,30) $H_POS=XHOME PTP XHOME ;ENDFOLD $OUT[1]=FALSE ;Deactivate output 1 END DEF MOVEZ() ;Moving the robot from position 1 to position 2 on the Z axis INTERRUPT ON 1 ;Activate interrupt $out[2]= FALSE ;FOLD LIN P3 Vel=0.5 m/s CPDAT1 Tool[0] Base[0];%{PE}%R 5.5.31,%MKUKATPBASIS,%CMOVE,%VLIN,%P 1:LIN, 2:P3, 3:, 5:0.5, 7:CPDAT1 $BWDSTART=FALSE LDAT_ACT=LCPDAT1 FDAT_ACT=FP3 BAS(#CP_PARAMS,0.5) LIN XP3 ;ENDFOLD WAIT FOR TRUE END DEF moveUP() INTERRUPT OFF 1 BRAKE INTERRUPT ON 2 ;FOLD LIN P6 Vel=0.05 m/s CPDAT1 Tool[0] Base[0];%{PE}%R 5.5.31,%MKUKATPBASIS,%CMOVE,%VLIN,%P 1:LIN, 2:P6, 3:, 5:0.05, 7:CPDAT1 $BWDSTART=FALSE LDAT_ACT=LCPDAT1 FDAT_ACT=FP6 BAS(#CP_PARAMS,0.05) LIN XP6 ;ENDFOLD RESUME END DEF TOOLM() ;Subroutine for toolsetter INTERRUPT OFF 2 BRAKE ;Stop robotarm movement ;MOVE UP Z1=$POS_INT ;Register location on the Z axis at moment of interrupt ToolLenght_1=StartPos-Z1.z ;Calculate distance traveled on the Z axis ToolLenght_2=ToolCorecction-ToolLenght_1 ;Subtract distance traveld on the z axis from work area ToolLenght_1Z=Z1.z ;Safe location on Z axis ToolLenght_1X=Z1.x ;Safe location on X axis ToolLenght_1Y=Z1.y ;Safe location on Y axis $OUT[1]=TRUE ;turn on output 1 ;FOLD WAIT Time=1 sec;%{PE}%R 5.5.31,%MKUKATPBASIS,%CWAIT,%VWAIT,%P 2:1 WAIT SEC 1 ;ENDFOLD RESUME ;Continue program END
WORKING TOOL MEASURE (when pushing the toolsetter/button)Code
Display MoreDEF toolsetter_measure15( ) ;FOLD INI ;FOLD BASISTECH INI GLOBAL INTERRUPT DECL 3 WHEN $STOPMESS==TRUE DO IR_STOPM ( ) INTERRUPT ON 3 BAS (#INITMOV,0 ) ;ENDFOLD (BASISTECH INI) ;FOLD USER INI ;Make your modifications here ;ENDFOLD (USER INI) ;ENDFOLD (INI) ;FOLD PTP HOME Vel=30 % DEFAULT;%{PE}%R 5.5.31,%MKUKATPBASIS,%CMOVE,%VPTP,%P 1:PTP, 2:HOME, 3:, 5:30, 7:DEFAULT $BWDSTART=FALSE PDAT_ACT=PDEFAULT FDAT_ACT=FHOME BAS(#PTP_PARAMS,30) $H_POS=XHOME PTP XHOME ;ENDFOLD ;FOLD PTP P1 Vel=30 % PDAT1 Tool[0] Base[0];%{PE}%R 5.5.31,%MKUKATPBASIS,%CMOVE,%VPTP,%P 1:PTP, 2:P1, 3:, 5:30, 7:PDAT1 $BWDSTART=FALSE PDAT_ACT=PPDAT1 FDAT_ACT=FP1 BAS(#PTP_PARAMS,30) PTP XP1 ;ENDFOLD ST=$POS_ACT ;Gather robotcoördinates StartPos=ST.z ;Safe location on the Z axis as starting position ToolLenght_2Z=ST.z ;Safe location on Z axis ToolLenght_2X=ST.x ;Safe location on X axis ToolLenght_2Y=ST.y ;Safe location on Y axis INTERRUPT DECL 1 WHEN $IN[1]==TRUE DO TOOLM() ;Declare interrupt MOVEZ() ;Start Z axis movement INTERRUPT OFF 1 ;Turn off interrupt ;FOLD PTP HOME Vel=30 % DEFAULT;%{PE}%R 5.5.31,%MKUKATPBASIS,%CMOVE,%VPTP,%P 1:PTP, 2:HOME, 3:, 5:30, 7:DEFAULT $BWDSTART=FALSE PDAT_ACT=PDEFAULT FDAT_ACT=FHOME BAS(#PTP_PARAMS,30) $H_POS=XHOME PTP XHOME ;ENDFOLD $OUT[1]=FALSE ;Deactivate output 1 END DEF MOVEZ() ;Moving the robot from position 1 to position 2 on the Z axis INTERRUPT ON 1 ;Activate interrupt ;FOLD LIN P3 Vel=0.5 m/s CPDAT1 Tool[0] Base[0];%{PE}%R 5.5.31,%MKUKATPBASIS,%CMOVE,%VLIN,%P 1:LIN, 2:P3, 3:, 5:0.5, 7:CPDAT1 $BWDSTART=FALSE LDAT_ACT=LCPDAT1 FDAT_ACT=FP3 BAS(#CP_PARAMS,0.5) LIN XP3 ;ENDFOLD ;FOLD WAIT Time= 0.0 sec;%{PE}%R 8.3.22,%MKUKATPBASIS,%CWAIT,%VWAIT,%P 2:0.0 WAIT SEC 0.0 ;ENDFOLD ;Wait for interrupt END DEF TOOLM() ;Subroutine for toolsetter INTERRUPT OFF 1 ;Deactivate interrupt BRAKE ;Stop robotarm movement Z1=$POS_INT ;Register location on the Z axis at moment of interrupt ToolLenght_1=StartPos-Z1.z ;Calculate distance traveled on the Z axis ToolLenght_2=ToolCorecction-ToolLenght_1 ;Subtract distance traveld on the z axis from work area ToolLenght_1Z=Z1.z ;Safe location on Z axis ToolLenght_1X=Z1.x ;Safe location on X axis ToolLenght_1Y=Z1.y ;Safe location on Y axis $OUT[1]=TRUE ;turn on output 1 ;FOLD WAIT Time=1 sec;%{PE}%R 5.5.31,%MKUKATPBASIS,%CWAIT,%VWAIT,%P 2:1 WAIT SEC 1 ;ENDFOLD RESUME ;Continue program END
Thankyou in advance for your time and effort,
MH
-
I figured out what was wrong I was adressing the wrong adress like you said in the plc. Apperently in the tranfer area adres 0 and it is 2 in the KRC2 when its 2 in need to add and offset byte of 2 in the second offset decleration. Once I found the right adress it was working perfectly without a problem. Now it is possible to send and recieve double word bytes with my input and outpus.
-
I have connected everything with each other in the hardware configuration.
-
Thankyou for your explenation that makes a lot more sense now! Do you know where I have to make these adjustments in TIA portal?
-
Im sorry but I dont really understand your question, I have given the signals the adresses as shown in the picture in TIA portal if that helps anything
-
Hey guys to stay on topic im gonna ask my question here.
I am running into some problems when trying to send valuables from my KR2C robotcontroller to my PLC DataBlock. I got it to work with sending byte's however when i try to send word bytes I dont recieve any signals from my KR2C to my PLC.
I have attached my iosys.ini file down below im using OUTW*=2,0,x1 and then I try to activate the outputs 65 to 80 on my robotcontroller, but when I monitor it on my PLC the values in my DataBlock dont change... Im using a Functionblock to transfer the input signal to my DataBlock with this code: "Word_Test":="ProfiBus".Test_Word; can anyone maby give me some clearification to what im doing wrong? I also tried it with a MoveBlock but that also didnt work. Im using a s1200 siemens PLC.
Kind regards and thankyou in andvance!
MH
Code
Display More;========================================================== ; IOSYS.INI - Configuration file for the IO-System ;========================================================== ; For configuration help go to the end of this file. ;---------------------------------------------------------- ; ATTENTION !!!! Since V5.0 Build13 we have removed the DeviceNet ; driver "dndrv.o". Now you have to use the driver ; "dn2drv.o" and the appropriate syntax (form 2) [CONFIG] VERSION=2.00 [DRIVERS] ;RSI=50,rsiLibInit,rsiLib.o ;CNKE2=21,cnke2CPInit,cnke2drv.o ;DNSC6=20,dnsc6Init,dnsc6drv.o ;DNSC5=19,dnsc5Init,dnsc5drv.o ;DNSC4=18,dnsc4Init,dnsc4drv.o ;DNSC3=17,dnsc3Init,dnsc3drv.o ;CNKE1=16,cnke1CPInit,cnke1drv.o ;INTERBUSPCI=15,ibsCPPciInit,ibpcidrv.o ;DSEIO=14,dseIoInit,dseiodrv.o ;DNSC2=13,dnsc2Init,dnsc2drv.o ;DNSC1=12,dnsc1Init,dnsc1drv.o PBMASL=11,pbmsInit,pfbmsdrv.o ;DEVNET=2,dnInit,dn2drv.o ;INTERBUS=1,ibusInit,ibusdrv.o MFC=0,mfcEntry,mfcdrv.o [RSI] [MFC] INB0=0 ;$IN[1-8] INB1=1 ;$IN[9-16] ;OUTB0=0 ;$OUT[1-8] ;OUTB1=1 ;$OUT[9-16] ;OUTB2=2 ;$OUT[17-24] [INTERBUS] [DEVNET] [PBMASL] ;slave outputs ;OUTB0=3,0,x2 $OUT[1-16] ;OUTB2=4,0,x2 $OUT[17-32] ;OUTB4=4,0,x2 $OUT[33-64] OUTB0=5,0,x1 ;$OUT[81-88] OUTB1=5,1,x1 ;$OUT[89-96] ;INB2=2,0,x1 ;$IN[17-24] ;OUTB2=2,0,x1 ;$OUt[17-24] ;INW3=2,4,x1 ;$IN[25-40] OUTW8=2,0,x1 ;$OUT[65-80] [DNSC1] [DNSC2] [DNSC3] [DNSC4] [DNSC5] [DNSC6] [DSEIO] [INTERBUSPCI] [CNKE1] [CNKE2] [VIO] [O2I] [IOLINKING] [END SECTION] ;========================================================== ;Valid entries have the following formats. ;Arguments in squared brackets are optional. ;If nothing else is mentioned, arguments are decimal. ;Digital Inputs and Outputs: ; ; Form 1: ; {token}{offset}={byte}[,{multip}] ; ; {token} INB (byte), INW (word), INDW (double word) ; OUTB, OUTW, OUTDW ; {offset} byte offset of robot IO System (0..m) ; {byte} byte offset over all peripheral devices (0..m) ; Offset starts with 0 at the first device and ; ends with m at the end of the last device. ; {multip} creats n dataobjects of {token} ; Example: ; OUTW4=2,x3 ; Three words of the periphery, starting at byte 2, ; are mapped to the outputs 33-80. ; ; Form 2: ; {token}{offset}={address},{byte}[,{multip}] ; ; {token} INB, INW, INDW, OUTB, OUTW, OUTDW ; {offset} byte offset of robot IO System ; {address} address of a peripheral device (0..m) ; driver specific information, see descr. below ; {byte} byte offset at this peripheral device (0..m) ; Offset starts with 0 at the every device ; driver specific information, see descr. below ; {multip} creats n dataobjects of {token} ; Example: ; INW4=10,0,x2 ; Two words of the peripheral device with address 10 and ; up from byte 0 are mapped to the inputs 33-80. ;Analog Inputs and Outputs: ; ; Form 1: ; {token}{num}={byte},{res},{type}[,CAL{factor}] ; ; {token} ANIN or ANOUT ; {num} number of the analog channel (1..i) ; {byte} byte offset over all peripheral devices (0..m) ; Offset starts with 0 at the first device and ; ends with m at the end of the last device. ; {res} resolution of the analog value (number of bits) ; {type} type of analog value ; 0 : right justified without sign ; 1 : right justified with sign ; 2 : left justified without sign ; 3 : left justified with sign ; {factor} maximum analog value, decimal without prefix, ; hexadec. with prefix 0x or octal with prefix 0 ; "CAL 0" or no entry sets factor to its maximum ; Example: ; ANIN1=10,12,3 ; The analog input No.1 is used. The byte offset on ; peripheral side is 10, the resolution is 12 bit and the ; type of analog value is 3 (left justified with sign). ; The maximum binary analog value is 2047. ; ; Form 2: ; {token}{num}={address},{byte},{res},{type}[,CAL{factor}] ; ; {token} ANIN or ANOUT ; {num} number of the analog channel (1..i) ; {address} address of a peripheral device (0..m) ; driver specific information, see descr. below ; {byte} byte offset at this peripheral device (0..m) ; Offset starts with 0 at the every device ; driver specific information, see descr. below ; {res} resolution of the analog value (number of bits) ; {type} type of analog value ; 0 : right justified without sign ; 1 : right justified with sign ; 2 : left justified without sign ; 3 : left justified with sign ; {factor} maximum analog value, decimal without prefix, ; hexadec. with prefix 0x or octal with prefix 0 ; "CAL 0" or no entry sets factor to its maximum ; Example: ; ANIN3=30,0,16,2,CAL 0x6C00 ; The analog input No.3 is used. The device address is 30, ; the byte offset at this device is 0, the resolution is ; 16 bit and the type of analog value is 2 (left justified ; without sign). The maximum binary analog value is 27648. ; The CAL-factor is especially required in case of using ; Profibus analog modules. ;particularities: ;[MFC] MFC-IO with KRC1 / CAN-IO-Modul with KRC2 ; Entries in form 1 ; ;[INTERBUS/INTERBUSPCI] Interbus Phoenix Mast./Slave Cu/LWL ; Entries in form 1 ; $IN/OUT[n_1]=(n+1)*8-7 ; $IN/OUT[n_8]=(n+1)*8 ;[DEVNET] DeviceNet on the KUKA MFC ; Entries in form 2 for driver dn2drv.o ; {address}=DeviceNet MACID ;[DNSC1] DeviceNet LPDN scanner channel 1 ; Entries in form 2 ; {address} = DeviceNet slave MACID ; {address} = MACID of CH1 ==> Slave part of LPDN CH1 ; ;[DNSC2] DeviceNet LPDN scanner channel 2 ; Entries in form 2 ; {address} = DeviceNet slave MACID ; {address} = MACID of CH2 ==> Slave part of LPDN CH2 ; ;[DNSC3] DeviceNet LPDN scanner channel 1 ; Entries in form 2 ; {address} = DeviceNet slave MACID ; {address} = MACID of CH1 ==> Slave part of LPDN CH1 ; ;[DNSC4] DeviceNet LPDN scanner channel 2 ; Entries in form 2 ; {address} = DeviceNet slave MACID ; {address} = MACID of CH2 ==> Slave part of LPDN CH2 ; ;[DNSC5] DeviceNet LPDN scanner channel 1 ; Entries in form 2 ; {address} = DeviceNet slave MACID ; {address} = MACID of CH1 ==> Slave part of LPDN CH1 ; ;[DNSC6] DeviceNet LPDN scanner channel 2 ; Entries in form 2 ; {address} = DeviceNet slave MACID ; {address} = MACID of CH2 ==> Slave part of LPDN CH2 ; ;[PBMASL] ProfiBus Siemens Master/Slave CP5614 ; Entries in form 2 ; {address} = Slave DP-address ; {address} = 127 ==> Slave part of CP5614 ; ;[DSEIO] Digital inputs/outputs for KR C3A ; Entries in form 1 ; ;[CNKE1] ControlNet 1784PCIC LP-Elektronik ; Entries in form 2 ; {address} = ConNo ; {byte} = additional offset ; ;[CNKE2] ControlNet 1784PCIC LP-Elektronik ; Entries in form 2 ; {address} = ConNo ; {byte} = additional offset ; ;[VIO] inputs/outputs for Virtual IO driver over TCP/IP ; Entries in form 1 ; ;VIO=30,vioInit,vio_drv.o ; ;[O2I] inputs/outputs for 'output to input for software developers' ; Entries in form 1 ; ;O2I=31,o2iInit,o2i_drv.o ; ;[IOLINKING] Outputs follow inputs ; Special form: ; $OUT[{bitoffset}]=$IN[{bitoffset}] ; ; {bitoffset} Bit(!)offset in the robot I/O-System, ; starting with 1 (1..MAXIO) ; ; Example: $OUT[512]=$IN[401] ; In this case output nr. 512 (bit 8 of byte 63) ; is linked to input nr. 401 (bit 1 of byte 50) ; ; Notes: ; IOLINKING means outputs follow inputs in the robot ; I/O-system (within ipo-cycle), regardless if they ; are mapped to drivers. ; Port ranges cannot be specified, each bit must be ; linked by itself. ; Only a maximum of MAX_IOLINKS can be configured (set ; in progress.ini, if this value is increased, robot ; functionality cannot be guaranteed!). ;---------------------------------------------------------- ; 04/02/02 section [IOLINKING] added
-
-
We have found the problem, a previous programmer had allready used the outputs so they were double declared once the old code was removed it worked as programmed. Still thanks for all your help with this problem!