TPWrite current external axis position
Hi All,
I am still new in programming for S4, I need some help here.
How to ask the Robot to read what is the current external axis' (turn table) coordinate in degree. For eg.-180?. (external axis_c)
Then it will write on the teach pendant. E.g The turntable is now at this degree -180?
Thanks.
Comments
-
Something like this should work:
VAR robtarget pTemp;
pTemp := CRobT();
TPWrite "The value is "+ValToStr(pTemp.extax.eax_c);
Russell Drown0 -
Dear Russell,
This is superb. Thanks a million:)
Shalomaz
0 -
Dear Russell,
I need your advise again. My intention is to make sure the turn table is manually turned to about 0? before the starting of process. If the turntable is <-5 and >5, then it will not be able to proceed further. However, I don't know what is the corrent syntax for eax_c. Thanks.
VAR robtarget pTemp;
Setzero:
TPReadFK nEax,"Turn Table at Zero Degree? Turn to zero if not!","No","","","","Yes";
IF nEAX<2 GOTO Setzero;
pTemp := CRobT();
TPWrite "The value is now "+ValToStr(pTemp.extax.eax_c);
IF (pTemp.extax.eax_c)<5 GOTO Setzero;
0 -
Here is a function that should do this:
FUNC bool TestPos()
VAR robtarget pTemp;
VAR num nEax:=1;pTemp := CRobT();
RussD2008-7-15 2:51:37
!check if abs val > 5, if so force the user to move it to zero before proceeding
IF Abs(pTemp.extax.eax_c)>5 THEN
WHILE nEax < 5 DO
TPReadFK nEax,"The turntable is not at zero. Do you want to move it?","No","","","","Yes";
WaitTime 1;
ENDWHILE
pTemp.extax.eax_c:=0;
!Force the user to authorize movement
TPReadFK nEax,"The turntable is about to move, press OK when it is safe to continue.","Cancel","","","","OK";
TEST nEax
CASE 5:
MoveJ pTemp,v100,fine,tool0;
WaitTime InPos, 2;
pTemp := CRobT();
IF Abs(pTemp.extax.eax_c)<5 THEN
TPWrite "The turntable is now at or near zero, returning true";
RETURN TRUE;
ELSE
TPWrit e "The turntable is still not at zero, returning false";
Return FALSE;
ENDIF
DEFAULT:
TPWrite "You have canceled the motion, returning false";
Return FALSE;
ENDTEST
ELSE
!already less than 5 degrees away from zero
TPWrite "The turntable is at or near zero, OK to proceed";
Return TRUE;
ENDIF
ENDFUNCRussell Drown0 -
Thanks again Russ:)
0 -
Hi Russ,
After studying your advise, I have used what you have taught to change my program and it works.
However, now i have a problem. My program is such that:-
If Abs(pTemp.extax.eax_c)>5, it will prompt the operator the current turn table degree, then telling him not safe to proceed. The operator has to manually turn the turntable to be within 5 degrees in order to proceed.
The problem is sometimes, for example, the turn table is registered at 3600 degrees, which is basically (10 revolutions from 0 degrees). Now, the operator has to manually turn the table 10 revolutions to get back to 0 degree before he can proceed!
How am I going to reset the measuring system of the external axis to 0 degrees in this case? Can teach me the correct syntax?
I have seen this syntax "IndReset ROBAX,1RefPos:=pHomeShort;" Is this applicable in my case?
Thanks again.
0 -
I'm not really the expert on motion programming and external axes, maybe someone else can weigh in on this?
Reading the documentation, it sounds like it is possible to what you wish. You need to verify that you have the software option Independent Axes installed to be able to use these instructions.
Russell Drown0
Categories
- All Categories
- 5.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 316 IRC5
- 61 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 800 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings