Universal Robots Forum

RTDE change output

I want to be able to change the value to a “standard output” (standard_digital_output) and a “tcp output” (tool_digital_output) on the robot trough the rtde interface.
I’ve no problems to to read values like in- output (binary) and analog signals, but I don’t know how to change values. At the rtde-guide I’ve seen this sentence, but I have no clue how to do this by the python-send-method <*Digital and analog output values have to be sent together with mask, otherwise values will be ignored>

Could someone give me a code examples for changing DO (standard and tcp) and analog… Please!

If I want to set the “tool_digital_output nr1” to be “1”, I would like to do the following (not working):

#-> I guess this is the binary number for the output (in this case there are only 2 outputs 0 and 1)
setp.tool_digital_output = 1
#-> I guess this is the value/status for the output ( 0 or 1 )
setp.tool_digital_output_mask = 1

I’ve got an xml-file where I’ve defined the mask and the output as uint8 (key=setp) from the basic example provided by UR (control_loop_configuration.xml)

Never mind, I figured it out myself by using an exponential value… But still I think more code examples for the rtde would help new users like me!

Can you please post here what you actually did to make this work so that others can learn from you? I would like to learn more about how to make that work as well for some projects that I am working on.


1 Like

Just in case anyone still searching for answer like me, this is how I use it,

set standard_digital_output_mask to 2^(digital_output_number) to command that particular digital output.
set standard_digital_output to 0 to set it to LOW or 2^(the number same as above) to set it to HIGH.

so for example I want to set digital_output_3 to HIGH I will do
standard_digital_output_mask = 8
standard_digital_output = 8

set digital_output_3 to LOW I will do
standard_digital_output_mask = 8
standard_digital_output = 0