Skip to content

PLCInputTransform

PLCInputTransform is a signal component that receives position and rotation data from external systems as a Unity Pose structure. This signal type is particularly useful for tracking positions from external controllers, robots, or motion systems.

PLCInputTransform automatically reads the transform data (position and rotation) from the GameObject it’s attached to and provides this information to external systems through various interfaces. The component continuously updates its value based on the GameObject’s local transform in FixedUpdate().

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 information

Internal status information for the signal.

  • Type: StatusTransform
  • Use case: Tracks connection status and value changes for interface management
  1. Add PLCInputTransform component to a GameObject whose position you want to monitor
  2. The component automatically reads the GameObject’s local position and rotation
  3. Connect the signal to your interface (S7, OPC-UA, MQTT, etc.)
  4. External systems can now read the 6DOF transform data
// Example of accessing transform data in a custom script
public class RobotController : MonoBehaviour
{
public PLCInputTransform robotPositionSignal;
void Update()
{
if (robotPositionSignal != null)
{
Pose currentPose = robotPositionSignal.Value;
Vector3 position = currentPose.position;
Quaternion rotation = currentPose.rotation;
// Use position and rotation data as needed
Debug.Log($"Robot at: {position}, rotation: {rotation.eulerAngles}");
}
}
}

PLCInputTransform works with all realvirtual interfaces that support transform data:

  • S7 TCP: Sends 28 bytes (7 floats: x,y,z position + x,y,z,w quaternion)
  • OPC-UA: Provides structured data with position and rotation components
  • MQTT: Publishes transform data as binary or JSON format
  • Modbus: Transmits as 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)

Manually sets the transform value.

  • Parameters: value - Unity Pose containing position and rotation
  • Use case: Override automatic transform reading for specific scenarios

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

  • Use case: Force immediate update of transform data

Applies the signal value to the GameObject’s transform.

  • Use case: Apply received transform data to the GameObject

PLCInputTransform automatically updates its value every FixedUpdate() cycle by reading the GameObject’s local transform. This ensures real-time tracking of object movement without manual intervention.

  • PLCOutputTransform - For receiving transform data from 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.