How can components be controlled by robot output signals?

For example:
1. I created a Pipe and added “PhysicsEntity”, “Boolen_1”, “PythonScript” to its “Behaviour”.
2.Add the statement “OUT 8” State = True" to the “Jog Map”.
3.Connecting “Boolean_1” to “OUT 8” in the “Home” screen.
4.I want the statement in “Jog Map” to be executed so that the “Physics Type” in “Pipe” is changed to “#In Physics” via “PythonScript”.

Here is the code from “PythonScript”.
//----------------------------------------------------------------------------------------------------------
from vcScript import *

def OnSignal( signal ):
pass

def OnRun():

comp = getComponent()
Entity = comp.findBehaviour(‘PhysicsEntity’)
Release = comp.findBehaviour(‘Boolean_1’)

if Release .Value == True :
type_=Entity.getProperty(‘Physics Type’)
type_.Value= 0

//-------------------------------------------------------------------------------------------

Code execution stops at “if Get.Value == True :”

Is this due to a lack of other configurations or a problem with the code?

Note that the OnRun method is not called repeatedly during simulation, only once when the simulation starts. So you are only checking the signal value once at the start of the simulation.

You should connect the signal to the Python script behavior and then use the OnSignal method to execute your logic when the signal is triggered.

This tutorial includes relevant info:
https://academy.visualcomponents.com/lessons/use-signals-to-move-a-vehicle/