# Analog Output outside of Script

**URL:** <https://forum.universal-robots.com/t/analog-output-outside-of-script/2188>\
**Category:** URCaps SDK\
**Created:** [June 26, 2018, 4:35pm UTC](https://forum.universal-robots.com/t/analog-output-outside-of-script/2188 "2018-06-26T16:35:18Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon39143414](https://avatars.discourse-cdn.com/v4/letter/a/35a633/32.png) [@anon39143414](https://forum.universal-robots.com/u/anon39143414)\
**Post date:** [June 26, 2018, 4:35pm UTC](https://forum.universal-robots.com/t/analog-output-outside-of-script/2188/1 "2018-06-26T16:35:18Z")

</div>

I would like to be able to set the analog output from the URCAP I am developing before it is actually run in order to configure the tool properly for when the program is run. I can use the digital IO without issue within the cap before running the script, but even though I am not getting any errors setting the analog output does not appear to work. Is the analog output enabled outside of the script?

---

<div class="post-metadata">

**Author:** ![jbm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/jbm/32/614_2.png) [@jbm](https://forum.universal-robots.com/u/jbm)\
**Post date:** [June 27, 2018, 8:21am UTC](https://forum.universal-robots.com/t/analog-output-outside-of-script/2188/2 "2018-06-27T08:21:26Z")

</div>

Analog signals rely heavily on feedback from the controller.  
This means, that they may be difficult to simulate properly.

Ensure that the functionality of the analog IO’s are tested on a physical robot, where the “URControl” process can validate the analog signals from the physical safety control board.

---

<div class="post-metadata">

**Author:** ![anon39143414](https://avatars.discourse-cdn.com/v4/letter/a/35a633/32.png) [@anon39143414](https://forum.universal-robots.com/u/anon39143414)\
**Post date:** [June 27, 2018, 11:13am UTC](https://forum.universal-robots.com/t/analog-output-outside-of-script/2188/3 "2018-06-27T11:13:15Z")

</div>

I am testing on a UR3 Robot. See the below code snippit that I am now reduced to for testing. I know this code executes as the digital IO bit 0 gets set without issue, but I see no change in the analog output.

```auto
private void testGrip(){
		if(digital_out0!=null){
			digital_out0.setValue(true);
			analog_out1.setValue(1.0);
			analog_out0.setValue(1.0);
		}
	}

```

---

<div class="post-metadata">

**Author:** ![jbm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/jbm/32/614_2.png) [@jbm](https://forum.universal-robots.com/u/jbm)\
**Post date:** [June 27, 2018, 11:17am UTC](https://forum.universal-robots.com/t/analog-output-outside-of-script/2188/4 "2018-06-27T11:17:02Z")

</div>

If you go to the I/O tab, can you assure that the analog output is in voltage mode?  
If the dropdown is selected to Current, the value 1.0 is out of range [0.004;0.02] A

---

<div class="post-metadata">

**Author:** ![anon39143414](https://avatars.discourse-cdn.com/v4/letter/a/35a633/32.png) [@anon39143414](https://forum.universal-robots.com/u/anon39143414)\
**Post date:** [June 27, 2018, 11:23am UTC](https://forum.universal-robots.com/t/analog-output-outside-of-script/2188/5 "2018-06-27T11:23:32Z")

</div>

I see, I thought the output was always scaled 0…1 based on this:

> [@Robot Analog Output via RTDE](https://forum.universal-robots.com/t/robot-analog-output-via-rtde/716):
>
> Hi, I want to set one of the analog standard outputs AO0, AO1 via RTDE. The RTDE documentation says about the standard\_analog\_output\_0 the following: Standard analog output 0 (ratio) [0..1] Now, what does ratio mean? I just want to specify the voltage for that port. Does this mean adjusting the value to be between 0 and 1 and 1 being 10 Volt? Additionally: What is the minimum set of variables that need to be set to do this? I suppose standard\_analog\_output\_type being one of them.

But it appears that it is only scaled 0…1 in the script, not outside the script. Changing the scale to be 0.0004…0.02 outside the script allows me to function as desired. Thank you so much for the help!

---

<div class="post-metadata">

**Author:** ![anon39143414](https://avatars.discourse-cdn.com/v4/letter/a/35a633/32.png) [@anon39143414](https://forum.universal-robots.com/u/anon39143414)\
**Post date:** [June 29, 2018, 8:38pm UTC](https://forum.universal-robots.com/t/analog-output-outside-of-script/2188/6 "2018-06-29T20:38:32Z")

</div>

I’m actually still having an issue with this. When I set the analog IO to the lowest end of the range you mentioned above I am not getting 4 ma. The below image is representative of where the IO slider ends up on a real robot and in simulation when I run the code included in the same screenshot.

![analog_issue](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/1X/2fe9357ff34103852f2f5b7c2da6f5db604b1f1f.JPG)
