Skip to content

PLCOutputTransform

PLCOutputTransform is a signal component that receives position and rotation data from external systems and applies it to Unity GameObjects. This signal type is essential for controlling object positions from external controllers, robots, or motion planning systems.

PLCOutputTransform receives transform data from external interfaces and automatically applies position and rotation changes to the GameObject it’s attached to. The component handles both receiving data from external systems and applying it to the Unity transform in real-time.

The current transform data as a Unity Pose structure.

  • Type: Pose (Vector3 position + Quaternion rotation)
  • Default: Transform position and rotation at initialization
  • Use case: Contains both position (x, y, z coordinates) and rotation (quaternion) data for complete 6DOF control

Internal status information for the signal.

  • Type: StatusTransform
  • Use case: Tracks connection status and value changes for interface management
  1. Add PLCOutputTransform component to a GameObject you want to control externally
  2. Connect the signal to your interface (S7, OPC-UA, MQTT, etc.)
  3. External systems can now send position and rotation commands
  4. The GameObject automatically moves to received positions
// Example of controlling transform from a custom script
public class RobotTargetController : MonoBehaviour
{
public PLCOutputTransform robotTargetSignal;
void SetRobotTarget(Vector3 position, Quaternion rotation)
{
if (robotTargetSignal != null)
{
Pose targetPose = new Pose(position, rotation);
robotTargetSignal.SetValue(targetPose);
}
}
void MoveToPosition(float x, float y, float z)
{
Vector3 targetPos = new Vector3(x, y, z);
Quaternion currentRot = transform.rotation;
SetRobotTarget(targetPos, currentRot);
}
}

PLCOutputTransform works with all realvirtual interfaces that support transform data:

  • S7 TCP: Receives 28 bytes (7 floats: x,y,z position + x,y,z,w quaternion)
  • OPC-UA: Subscribes to structured data with position and rotation components
  • MQTT: Receives transform data as binary or JSON format
  • Modbus: Reads from float register arrays

The transform data is internally stored as:

  • Position: Vector3 (x, y, z coordinates in millimeters)
  • Rotation: Quaternion (x, y, z, w components for orientation)
  • Byte Size: 28 bytes total (7 × 4-byte floats)

Sets the transform value and triggers GameObject movement.

  • Parameters: value - Unity Pose containing position and rotation
  • Use case: Programmatically control object position and rotation

Sets the transform value from byte array received from interface.

  • Parameters: value - 28-byte array containing position and rotation data
  • Use case: Internal method used by interfaces to update transform

Applies the current signal value to the GameObject’s transform.

  • Use case: Force immediate application of received transform data

Updates the signal value from the GameObject’s current transform.

  • Use case: Synchronize signal value with current GameObject position

PLCOutputTransform automatically applies received transform data to the GameObject in FixedUpdate() when new values are received. This ensures smooth, real-time positioning without manual intervention.

The component applies transform changes directly without interpolation. For smooth motion between positions, consider:

  • Using intermediate waypoints from your external controller
  • Implementing motion planning in your PLC or external system
  • Adding animation components for interpolated movement

PLCOutputTransform uses Unity’s local coordinate system:

  • Position: Local position relative to parent GameObject
  • Rotation: Local rotation relative to parent GameObject
  • Units: Position values are typically in millimeters (realvirtual standard)
  • PLCInputTransform - For sending transform data to external systems
  • Interfaces - Overview of all signal types and interface concepts
  • S7 TCP - Siemens S7 interface supporting transform data
  • OPC-UA - Industrial communication protocol with structured data support

© 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.