Custom output of UR script

Hello there, fairly new to visual components.

I’m trying to set a specific force for our end effector that communicates via Modbus thru the robot controller. I need to put a line in the robot program that looks like this:
modbus_set_output_register(“set_f_target”,11)

I can’t figure out how to put a custom output text in a program. Basically a custom script statement. I’m using the UR robot post processor from these forums.

My current workaround was to add a comment and it looks like this:

modbus_set_output_register(“set_f_target”,11)

Then I have to manually go delete the ‘#’ from the post processed code before sending it to the UR robot.

Thanks for the help.
-Joe

The post processor’s logic (Python code) is fully editable, so you could make it output such command from e.g. assign statement, or just to output all comment statements without the leading “#”.