variable use to move X
Toby
✭
in RobotStudio
So.... Just got back into robots after a couple of years away. I am a machinist by trade with 31 years in the biz... I also have done Parametric programming for 20+ years....
I have a family of parts that start at 10ft long and goes to 44ft long in increments of 0.125. I want to set the program up to where the operator enters the size of the part with a variable/parameter from the main screen. The math would be done with tvariables going into the x position BOLD spots:
my line of thought would be the variable going like this:
I have a family of parts that start at 10ft long and goes to 44ft long in increments of 0.125. I want to set the program up to where the operator enters the size of the part with a variable/parameter from the main screen. The math would be done with tvariables going into the x position BOLD spots:
PROC ColumnTop_Med()
!!1 1/16" Holes!!
!------------------------------------------------------------------------------------------------
VAR robtarget pRightEnd:=[[3444.92,13.06,-8.79],[0.486852,-0.512594,0.514645,0.485143],[-1,-1,0,1],[3855.18,9E+09,9E+09,9E+09,9E+09,9E+09]];
VAR robtarget pColumnCTR:=[[10104.12,-1606.93,856.53],[0.488507,0.509356,0.507896,-0.493922],[0,0,-1,1],[9263.22,9E+09,9E+09,9E+09,9E+09,9E+09]];
!------------------------------------------------------------------------------------------------
!!Cut Off!!
!! Right End - Center Sheet my line of thought would be the variable going like this:
PROC ColumnTop_Med()
!!1 1/16" Holes!!
!------------------------------------------------------------------------------------------------
VAR robtarget pRightEnd:=[[XPOS1,13.06,-8.79],[0.486852,-0.512594,0.514645,0.485143],[-1,-1,0,1],[XPOS2,9E+09,9E+09,9E+09,9E+09,9E+09]];
VAR robtarget pColumnCTR:=[[XPOS3,-1606.93,856.53],[0.488507,0.509356,0.507896,-0.493922],[0,0,-1,1],[XPOS4,9E+09,9E+09,9E+09,9E+09,9E+09]];
!------------------------------------------------------------------------------------------------
!!Cut Off!!
!! Right End - Center Sheet
I have been looking through the books and have not found it so I came here, is this possible? TIA
I have been looking through the books and have not found it so I came here, is this possible? TIA
0
Comments
-
PROC ColumnTop_Med()
PERS num XPOS1:= 100;
PERS robtarget pRightEnd := [[0,0,0], [0,0,0],[0,0,0,0], [9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
pRightEnd.trans.x:=XPOS1;
ENDPROC
You can use something like TPReadNum to read the current x position and enter a new one
0 -
I will give it a try... thank you....0
-
Okay that worked awesome so here is my next question: trans.x is how you change the offset but what is the variable name for current position of X?0
-
Whatever you choose to make it.
VAR num nMyX_Trans;
VAR pos posMyCurrentPos;
posMyCurrentPos:=CPos(\Tool:=MyTool \Wobj:=MyWobj);
nMyX_Trans:=posMyCurrentPos.x;Lee Justice0 -
Sweet!!! thank you!!! one more question? What if I want the Y position?0
-
VAR num nMyY_Trans;
nMyY_Trans:=posMyCurrentPos.y;
0 -
I didnt think it was that easy.... lol... Thank you!!!0
Categories
- All Categories
- 5.5K RobotStudio
- 394 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 249 ScreenMaker
- 2.7K Robot Controller
- 309 IRC5
- 59 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 785 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 4 Job listings