Receiving variables from URScript to Pc via RTDE

Hello everyone,

I managed to connect my windows Pc with my ur3e and now I can read all kinds of data using the following Python script:

What I do is, I read the tcp pose and the timestamp and convert it into csv file, while my robot runs a URscript, where it drives from waypoint to waypoint.
My URScript works perfectly fine, and a local int variable “counter” counts after every loop. Now I want to read the variable the same way I do with the tcp pose and add it into the csv file.

It seams like to achieve my goal I should use the I/O Setup in the installation tab and read the output register, but I’ve only been able to receive 0 and 1 and not my local int variable.

Am I on the right path, or should I try something else.

I would be glad for any kind of help
Best regards,
Jemsey

Hi Jemsey,
I think there is no need to use the I/O Setup in the installation tab.

If from your URscript you write the counter variable in a general purpose output integer register, let’s say register 24:

write_output_integer_register(24, counter)

then you should be able to read it from the RTDE client looking for the rtde output output_int_register_24.

I’ve never used the python client but this is what I do with my client written in C++.
I hope I have correctly understood your question

1 Like

Hi Claudia,
thanks al lot you really helped me out, this is exactly what I needed. It works all perfectly fine now, thanks again.

Best regards,
Jemsey