cancel
Showing results for 
Search instead for 
Did you mean: 

accessing first and last name of Location in an Operation via custom XML

Creator
Creator

Hi,

 

is it possible to get access to the first and last Location name inside a Operation? independent of number of locations used in this Operation. (1 ... XXX)

If this is possible, I could make a OLP Command on the Operation which displays a comment before the first location.

e.g:

 

PROC MOV_mvHome_Table100()
     !From: pHome
     !To : pTable100
     IF OpMode()<>OP_AUTO MoveJ pHome, v2500, z200, tGripper;
     MoveJ pHome,v2500,z200,tGripper;
MoveJ pHome_Table_1,v2500,z200,tGripper;
MoveJ pHome_Table_2,v2500,z200,tGripper;
MoveJ pHome_Table_3,v2500,z200,tGripper;
...
MoveJ pHome_Table_XXX,v2500,z200,tGripper;
MoveJ pTable100,v2500,z200,tGripper;
     !actual robot position:
     stActPos:="ppTable100";
RETURN;
ENDPROC

 

When I use <Item Type="dynamicParameter">Loc Name</Item>, and add the OLP command to the first Location, I only get the first Name. Also the Location is before the comments and the IF...

PROC MOV_mvHome_Table100()
MoveJ pHome,v2500,z200,tGripper;
!From: pHome
!To : pTable100
IF OpMode()<>OP_AUTO MoveJ pHome, v2500, z200, tGripper;
MoveJ pHome_Table_1,v2500,z200,tGripper;
MoveJ pHome_Table_2,v2500,z200,tGripper;
MoveJ pHome_Table_3,v2500,z200,tGripper;
...
MoveJ pHome_Table_XXX,v2500,z200,tGripper;
MoveJ pTable100,v2500,z200,tGripper;
   !actual robot position:
   stActPos:="ppTable100";
RETURN;
ENDPROC

 

Loc+1 Name (Loc+2 Name, ...) doesn't help because I have different numbers of Locations inside the Operation.

 

thanks in advance.

kind regards,

nafets1

 

 

1 REPLY

Re: accessing first and last name of Location in an Operation via custom XML

Genius
Genius

Hello nasfets1

 

This one is quite challenging to be done with current xml capabilities (I'm using PS 13.0.2).

 

The solution I was thinking is to create 2 robotic parameters in the operation object ('firstLoc' and 'lastLoc') and them have a path template action that would apply an OLP command based on those two parameters in the operation level.

 

I can't find a solution for this because I'm not being able to apply parameters from a location in an operation. Using "ApplyOn" and "CopyFrom" flags the copied values only works between neighbor locations. So, the information will not exist in the operation object. 

 

The workaround for not having a dynamicParam that gets the last location would be to consider a maximum operation size and them try to get the information for each location (so the last valid value would be the last one) using Apply Path Template. If you retrieve the values from 1 to 100 (using CopyFrom="+1" to CopyFrom="+100" at the first location), but your op has only 30 locations, the last valid value would be from last location. This is not the best solution, but it may work. Although, you would need to apply the OLP command at the first location, and not in the operation, which is not exactly what you're aiming to do.

 

Example of the path template action (here I'm copying the same param, but you can use CopyParamName attribute to copy a specific value from one param to another param):

 

<Action Name="test" Description="test" LocRange="First" >
	<Param Name="NC_LOC_COMMENT" CopyFrom="+1"/>
	<Param Name="NC_LOC_COMMENT" CopyFrom="+2"/>
	<Param Name="NC_LOC_COMMENT" CopyFrom="+3"/>
	<Param Name="NC_LOC_COMMENT" CopyFrom="+4"/>
	<Param Name="NC_LOC_COMMENT" CopyFrom="+5"/>
	<Param Name="NC_LOC_COMMENT" CopyFrom="+6"/>
	<Param Name="NC_LOC_COMMENT" CopyFrom="+7"/>
	<Param Name="NC_LOC_COMMENT" CopyFrom="+8"/>
	<Param Name="NC_LOC_COMMENT" CopyFrom="+9"/>
	<Param Name="NC_LOC_COMMENT" CopyFrom="+10"/>
	<Param Name="NC_LOC_COMMENT" CopyFrom="+11"/>
	<Param Name="NC_LOC_COMMENT" CopyFrom="+12"/>
</Action>

 

The best solution, in my opinion, would be to have a specific API doing that instead of XMLs, but you can also request SIEMENS to enhance XMLs and be able to met your needs.  Let's see if someone else can find a better solution for you!