A sensor for conveyor that stops a component, performs task and resumes flow

Forum Forums Visual Components 4.1 Python Programming in VC A sensor for conveyor that stops a component, performs task and resumes flow

This topic contains 0 replies, has 1 voice, and was last updated by Avatar smitemus 2 months, 4 weeks ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #18301
    Avatar
    smitemus
    Participant

    Hey.

    I’m trying to create a Boolean signal sensor that detects a component (an open box in this instance fitted with a Works Process component) when it passes it on a conveyor and stops the component.

    I need the sensor to trigger a ‘pick’ task to place items on the component from a separate Works Process component next to the conveyor. When this task is done, I need the component to start moving on the conveyor again to the next spot and so on.

    My current code:

    comp = getComponent()
    sensor = comp.findBehaviour(“ComponentPathSensor”)

    def OnSignal(signal):
    if signal == sensor.ComponentSignal:
    part = signal.Value
    part.stopMovement()

    I’m getting the component and the behavior of the sensor on the path I’ve named “MainPath” and using OnSignal to stop the component’s movement. I assume I need to expand this code to include my ‘pick’ task.

    Are there more relevant alternatives for connecting boolean signal and component signal to the ComponentPathSensor and does my current code even allow for enabling a task to be performed after stopping the component and the use of ‘startMovement’ to make the component move again?

    0
Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.