Cancel
Showing results for 
Search instead for 
Did you mean: 

How to obtain Circ Motion in a Location

Pioneer
Pioneer

I tried to get an information about the motiontype (PTP, LIN or CIRC) of a location.

 

As i understand, these information is stored in the location parameters.

Especially the integer parameter "RRS_MOTION_TYPE" tells me what kind of Type it is

1 is PTP, 2 in LIN.

 

But now i try to get / set a location as Circ.

When ever i set a location as circ in PS and look into the location object, the "RRS_MOTION_TYPE" stays 2.

But 2 is LIN.

 

How can i obtain the information for a CIRC location?

 

private int getMotionType(TxRoboticViaLocationOperation loc)

{

int result = 0;

ArrayList Location_paramList = loc.Parameters; //get all Parameters as an Arraylist

for (int i = 0; i < Location_paramList.Count; i++) //iterate throug the arraylist

{

if (Location_paramList[i].GetType() == typeof(TxRoboticIntParam)) //if param is int

{

try

{

TxRoboticIntParam intParam = Location_paramList[i] as TxRoboticIntParam;

if (intParam.Type == "RRS_MOTION_TYPE")

{

result = intParam.Value; //return motiontype

}

}

catch (Exception e)

{

MessageBox.Show(e.Message);

throw;

}

}

}

return result;

}

 

 

9 REPLIES 9

Re: How to obtain Circ Motion in a Location

Pioneer
Pioneer

i found it out, by my self.

 

PTP is RRS_MOTION_TYPE 1

LIN is RRS_MOTION_TYPE 2

CIRC is RRS_MOTION_TYPE 4

 

i was checking for 3, but this must be something else

Re: How to obtain Circ Motion in a Location

Siemens Phenom Siemens Phenom
Siemens Phenom

Hi,

 

You can easily check this by using the "RoboticParameterViewer" which is downloadable from GTAC.

 

 

paraViewer.jpg

Re: How to obtain Circ Motion in a Location

Siemens Phenom Siemens Phenom
Siemens Phenom

You can also read the olp parameters using that code. This is how you read the parametrs that you see in the Path Editor columns. You need to specify the name of the column and you get a string value for it.

The output of the code bellow is "Motion Type = CIRC" or PTP or LIN

 

public void ShowMotionType()
        {
             TxObjectList selectedObjects = TxApplication.ActiveSelection.GetItems();
             if (selectedObjects.Count == 1)
             {
                 ITxRoboticLocationOperation op = selectedObjects[0] as ITxRoboticLocationOperation;
                 if (op != null)
                 {
                     string paramValue = GetDynamicParameter((op.Collection as ITxRoboticOrderedCompoundOperation).Robot.Controller.Name, "Motion Type", op);
                     MessageBox.Show("Motion Type = " + paramValue);
                 }
             }
        }

        public string GetDynamicParameter(string controllername, string columnName, ITxOperation op)
        {
            string paramValue = string.Empty;

            TxOlpControllerUtilities utils = new TxOlpControllerUtilities();
            ITxOlpRobotControllerParametersHandler paramHandler = (ITxOlpRobotControllerParametersHandler)utils.GetInterfaceImplementationFromController(controllername, typeof(ITxOlpRobotControllerParametersHandler), typeof(TxRobotSimulationControllerAttribute), "ControllerName");
            if (paramHandler != null)
            {
                if (paramHandler.HasComplexRepresentation(columnName, op, TxOlpCommandLayerRepresentation.UI))
                {
                    paramValue = paramHandler.GetComplexRepresentation(columnName, op, TxOlpCommandLayerRepresentation.UI);
                }
            }

            return paramValue;
        }
Highlighted

Re: How to obtain Circ Motion in a Location

Valued Contributor
Valued Contributor

Hy,

 

I need to copy all parameters from one ViaLocation to other (new one). So I´m doing like this. 

 

string[] types = { "RRS_MOTION_TYPE", "KRC_CD", "KRC1_ORI_TYPE", "RRS_OBJECT_FRAME", "RRS_TOOL_FRAME", "RRS_ZONE_NAME", "RRS_CARTESIAN_POSITION_SPEED", "TP_SPEED_TYPE" };

 

foreach(string type in types)
{

TxRoboticParam parameter = StartLocation.GetParameter(type);

if (parameter != null)
{
viaLocation.SetParameter(parameter);
}

}

 

I just checked all parameters at one point like Patrick show in his post, but my problem is, that some other point might have some other parameters. So one idea was to try it with:

 

var parameters =  viaLocation.Parameters; 

 

Here is the problem that I dont get strings which I need to setParameter.

 

Does anyone knows how to get all parameters from ViaLocation?

 

Best regards,

 

Tomaz 

Re: How to obtain Circ Motion in a Location

Pioneer
Pioneer

Hi Tomaz,

 

Depending on your Teachpendant it is possible to store Parameters in the Operation

instead of the location.

This will be indicated by a little "(Path)" in the Path Editor.

 

In this case you need to store the Parameters of the Operation and use it if you don't find it in the Location.

 

You probably know that, but I still wanted to make sure you didn't overlook that.

 

 

Re: How to obtain Circ Motion in a Location

Siemens Legend Siemens Legend
Siemens Legend

Hi,

 

This is the generic way to copy all paramters:

 

foreach (TxRoboticParam param in source.Parameters)
{
       target.SetParameter(param);
}

 

Regards,

Moshe

Re: How to obtain Circ Motion in a Location

Valued Contributor
Valued Contributor

Hi,

 

thank you. I was to much complicating again Smiley Very Happy

 

Tomaz

Re: How to obtain Circ Motion in a Location

Creator
Creator

Hi,

 

is it a real copy or if I changed the param at the source the param at the target will be changed, too?

 

Thanks

Re: How to obtain Circ Motion in a Location

Valued Contributor
Valued Contributor

Hi,

 

no it will not change.