lamb button..?/o unit
mymach
✭
in RobotStudio
Hi everyone...
I have ten lamb button with input output....
1. button X+ 6.button is X-
2.button Y+ 7.button Y-
3.button Z+ 8. button Z- and
4.button 50 mm
5.button 100mm
9.button 200mm
10. button is start button
? have to make a program with this buttons
when ? press 1.,4. and 10. button robot must move 50 mm X+
when ? press 7. 9. 10. robot must move 200 mm direction of Y-.......like offset...how can ? make this.....?
? need your helps ....thanks
I have ten lamb button with input output....
1. button X+ 6.button is X-
2.button Y+ 7.button Y-
3.button Z+ 8. button Z- and
4.button 50 mm
5.button 100mm
9.button 200mm
10. button is start button
? have to make a program with this buttons
when ? press 1.,4. and 10. button robot must move 50 mm X+
when ? press 7. 9. 10. robot must move 200 mm direction of Y-.......like offset...how can ? make this.....?
? need your helps ....thanks
0
Comments
-
HiTry this.Best regardsMarcelMODULE Module1! data! ValueVAR num nValueX;VAR num nValueY;VAR num nValueZ;! DistanceVAR num nDistance;! actual positionPERS robtarget pActual:=[[0,0,0],[1,0,0,0],[0,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];! toolPERS tooldata tEndEffector:=[TRUE,[[0,0,0],[1,0,0,0]],[30,[0,0,0],[1,0,0,0],10,10,10]];PROC main()! main program flow! initialisationSetDO doStart,0;SetDO doDist050,0;SetDO doDist100,0;SetDO doDist200,0;SetDO doPlusX,0;SetDO doMinusX,0;SetDO doPlusY,0;SetDO doMinusY,0;SetDO doPlusZ,0;SetDO doMinusZ,0;nValueX:=0;nValueY:=0;nValueZ:=0;nDistance:=0;! wait for startWaitDI diStart,1;SetDO doStart,1;! read actual positionpActual:=CRobT(Tool:=tEndEffectorWObj:=wobj0);! read buttonsIF diButtonDist050=1 THENSetDO doDist050,1;nDistance:=50;ELSEIF diButtonDist100=1 THENSetDO doDist100,1;nDistance:=100;ELSEIF diButtonDist200=1 THENSetDO doDist200,1;nDistance:=200;ENDIFIF diButtonPlusX=1 THENSetDO doPlusX,1;nValueX:=nDistance;ELSEIF diButtonMinusX=1 THENSetDO doMinusX,1;nValueX:=-nDistance;ELSEIF diButtonPlusY=1 THENSetDO doPlusY,1;nValueY:=nDistance;ELSEIF diButtonMinusY=1 THENSetDO doMinusY,1;nValueY:=-nDistance;ELSEIF diButtonPlusZ=1 THENSetDO doPlusZ,1;nValueZ:=nDistance;ELSEIF diButtonMinusZ=1 THENSetDO doMinusZ,1;nValueZ:=-nDistance;ENDIF! move to positionIF nValueX<>0 OR nValueY<>0 OR nValueZ<>0 THENMoveL Offs(pActual,nValueX,nValueY,nValueZ),v300,fine,tEndEffector;ENDIF! wait for releas of start buttonWaitDI diStart,0;ENDPROCENDMODULE0
-
I really appreciated for your helps....thanks so much
0 -
I made this thanks for your helps
MODULE MainModule
VAR num VALX:=0;
VAR num VALY:=0;
VAR num VALZ:=0;
VAR num DIST:=0;
VAR bool TEKHIZ:=FALSE;
VAR bool TEKX:=FALSE;
VAR bool TEKY:=FALSE;
VAR bool TEKZ:=FALSE;
CONST robtarget p10:=[[832.51,-0.02,1130.19],[0.258803,1.62466E-05,0.96593,-4.18923E-07],[-1,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
PROC main()
!***************************************************
Init:
WHILE TRUE DO
!==============
LampChk;
!==============
IF BUTONSTART=1 THEN
MOVECHK;
IF TEKHIZ AND (TEKX OR TEKY OR TEKZ ) OYNA;
ENDIF
ENDIF
ENDWHILE
!********************************************************
ENDPROC
!********************************************************
!********************************************************
PROC OYNA()
VALX:=0;
VALY:=0;
VALZ:=0;
!======
IF (Buton50=1 AND Buton100=0 AND Buton200=0) DIST:=50;
IF (Buton50=0 AND Buton100=1 AND Buton200=0) DIST:=100;
IF (Buton50=0 AND Buton100=0 AND Buton200=1) DIST:=200;
!======
IF (ButonXP=1 AND ButonXM=0) VALX:=DIST;
IF (ButonXP=0 AND ButonXM=1) VALX:=-DIST;
!======
IF (ButonYP=1 AND ButonYM=0) VALY:=DIST;
IF (ButonYP=0 AND ButonYM=1) VALY:=-DIST;
!======
IF (ButonZP=1 AND ButonZM=0) VALZ:=DIST;
IF (ButonZP=0 AND ButonZM=1) VALZ:=-DIST;
!===============================================
p10:=CRobT();
MoveL Offs(p10,VALX,VALY,VALZ),v100,z0,tool0;
ENDPROC
!********************************************************
!********************************************************
PROC MOVECHK()
IF ((Buton50=1 AND Buton100=0 AND Buton200=0) OR (Buton50=0 AND Buton100=1 AND Buton200=0) OR (Buton50=0 AND Buton100=0 AND Buton200=1))
THEN TEKHIZ:=TRUE;
ELSE TEKHIZ:=FALSE;
ENDIF
!=========================
IF (ButonXP=1 AND ButonXM=0) OR (ButonXP=0 AND ButonXM=1)
THEN TEKX:=TRUE
ELSE TEKX:=FALSE
ENDIF
!=========================
IF (ButonYP=1 AND ButonYM=0) OR (ButonYP=0 AND ButonYM=1)
THEN TEKY:=TRUE
ELSE TEKY:=FALSE
ENDIF
!=========================
IF (ButonZP=1 AND ButonZM=0) OR (ButonZP=0 AND ButonZM=1)
THEN TEKZ:=TRUE
ELSE TEKZ:=FALSE
ENDIF
!=========================
ENDPROC
!********************************************************
!********************************************************
!********************************************************
!********************************************************
PROC LampChk()
IF ButonXP = 1 THEN
Set LambaXP;
ELSE
Reset LambaXP;
ENDIF
!========================
IF ButonXM = 1 THEN
Set LambaXM;
ELSE
Reset LambaXM;
ENDIF
!========================
IF ButonYP = 1 THEN
Set LambaYP;
ELSE
Reset LambaYP;
ENDIF
!========================
IF ButonYM = 1 THEN
Set LambaYM;
ELSE
Reset LambaYM;
ENDIF
!========================
IF ButonZP = 1 THEN
Set LambaZP;
ELSE
Reset LambaZP;
ENDIF
!========================
IF ButonZM = 1 THEN
Set LambaZM;
ELSE
Reset LambaZM;
ENDIF
!========================
IF Buton50 = 1 THEN
Set Lamba50;
ELSE
Reset Lamba50;
ENDIF
!========================
IF Buton100 = 1 THEN
Set Lamba100;
ELSE
Reset Lamba100;
ENDIF
!========================
IF Buton200 = 1 THEN
Set Lamba200;
ELSE
Reset Lamba200;
ENDIF
!========================
ENDPROC
PROC Init()
ENDPROC
ENDMODULE
0
Categories
- All Categories
- 5.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 249 ScreenMaker
- 2.7K Robot Controller
- 310 IRC5
- 59 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 786 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings