Software version: …
3.9.1.64192
Robot generation: …
Simulator and UR10
Steps to reproduce:
Using the IO Handler and the ScriptCommander from one of the UR examples.
Snips of the code:
ScriptCommand setVoltageAndReadCurrent = new ScriptCommand("Set_Voltage24_And_Read_Current");
setVoltageAndReadCurrent.appendLine("set_tool_analog_input_domain(0,0)");
setVoltageAndReadCurrent.appendLine("set_tool_voltage(24)");
sendScript.sendScriptCommand(setVoltageAndReadCurrent);
toolAnalogIn0 = ioHandler.getAnalogIO("analog_in[2]");
double current = toolAnalogIn0.getValue();
System.out.println("Tool Analog Value: " + toolAnalogIn0.getValue() + ", Is Current: " + toolAnalogIn0.isCurrent());
if (toolAnalogIn0.isCurrent())
{
JOptionPane.showMessageDialog(null, "Read current as." + current
, "Reading current", JOptionPane.INFORMATION_MESSAGE);
return current;
} else
{
JOptionPane.showMessageDialog(null,
"An error occured while reading the current of the PointZero Tool.\n"
+ "Could not set "+toolAnalogIn0.getName()+" to \"current\"", "Error on reading current", JOptionPane.WARNING_MESSAGE);
return current;
}
Expected behavior:
On the robot with a tool connected.
It runs, changes the IO to Current and sets the voltage to 24.
I would expect the printout "Tool Analog Value: 0.0058630630...., Is Current:
true
and then continue to the Information message
Actual behavior:
It runs, changes the IO to Current and sets the voltage to 24, as should.
What I get is: "Tool Analog Value: 0.0058630630...., Is Current:
false and then it continues to the Error message, even though the value is correct.