# Analog Output with set\_io service

**URL:** <https://forum.universal-robots.com/t/analog-output-with-set-io-service/12328>\
**Category:** ROS\
**Created:** [February 15, 2021, 6:03am UTC](https://forum.universal-robots.com/t/analog-output-with-set-io-service/12328 "2021-02-15T06:03:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon7461531](https://avatars.discourse-cdn.com/v4/letter/a/e47c2d/32.png) [@anon7461531](https://forum.universal-robots.com/u/anon7461531)\
**Post date:** [February 15, 2021, 6:03am UTC](https://forum.universal-robots.com/t/analog-output-with-set-io-service/12328/1 "2021-02-15T06:03:19Z")

</div>

Hi there,

I’m trying to set an analog output with the set\_io service.

I have tried the ur\_driver.io\_interface with the function

`set_analog_out(0, 1.0)`

or using the service directly:

`setIOService(SetIORequest.FUN_SET_ANALOG_OUT, 0, 1.0)`

The problem is the this seems to control only the current going out from the analog pin and keeping the voltage constant at 24V. Instead, what I need to do is to set 1V to the pin AO0.

I can see and change in the teach pendant the value in volts, but whenever I send the command from ROS, it defaults back to current.

Any idea how to change the setting to Volts?

Regards,  
Germán

---

<div class="post-metadata">

**Author:** ![mauch](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@mauch](https://forum.universal-robots.com/u/mauch)\
**Post date:** [February 15, 2021, 10:39am UTC](https://forum.universal-robots.com/t/analog-output-with-set-io-service/12328/2 "2021-02-15T10:39:22Z")

</div>

Please note that the `ur_driver` [has been deprecated](http://wiki.ros.org/ur_driver).

However, the problem you describe still exists with the current [`ur_robot_driver`](https://github.com/UniversalRobots/Universal_Robots_ROS_Driver) as this is basically directly following the [`setIO.service`](https://github.com/ros-industrial/ur_msgs/blob/melodic-devel/srv/SetIO.srv) definition, so it would have to be updated there first so that the driver can follow this change.

As a workaround, you can send UrScript snippets to the driver directly using the driver’s [`script_command`](https://github.com/UniversalRobots/Universal_Robots_ROS_Driver/blob/master/ur_robot_driver/doc/ROS_INTERFACE.md#script_command-std_msgsstring) topic directly.

**Edit** : I’ve created an issue to discuss this upstream: [Analog output domain in setIO service · Issue #11 · ros-industrial/ur\_msgs · GitHub](https://github.com/ros-industrial/ur_msgs/issues/11)

---

<div class="post-metadata">

**Author:** ![mali93](https://avatars.discourse-cdn.com/v4/letter/m/aeb1de/32.png) [@mali93](https://forum.universal-robots.com/u/mali93)\
**Post date:** [March 3, 2022, 8:22pm UTC](https://forum.universal-robots.com/t/analog-output-with-set-io-service/12328/3 "2022-03-03T20:22:43Z")

</div>

Hi,

I am faced with the same problem, I am trying to control a pneumatic gripper, and I need two Analog Outputs. The first AO is for position and the second AO is for gripper strength. These control signals are between 0-24 Volts.

@anon7461531 have you found any solution? I am thinking one potential solution is to buy a current to volt converter, but I don’t want to resort to external circuitry. A similar solution would be to buy an external DAC, and get the digital signals off of the UR"s Digital output pins.

@mauch Would you please expand on “script\_command” workaround? The only thing I have on the robot is “external control” running in a loop since I do everything in ROS. Would you perhaps give example commands for staying connected to Robot\_ip address, while also manipulating AO voltage on the script\_command topic?

Thanks a ton,  
Mohamed
