I am trying to set the analog output port 0 to voltage mode with 5V via RTDE and I seem to not really understand how this is done.
In my RTDE initialization I am asking for access to standard_analog_output_0 and standard_analog_output_type. After initialization I am sending for standard_analog_output_type the UINT8 value corresponding to “0 0 0 0 0 0 0 1” to set the analog_output_0 to voltage mode and for standard_analog_output_0 a 0.5 as a double value to scale the output to 5V in 500Hz.
This does not work. Even the output type stays in current mode (can be seen at the 24V output voltage of that output).
So for this I am having two questions:
- Am I missing or even misunderstanding something? Do I have to use the standard_analog_output_mask?
- Is the analog output truly a DC signal, or is it some kind of 24V PWM?
To my 2nd question I have investigated the analog output when manually set to voltage mode (via Teachpendant) with a suitable oscilloscope and found that it truly is a DC voltage and not any kind of PWM.
But until now I still have not found any solution on how to set the analog outputs directly via RTDE. I am currently using a script file to execute set_standard_analog_out(0, read_input_float_register(33)) and set_analog_outputdomain(0, 1) where I am sending the requested voltage scale into the double register 33.
If anyone knows how to set the analog output to voltage mode directly through the suggested variables, please let me know.
Setting analog through RTDE requires “enabling” it by writing 1 to mask register using the same recipe that is used for setting output voltage.
Digital outputs have corresponding mask register as well.
Example python code: example_analog_write.zip (1.6 KB)
Thanks a lot, it finally works perfectly fine. I didn’t dare to mess with the standard_analog_output_mask variable without knowing what it does in detail.
I would appreciate the variable description in the RTDE guide Real-Time Data Exchange (RTDE) Guide - 22229 getting reworked at some time.
Without doubt it is very important to understand how to use a variable, but some explanation of how they interact with each other, what they do in detail and what the limits are would be also very helpful.