Set values to bool signals


I am trying to set the value of a bool signal from a Python Script. I think this has worked fine before but for some reason it wont work now.

If i monitor the signals in the simulation view the one im trying to set does not change, however if i terminate the signal view and then activate it again the value has changed. But the second component that is supposed to be triggered is not.

if i manually change the values everything works just fine.

signal is setup like this (works exactly the same if i do not connect it to the script btw)

script = comp.findBehaviour(“PythonScript”)
PickReady = comp.findBehaviour(“PickSignal”)
PickReady.Connections = [script]

Value is changed like this

PickReady.Value = True

Change happen inside the OnSignal event and the connection is setup in the Main.

i tried making the handler Global but same result. I tried getBehaviour instead of findBehaviour (is there a difference?)

I print out the PickReady object and it is pointing to the same address both inside the Main and OnSignal, i tried printing the values and they are changed as expected inside the Script.

i am running out of ideas, but i’m sure i miss something stupid.

Hi NilsO,

Instead of setting PickReady.Value = True, you should use PickReady.signal(True).

This command triggers the signaling event and should solve your issue.


Thx. Just what i needed :slight_smile: