Skip to content

LogicStopDriveOnSensor

The LogicStopDriveOnSensor component automatically controls a drive based on sensor occupancy state, implementing a common conveyor control pattern where material flow stops when an object is detected and resumes when the path is clear. This component is essential for preventing collisions and managing material flow in automated production lines.

The component monitors a sensor continuously and stops the associated drive when the sensor becomes occupied, then automatically restarts the drive when the sensor clears or when an external restart signal is received.

[Screenshot: LogicStopDriveOnSensor component in Inspector showing drive and sensor assignments]

Drive (Drive) The drive component to control based on sensor state. When the sensor becomes occupied, this drive will be stopped by setting its JogForward property to false. When the sensor clears, the drive automatically resumes forward movement.

Sensor (Sensor) The sensor component that triggers drive control actions. The component monitors this sensor’s Occupied property to determine when to stop and start the drive. Use proximity sensors, photoelectric sensors, or any realvirtual sensor type.

ConveyorStopped (PLCInputBool) Optional PLC input signal that reports the conveyor stop status to external systems. When the sensor becomes occupied and the drive stops, this signal is set to true, allowing external PLCs or control systems to monitor the conveyor state.

Restart (PLCOutputBool) Optional PLC output signal that provides external restart control. When this signal becomes true, the drive resumes operation regardless of sensor state, useful for manual override or external control logic integration.

  1. Setup Components: Add LogicStopDriveOnSensor to an empty GameObject in your scene
  2. Assign Drive: Drag the conveyor drive from the Hierarchy to the Drive field
  3. Assign Sensor: Drag the sensor that should trigger the stop action to the Sensor field
  4. Test Operation: Run the scene and observe drive stopping when objects trigger the sensor
  1. Configure Stop Signal: Assign a PLCInputBool to ConveyorStopped for external system feedback
  2. Setup Restart Control: Assign a PLCOutputBool to Restart for external restart capability
  3. Interface Connection: Connect these signals to your PLC interface (OPC-UA, S7, etc.)
  4. Verify Communication: Test signal exchange with your external control system
  1. Multiple Sensors: Use multiple LogicStopDriveOnSensor components for different conveyor sections
  2. Cascading Control: Connect restart signals between components for coordinated material flow
  3. Status Monitoring: Use ConveyorStopped signals to create a production line status dashboard
  4. Emergency Stops: Integrate with safety systems through external restart control
  • Drive stops immediately when sensor transitions from unoccupied to occupied
  • Stop action occurs on the first frame the sensor becomes occupied
  • Drive JogForward property is set to false to stop forward movement
  • Drive automatically restarts when sensor transitions from occupied to unoccupied
  • External restart signal (if connected) can override sensor state to force restart
  • Drive JogForward property is set to true to resume forward movement
  • ConveyorStopped signal updates in the same frame as drive stop/start actions
  • All signal updates occur in FixedUpdate for consistent timing with physics simulation
  • Component optimizes performance by caching null checks during initialization
  • Works with all realvirtual Drive types (linear drives, rotation drives, transport surfaces)
  • Requires drives configured for JogForward operation mode
  • Compatible with drive behaviors and advanced drive features
  • Compatible with all realvirtual sensor types (proximity, photoelectric, etc.)
  • Requires sensors with proper Occupied property implementation
  • Works with both normally open and normally closed sensor configurations
  • Optimized for real-time operation with minimal processing overhead
  • Uses cached component references to avoid expensive GetComponent calls
  • FixedUpdate timing ensures consistent behavior with physics simulation
  • Verify Drive reference is assigned and drive is active
  • Check that sensor Occupied property changes correctly
  • Ensure drive is configured for JogForward operation
  • Verify PLCInputBool and PLCOutputBool references are correctly assigned
  • Check interface connection status and configuration
  • Test signal values in realvirtual Runtime Inspector
  • Component uses FixedUpdate for consistent timing with physics
  • Adjust Unity Fixed Timestep if timing precision is critical
  • Consider sensor detection distance and object movement speed

© 2025 realvirtual GmbH https://realvirtual.io - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher.