Skip to content

Get Standard Analog Input

SUMMARY

Get Standard Analog Input returns the current value of a standard analog input channel on the robot controller. The two standard analog inputs (index 0 and 1) can be configured for current (0–20 mA) or voltage (0–10 V) mode in the PolyScope interface.

SUPPORTED ROBOTS

This skill is currently supported on Universal Robots only. Calling this method on other robot brands will raise a NotImplementedError.

The Skill

python
value = robot.get_standard_analog_input(index=0)

The Code

Example: Read Both Standard Analog Inputs

Connect to the robot, read both standard analog inputs, and log the values.

python
from loguru import logger
from telekinesis.synapse.robots.manipulators import universal_robots

robot_ip = "192.168.1.2"  # replace with your robot's IP

robot = universal_robots.UniversalRobotsUR10E()
# Connect
robot.connect(ip=robot_ip)

v0 = robot.get_standard_analog_input(0)
logger.info(f"Standard analog input 0: {v0:.4f} V/A")

v1 = robot.get_standard_analog_input(1)
logger.info(f"Standard analog input 1: {v1:.4f} V/A")

# Disconnect
robot.disconnect()

The Explanation of the Code

get_standard_analog_input reads the value of the specified standard analog input channel. The returned value is in the unit configured on the controller — either amperes [A] for current-mode or volts [V] for voltage-mode inputs. Index 0 maps to analog input 0 (AI0), and index 1 maps to analog input 1 (AI1).

How to Tune the Parameters

ParameterTypeDefaultDescription
indexintAnalog input index: 0 for AI0, 1 for AI1.

Return Value

TypeDescription
floatAnalog input value [A or V], depending on the input mode configured on the controller.

Where to Use the Skill

  • Sensor reading — Read analog sensors (pressure, temperature, force) connected to the controller's analog inputs
  • Feedback monitoring — Sample continuous process signals during robot operation

When Not to Use the Skill

Do not use Get Standard Analog Input when: