Stop a conveyor

hi.
I am trying to stop a conveyor with a python script.
from the help
path = comp.findBehaviour(“MyPathWayBehaviour”)

set path behavior ON

path.Enabled = True
however, this behaviour no longer seems to exist.
I have tried
conveyor_off_signal = comp.findBehaviour(“PowerOnSignal”)
conveyor_off_signal.Value == False
but the conveyor continues to move.
what is a simple way to stop the conveyor and send a signal to another component to say it is stopped

Hi CalvinCarson1,

Both methods that you described should be valid options for controllnig a conveyor. If you need to signal other components that the conveyor is stopped, then I suggest using the signaling method and connecting the powerOnSignal to the external component. Here is an example script that you can use as a reference.

from vcScript import *

comp = getComponent()

path = comp.findBehaviour('Path__HIDE__')
power_signal = comp.findBehaviour('PowerOnSignal')

def OnRun():
  while True:
    delay(5)
    path.Enabled = False
    delay(5)
    power_signal.signal(True)
    delay(5)
    power_signal.signal(False)
    delay(5)
    power_signal.signal(True)

br,
Este

3 Likes

Setting the Value property of a signal behaviour does not trigger the signal. You need to use:

conveyor_off_signal.signal(False)

1 Like