Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Processor
#1
Hi
When running a program through a post processor, how do I determine the name of the current target within the MoveJ section of the post processor?
I'm using the joints to add a joint command but want to change a parameter based on the name of the target within RDK
Regards
#2
You need to activate an option in RDK.
"Tools"->"Options"->"Program"->"Export target name".

Jeremy
Find useful information about RoboDK and its features by visiting our Online Documentation and by watching tutorials on our Youtube Channel


#3
Hi
Oddly this doesn't work for joint moves where I've used the 'setInstruction' method in the C# API and modified a joint move - I set the desired name correctly and it shows in the tree in RDK.
It appears to output the target name when I use AddTarget and create a MoveJ through the API, but not the setInstruction modification method.

I can see that it outputs the target name ahead of the call to the joint values in %temp% middle file - how do I grab that name in the post processor?

Regards
#4
It should be something like that I think:

Code:
target_name = None
if hasattr(self, '_TargetName'):
  # Check if the setting was enabled in robodk
  if self._TargetName is None:
     pass # This means the target has no name
  else:
     if type(self._TargetName) is list:
         target_name = self._TargetName[position].replace(' ','_')
     else:
         target_name = self._TargetName.replace(' ','_')


I'm not aware of the specific related to this programming method, but this is what I've been told to do in the post where I needed it and it worked, so... XD. 

Jeremy
Find useful information about RoboDK and its features by visiting our Online Documentation and by watching tutorials on our Youtube Channel


#5
So if you modify an instruction through the API using setinstruction, and call it a joint move, passing through a name, it won't name it properly with a property that works for exporting to the PP, it only works through the API if you call AddMoveJ, seems to set the properties correctly.. would be good if this could be fixed...
#6
Could you provide a small example of what works and what doesn't so I can pass that down to our dev team?

You will have a better chance of getting this fixed.

Jeremy
Find useful information about RoboDK and its features by visiting our Online Documentation and by watching tutorials on our Youtube Channel


#7
Hi, in the image, the uncommented code works for the naming of joint names, the commented code appears to name it correctly but it's not passed through to the post processor


Attached Files Thumbnail(s)
   
#8
It is the target name that is passed to the post processor, not the name of the instruction.

If you prefer, we could add the option to export the name of the instruction as well using a similar variable in the program.
  




Users browsing this thread:
1 Guest(s)