Signal Output Port Bool Control

I’m trying to sort out a process where I have a component being spray painted, with the spray action toggled by a signal. I’ve been trying to toggle the signal on by a python script in the robot holding the spray gun tool, but I cannot figure out the correct commands to set an output signal to true in a manner that does not crash the simulation when its run - I’ve currently got the bool toggled by a sensor conveyor as a hacky workaround.

My output port on the robot to the paint InSignal port has been 101; with the following code as the toggle:

 

from vcScript import *
from vcHelpers.Robot2 import *

def OnRun():
robot = getRobot()
print robot.SignalMapOut.getAllConnectedPorts()
print robot.SignalMapOut.getConnectedExternalSignals(101)
robot.SignalMapOut.setPortSignal(101,True)

 

Crude, but I had hoped effective. Can anyone tell me where I’m going wrong or where I can find an example in the Academy or documentation?

 

Yep, that is a known issue. You need to use the input() method to get input signal value and the output() method to set output signal value.