Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »



Overview

The Linear Encoder is a component that simulates a physical encoder.

It consists of two components; Physical and Logic. Both are needed to control the motor through a logic adapter (connecting the Linear Encoder to an external controller through a Logic Simulator). Adding a Control Panel gives you the option to control the encoder from the Unity scene.


Where to find

The Linear Encoder can be found under Standard Components > Linear Encoder

It will automatically be attached to a selected GameObject. Otherwise it will create a new GameObject to attach to.

A Prismatic Joint will be created automatically as part of the component.


Feature overview - Physical Component

Live Data

Value

Current value of the Linear Encoder

Important: The LinearEncoder only functions in play mode and thus only shows data in play mode.

Properties

Prismatic Joint

Assign the Prismatic Joint you wish to use for the Linear Encoder.

Cycle Value

The value difference between its zero position and max position.

Base Value

The minimum value at zero position.

Enable Rounding

Enables rounding the output to certain intervals.

Rounding Interval

The interval rounding will occur to.

Cap Value

Enables the use of a minimum and maximum value.

Minimum Value

The minimum value of the output value

Maximum Value

The maximum value of the output value

On Value Changed ()

UnityEvent that is fired as soon as the output value changes.

In the Control Panel tab you can generate a Control Panel for the Linear Encoder.


How to use - Physical Component

  1. Create a Linear Encoder and setup its Prismatic Joint.

  2. Add a Kinematics Controller, this can be found under Mechanics > Add Kinematics > Kinematics Controller to a seperate GameObject.

  3. Make sure the Linear Encoder is parented under the Kinematic Controller in the Hierarchy.

  4. Set the desired settings for the Linear Encoder.

  5. Enter PlayMode and test whether the Linear Encoder works.


Feature overview - Logic Component

Properties

Linear Encoder

Select a Linear Encoder Component to connect to the PLC

PLC I/O

Property

Input and Outpur from connected PLC

Value

The corresponding value from the connected PLC

PLC Settings & Debugging

These settings are general Logic Component settings. Look at the Logic Component Documentation for more details.


How to use - Logic Component

Look at the Logic Component Documentation (add link) for an example of how to connect a Linear Encoder to an external controller.

  • No labels