> For the complete documentation index, see [llms.txt](https://doc.realvirtual.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.realvirtual.io/components-and-scripts/motion/drive-behavior.md).

# Drive behavior

The Drive Behavior provides a detailed behavior to a [Drive](/components-and-scripts/motion/drive.md). This gives the flexibility to model all variety of ways to move objects. In realvirtual.io a few standard Drive Behaviors are included and you can extend them based on the components you are using in real life.\
Here is a list of the included Drive Behaviors. All Drive Behaviors are named with a prefix *Drive\_* from better clarification.

{% hint style="info" %}
The generic drive behaviors (Cylinder, Simple, Destination Motor, Follow Position, Gear, Continuous Destination, Speed, …) are part of every realvirtual edition. The detailed drive-profile / fieldbus behavior models that mirror the exact control-word / status-word interface of a real drive - PROFIdrive (Speed / Pos), CiA 402, Festo FHPP, SEW MOVILINK, UniDrive and the proportional valve - are part of realvirtual **Professional**.
{% endhint %}

## Adding Drive Behaviors

Drive behaviors can be added to a GameObject with a Drive component in two ways:

1. **Add Component Menu**: Select the GameObject with the Drive component, then use *Component > realvirtual > Motion > Drive Behaviors* to choose the desired behavior
2. **QuickEdit Overlay** (Professional): Use the QuickEdit overlay buttons to quickly add drive behaviors directly in the Scene view

<div align="left"><figure><img src="/files/70jua2AeJ8fQDn3wftb4" alt=""><figcaption><p>QuickEdit overlay showing drive behavior buttons for quick access</p></figcaption></figure></div>

This tutorial explains the relation between Signals and Behavior Models:

{% embed url="<https://youtu.be/sCKEi-6EKYQ>" %}

### Drive\_Cylinder

This is the model of a simple cylinder movement. The cylinder is defined by a maximum (*MaxPos*) and minimum (*MinPos*) position in millimeters in relation to a zero position. The speed of the cylinder to move in and out is defined by the time in seconds *TimeOut* and *TimeIn*.

**Settings:**

* **One Bit Cylinder**: When enabled, uses single signal for control. Out=false moves cylinder in, Out=true moves cylinder out.
* **Invert Output Logic** (new in 6.0.9-beta): Inverts the control logic. When enabled, Out=false extends the cylinder, Out=true retracts it. Useful for normally-closed valve configurations or inverted signal requirements.
* **Min Pos / Max Pos**: Define the cylinder stroke in millimeters.
* **Time Out / Time In**: Extension and retraction times in seconds.
* **Stop When Driving To Min/Max**: Optional sensors to stop the cylinder before reaching end positions.

The cylinder can be controlled manually by setting the booleans under *Behavior Signals*. Under *PLC IOs* PLC signals can be connected to the cylinder.

<div align="left"><figure><img src="/files/k6hczVfvt7G2LSwuvPLL" alt=""><figcaption></figcaption></figure></div>

### Drive\_Simple <a href="#drive-simple" id="drive-simple"></a>

The Simple Drive is controlled by boolean values for forward and backward movement with configurable speed and acceleration.

**Settings:**

* **Scale Speed**: Scale factor for input/output speed and acceleration values
* **Current Position Scale** (new in 6.0.9-beta): Scale factor for position feedback transformation
* **Current Position Offset** (new in 6.0.9-beta): Offset in millimeters applied to position feedback
* **Scale Feedback Position** (new in 6.0.9-beta): When enabled (default), applies scale and offset to position feedback. Disable to receive raw position values.

The scale and offset enable symmetric transformations for proper closed-loop control: position feedback uses the inverse transformation of position commands.

<div align="left"><figure><img src="/files/o52SCmXzoiIPXHoqFlkH" alt=""><figcaption></figcaption></figure></div>

### Drive\_DestinationMotor

The Destination Motor is a drive controlled by target positions and target speeds. After setting the target speed and target position, the movement can be started by a boolean Signal *StartDrive*. After the drive reaches its target position the Signal *IsAtDestination* is set high.

This is a **generic** positioning model with simple boolean and value signals. If you need to mirror the exact control-word / status-word interface of a real positioning drive, use one of the dedicated behaviors instead - see [Drive\_UniDriveMotor](#drive-unidrivemotor) (generic control-word / status-word positioning controller), [Drive\_ProfidriveSpeed](#drive-profidrivespeed) and [Drive\_ProfidrivePos](#drive-profidrivepos) (Siemens PROFIdrive).

**Scale/Offset Properties** (new in 6.0.9-beta):

* **Current Position Scale**: Scale factor applied to both position commands and feedback
* **Current Position Offset**: Offset in millimeters applied to both position commands and feedback
* **Scale Feedback Position**: When enabled (default), applies symmetric scale/offset transformations for proper closed-loop control

<div align="left"><figure><img src="/files/6bBlWFm6SZrA567DIAdb" alt=""><figcaption></figcaption></figure></div>

### Drive\_FollowPosition <a href="#drive-followposition" id="drive-followposition"></a>

This is the behavior model of a drive where the drive exactly follows the current provided position of the PLC. This is especially useful for connecting motion controllers and robot controllers to realvirtual.

**Settings:**

* **Offset**: Position offset in millimeters added to input signal
* **Scale**: Scale factor applied to position input signal
* **Current Position Scale** (new in 6.0.9-beta): Additional scale factor for position feedback
* **Scale Feedback Position** (new in 6.0.9-beta): When enabled (default), applies symmetric transformation: feedback = ((CurrentPosition - Offset) / Scale) \* CurrentPositionScale

The symmetric transformation ensures that the PLC receives properly scaled feedback values that match the coordinate system of the commanded positions.

<div align="left"><figure><img src="/files/nehkzZYGO8kPKhtXRsqn" alt=""><figcaption></figcaption></figure></div>

### Drive\_Gear <a href="#drive-gear" id="drive-gear"></a>

This behavior model is useful for connecting two drives together. The master drive will control the position of the drive that the gear is attached to. This is useful for two gripper fingers where only one is controlled by a pneumatic model and the second one follows correspondingly. The formula for the position of a gear controlled drive is: *CurrentPosition = MasterDrive.CurrentPosition x GearFactor + Offset*.

<div align="left"><figure><img src="/files/pPU4W1Hd6A3NkcmKL5Cz" alt=""><figcaption></figcaption></figure></div>

### Drive\_ContinousDestination <a href="#drive-continousdestination" id="drive-continousdestination"></a>

This drive is continuously trying to follow the given destination with the given speed. Unlike *Drive\_FollowPosition*, this Drive is not following exactly the given position because it might need some time to reach the destination. You don't need to set a start signal to start to drive like with *Drive\_DestinationMotor*. This drive is always starting to drive to a different destination as soon as the SignalDestination is changed. Please note, that you need to turn on *UseAccelearation* in the connected drive to use acceleration values.\
This Drive is specially useful for users who are reusing Simit models which are connected to NX Mechatronics Concept Designer. In NX Mechatronics Concept Designer this type of Drive is called *PositionControl*.

**Scale/Offset Properties** (new in 6.0.9-beta):

* **Current Position Scale**: Scale factor applied to both position commands and feedback
* **Current Position Offset**: Offset in millimeters applied to both position commands and feedback
* **Scale Feedback Position**: When enabled (default), applies symmetric scale/offset transformations

<div align="left"><figure><img src="/files/EdEVCBo6K3fHxowp9Qtx" alt=""><figcaption></figcaption></figure></div>

### Drive\_Speed <a href="#drive-speed" id="drive-speed"></a>

Drive\_Speed is controlling a drive by a speed. You can't control directly the position. The drive is always driving in the given speed. Positive speed values means forward direction. Negative speed values means backward direction. Please note, that the smooth acceleration is not working with this drive. If you want to stop the drive the speed needs to be set to zero.\
This Drive is specially useful for users who are reusing Simit models which are connected to NX Mechatronics Concept Designer. In NX Mechatronics Concept Designer this type of Drive is called *SpeedControl*.

**Position Feedback Properties** (new in 6.0.9-beta):

* **Current Position Scale**: Scale factor for position feedback transformation
* **Current Position Offset**: Offset in millimeters applied to position feedback
* **Scale Feedback Position**: When enabled (default), applies scale and offset to position feedback. Disable to receive raw position values.

<div align="left"><figure><img src="/files/XewLNipdEkrISqAUlMLr" alt=""><figcaption></figcaption></figure></div>

### Drive\_ErraticPosition <a href="#drive-erraticposition" id="drive-erraticposition"></a>

This drive is only for test purposes. It is moves constantly to random positions between MinPos and MaxPos.

<div align="left"><figure><img src="/files/nwwyjh4HQ30T7fk6jLqG" alt=""><figcaption></figcaption></figure></div>

### Drive\_Sequence <a href="#drive-sequence" id="drive-sequence"></a>

We recommend to not use DriveSequence any more and to use the new LogicStep visual programming which is simpler and gives you more flexibility. Please check [LogicSteps](/components-and-scripts/defining-logic/logicsteps.md).

#### Starting a sequence step <a href="#starting-a-sequence-step" id="starting-a-sequence-step"></a>

The Drive\_Sequence behavior allows to define simple sequences of motions. Each step in the sequence can set the Drive speed and the Drive Destination.\
The step is starting automatically after the step before. If a PLCSignal is defined in *Wait For Signal* the Step is not started before the Signal is set to true.

#### Ending a sequence step

In *Wait After Step* a time in seconds can be defined which should be waited after the drive is at its destination and before the next step is started. The *Finished Signal* is optionally and can be used to start external processes or Drive\_Sequences. This signal is set to true as soon as the step is finished

<div align="left"><figure><img src="/files/BLGmrlCgipRns3atwJ0X" alt=""><figcaption></figcaption></figure></div>

### Drive\_UniDriveMotor (Pro, Beta) <a href="#drive-unidrivemotor" id="drive-unidrivemotor"></a>

{% hint style="warning" %}
This behavior is part of realvirtual **Professional**, was added in realvirtual **6.3.4** and is currently in **beta**. The API and properties may still change.
{% endhint %}

Drive\_UniDriveMotor maps a UniDrive-style positioning controller onto a Drive, mirroring the typical control-word / status-word signal set of a parameterizable positioning drive. It combines a general release, a positioning start with integer setpoints (position, speed, acceleration and deceleration ramp) and manual jog bits with a setup/manual speed selection. Drive feedback (ready, referenced, in-position, actual position and actual speed) is written back to the PLC. This behavior is useful when connecting realvirtual to PLC blocks that drive a positioning axis through integer setpoints rather than physical units.

Setpoints are transferred as integers and converted to the Drive's millimeter / degree units through the scaling properties. Signal directions follow the realvirtual PLC convention: PLC outputs are commands read by the behavior, PLC inputs are feedback written back to the PLC.

**Scaling:**

* **Position Scale**: Scale factor between integer position units (PLC) and millimeters / degrees (Drive).
* **Position Offset**: Offset applied to position command and feedback in millimeters / degrees.
* **Speed Scale**: Scale factor between integer speed units and mm/s.
* **Acceleration Scale**: Scale factor between integer acceleration units and mm/s².

**Jog:**

* **Setup Speed**: Reduced jog speed in mm/s used when *Speed Selection* is false (setup / teach speed).

**Status (Inspector controlled):**

* **Ready**: Drive ready feedback (Betriebsbereit). Uncheck to simulate a not-ready drive.
* **Referenced**: Encoder referenced feedback (Referenzieren OK). Uncheck to simulate a not-referenced drive.

**PLC Outputs (commands from PLC):**

* **Run**: General release of the drive. While low the drive is held stopped at its current position.
* **Jog Plus / Jog Minus**: Manual jog forward / backward. Forward has priority if both bits are set.
* **Speed Selection**: Jog speed selection - false uses *Setup Speed*, true uses the commanded *Set Speed*.
* **Start Positioning**: Rising edge triggers a move to *Set Position* using *Set Speed* and *Set Acceleration*.
* **Set Position / Set Speed / Set Acceleration / Set Deceleration**: Integer setpoints, converted with the scaling properties.
* **Start Calibration / Reset Fault**: Present for interface completeness; signal only, no effect in the simulation.

**PLC Inputs (feedback to PLC):**

* **Is Ready / Is Referenced**: Driven by the *Ready* and *Referenced* settings.
* **Is At Position 1**: True when the commanded position has been reached (and the drive is not jogging away from it).
* **Actual Position / Actual Speed**: Current drive position and speed in integer units.

{% hint style="info" %}
The underlying Drive uses a single symmetric ramp for accelerating and braking. *Set Acceleration* drives the Drive acceleration; *Set Deceleration* is read and exposed (see the *Status* foldout) for transparency, but the drive brakes with the same ramp. Enable *Use Acceleration* on the Drive to apply the ramps.
{% endhint %}

The screenshot below shows the behavior as an example of a concrete drive implementation, mapping the control-word / status-word signals of a real positioning controller onto a Drive.

<div align="left"><figure><img src="/files/AU0V4BbahR6kOwnUbich" alt=""><figcaption><p>Drive_UniDriveMotor as an example of a concrete drive implementation</p></figcaption></figure></div>

### Drive\_ProfidriveSpeed (Pro, Beta) <a href="#drive-profidrivespeed" id="drive-profidrivespeed"></a>

{% hint style="warning" %}
This behavior is part of realvirtual **Professional**, was added in realvirtual **6.3.4** and is currently in **beta**. The API and properties may still change.
{% endhint %}

Drive\_ProfidriveSpeed models a PROFIdrive speed-controlled drive (Siemens SINAMICS G120, S120, V90, …) using **standard telegram 1**. The PLC sends the control word **STW1** plus the normalized speed setpoint **NSOLL\_A**, and the drive returns the status word **ZSW1** plus the actual speed **NIST\_A**. The behavior runs the PROFIdrive state machine, so the drive only moves once the PLC has correctly enabled it - exactly like a real SINAMICS drive.

This makes it possible to test the complete PLC enable sequence (ON/OFF1, OFF2, OFF3, enable operation, enable setpoint) against a realistic drive, without SIMIT or real hardware.

**Setpoint normalization:** `NSOLL_A = 0x4000 (16384) = 100 %` of the reference speed (drive parameter p2000). Negative values reverse the direction. The actual speed is reported back with the same normalization.

**Scaling:**

* **Reference Speed**: Drive speed in mm/s (or °/s) at the full-scale setpoint (100 %). Corresponds to the drive reference speed p2000.
* **Setpoint Scale**: Raw setpoint value that equals 100 %. Leave at 16384 (0x4000) for Siemens PROFIdrive NSOLL\_A. Set to 20000 to drive an **ABB** axis: the ABB Drives communication profile uses the same OFF1/OFF2/OFF3/Run/Reset state machine as PROFIdrive, only the reference REF1 is scaled to 20000 = 100 %.
* **Acceleration**: Drive acceleration in mm/s² (or °/s²). Enable *Use Acceleration* on the Drive for a ramped speed follow.

**Drive Status (Inspector controlled):**

* **Simulate Fault**: Forces a drive fault (ZSW1.3). The PLC must acknowledge with STW1.7 (rising edge) to clear it.
* **Simulate Warning**: Forces a drive warning (ZSW1.7).

**PLC Outputs (commands from PLC):**

* **Control Word**: PROFIdrive control word STW1.
* **Speed Setpoint**: Normalized speed setpoint NSOLL\_A.

**PLC Inputs (feedback to PLC):**

* **Status Word**: PROFIdrive status word ZSW1.
* **Speed Actual**: Normalized actual speed NIST\_A.

The control word STW1 bits are interpreted as follows: bit 0 ON/OFF1, bit 1 OFF2 (1 = no coast stop), bit 2 OFF3 (1 = no quick stop), bit 3 enable operation, bit 4 enable ramp-function generator, bit 5 continue ramp-function generator, bit 6 enable setpoint, bit 7 acknowledge fault, bit 10 control by PLC, bit 11 setpoint inversion. The decoded bits and the current state machine state are shown read-only in the Inspector for transparent commissioning.

<div align="left"><figure><img src="/files/YEaJV1kTIABgoDisgfOm" alt=""><figcaption><p>Drive_ProfidriveSpeed with control word STW1 / status word ZSW1 and the decoded STW1 bits</p></figcaption></figure></div>

### Drive\_ProfidrivePos (Pro, Beta) <a href="#drive-profidrivepos" id="drive-profidrivepos"></a>

{% hint style="warning" %}
This behavior is part of realvirtual **Professional**, was added in realvirtual **6.3.4** and is currently in **beta**. The API and properties may still change.
{% endhint %}

Drive\_ProfidrivePos models a PROFIdrive basic positioner (Siemens SINAMICS **EPOS**) controlled through the **raw telegram 111 process data**, exactly as it appears in the PLC I/O area when realvirtual stands in for the drive. The PLC sends the control words **STW1**, **POS\_STW1**, **POS\_STW2**, the velocity override and the MDI setpoints (target position, velocity); the drive returns the status words **ZSW1**, **POS\_ZSW1**, **POS\_ZSW2** plus the actual position **XIST\_A** and actual speed **NIST\_B**. The behavior decodes the control word bits, runs the PROFIdrive state machine and performs the MDI (direct setpoint) positioning - bit-for-bit identical to a real S120 / G120 / V90 axis.

This is the I/O-level (E/A) counterpart of the Siemens **SINA\_POS (FB284)** function block: SINA\_POS runs inside the PLC and packs / unpacks these telegram words, while this component models the drive side of the same telegram. The exact bit layout follows the SINAMICS function manuals (S120 / G120 / V90) and the SIMIT EPOS behavior library.

**Supported MDI operations** (MDI mode, POS\_STW1.15 = 1):

* **Absolute / relative positioning** (POS\_STW1.8) started by the rising edge of STW1.6 (activate traversing task)
* **Setup mode** / endless travel at velocity (POS\_STW1.14) in the selected direction (POS\_STW1.9 / .10)
* **Jogging** via STW1.8 / STW1.9 (jog 1 / jog 2)
* **Homing** via STW1.11 and **set reference point** via POS\_STW2.1 (both mark the axis as referenced)

Traversing-block mode (POS\_STW1.15 = 0) is not modeled, since block coordinates are drive parameters and not part of the telegram. The STW2/ZSW2 sign-of-life, MELDW and the fault/warning code words are not modeled.

**Scaling:**

* **Position Scale**: Drive millimeters / degrees per length unit (LU), used for MDI\_TARPOS and XIST\_A.
* **Position Offset**: Offset in millimeters / degrees applied to position command and feedback.
* **Velocity Scale**: Drive speed in mm/s per MDI\_VELOCITY unit (MDI\_VELOCITY is given in 1000 LU/min).
* **Reference Speed**: Drive speed at NIST\_B = 0x40000000 (100 %), corresponds to reference speed p2000.
* **Jog Speed**: Drive speed in mm/s used for jog mode (STW1.8 / STW1.9).
* **Acceleration**: Drive acceleration in mm/s² (or °/s²) at 100 % override.

**Drive Status (Inspector controlled):**

* **Simulate Fault**: Forces a drive fault (ZSW1.3). The PLC must acknowledge with STW1.7 (rising edge) to clear it.
* **Simulate Warning**: Forces a drive warning (ZSW1.7).

**PLC Outputs (telegram 111 send words - commands from PLC):**

* **Control Word**: STW1 (PZD1) - ON/OFF1, OFF2, OFF3, enable operation, reject/intermediate-stop, activate traversing task (edge), acknowledge fault, jog 1/2, control by PLC, start homing.
* **Pos Control Word 1**: POS\_STW1 (PZD2) - MDI mode select (.15), absolute/relative (.8), direction (.9/.10), setup (.14), transfer type (.12).
* **Pos Control Word 2**: POS\_STW2 (PZD3) - set reference point (.1), incremental jog (.5).
* **Override**: OVERRIDE (PZD5), velocity override with 0x4000 = 100 %.
* **Mdi Target Position**: MDI\_TARPOS (PZD6+7), target position in length units (LU).
* **Mdi Velocity**: MDI\_VELOCITY (PZD8+9), velocity in 1000 LU/min.

**PLC Inputs (telegram 111 receive words - feedback to PLC):**

* **Status Word**: ZSW1 (PZD1) - ready / operation / inhibit / fault / warning / target reached / reference set / standstill / accelerating / decelerating.
* **Pos Status Word 1**: POS\_ZSW1 (PZD2).
* **Pos Status Word 2**: POS\_ZSW2 (PZD3) - axis forward (.4) / backward (.5) / traversing command active (.15).
* **Position Actual**: XIST\_A (PZD6+7), actual position in LU.
* **Speed Actual**: NIST\_B (PZD8+9), actual speed with 0x40000000 = 100 % of reference speed.

The decoded STW1 / POS\_STW1 / POS\_STW2 control bits and the ZSW1 status bits are shown read-only in the Inspector for transparent commissioning.

<div align="left"><figure><img src="/files/MtfMnVT8McAMyaRD7mRJ" alt=""><figcaption><p>Drive_ProfidrivePos with the raw telegram 111 control / status words and decoded bits</p></figcaption></figure></div>

### Drive\_ProportionalValve (Pro, Beta) <a href="#drive-proportionalvalve" id="drive-proportionalvalve"></a>

{% hint style="warning" %}
This behavior is part of realvirtual **Professional**, was added in realvirtual **6.3.4** and is currently in **beta**. The API and properties may still change.
{% endhint %}

Drive\_ProportionalValve models a hydraulic (or electric) proportional directional valve that controls a Drive. It converts an analog command signal - the equivalent of a ±10 V, 4–20 mA or 0–100 % setpoint sent by a PLC through a valve amplifier - into a directional speed for the Drive. Unlike a plain speed setpoint, it reproduces the characteristics that make a real proportional valve behave differently from an ideal drive: a dead band around the neutral position, optional spool hysteresis, a configurable flow characteristic curve and a finite spool response time. The valve controls flow, which maps to the Drive speed; the motion direction follows the sign of the command, modelling a 4/3 directional valve with a neutral mid position.

The signal chain per simulation step is:

```
Setpoint (±10V / 4-20mA / %)
  → normalize (Setpoint Zero / Setpoint Full) → command -1..+1
  → dead band (spool overlap)
  → hysteresis (optional spool sticking)
  → response time (amplifier ramp + spool dynamics) → spool position
  → flow curve (linear or progressive) → flow -1..+1
  → Drive.TargetSpeed = |flow| × Max Speed, direction = sign
```

**Setpoint Scaling:**

* **Setpoint**: Analog command setpoint in raw signal units, used when no PLC signal is connected.
* **Setpoint Zero**: Raw signal value that corresponds to zero flow / neutral position. Use `0` for ±10 V, `12` for 4–20 mA, `0` for 0–100 %.
* **Setpoint Full**: Raw signal value that corresponds to 100 % flow in forward direction. Use `10` for ±10 V, `20` for 4–20 mA, `100` for 0–100 %.

**Valve Characteristic:**

* **Deadband** (0–0.9): Dead band around the neutral position modelling spool overlap. Below this fraction of the command no flow occurs.
* **Enable Hysteresis**: When enabled, the spool sticks until the command change exceeds the hysteresis band.
* **Hysteresis** (0–0.5): Hysteresis band as a fraction of the command. Changes smaller than this are ignored.
* **Flow Curve**: Flow characteristic curve mapping the normalized command (X 0–1) to normalized flow (Y 0–1). Linear by default; can be made progressive for valves with a non-linear flow gain.
* **Response Time**: Time in seconds for the spool to travel from neutral to full deflection (amplifier ramp plus spool dynamics). Set to `0` for instant response.

**Flow / Speed Mapping:**

* **Max Speed**: Drive speed at 100 % flow in mm/s (linear) or °/s (rotational).
* **Acceleration**: Drive acceleration in mm/s² (or °/s²). Enable *Use Acceleration* on the Drive for a smooth speed follow.

**PLC IOs:**

* **Signal Setpoint**: PLC output carrying the analog valve setpoint.
* **Signal Spool Position**: PLC input with the actual spool position (-1..1, where 1 = full forward flow). Models the LVDT feedback of closed-loop control valves.
* **Signal Current Speed**: PLC input with the current Drive speed.
* **Signal Current Position**: PLC input with the current Drive position.

The *Valve Status* section shows the live **Command**, **Spool Position** and **Flow** values, which is useful for tuning the dead band, response time and flow curve.

<div align="left"><figure><img src="/files/9Rs8FTlUKpcGy43w9g0p" alt=""><figcaption></figcaption></figure></div>

### Drive\_CiA402 (Pro, Beta) <a href="#drive-cia402" id="drive-cia402"></a>

{% hint style="warning" %}
This behavior is part of realvirtual **Professional**, was added in realvirtual **6.3.4** and is currently in **beta**. The API and properties may still change.
{% endhint %}

Drive\_CiA402 models a CiA 402 / DS402 drive (IEC 61800-7) - the EtherCAT (CoE) and CANopen drive profile, and the counterpart to the PROFIdrive behaviors for the non-Siemens servo world. The master writes the **controlword** (object 6040h) and the setpoints; the drive returns the **statusword** (object 6041h) and the actual values. It works with virtually every CoE / CANopen servo: Beckhoff AX5000/AX8000, Kollmorgen AKD, Omron, Yaskawa, Schneider Lexium, Lenze i700, SEW MOVI-C in CiA402 mode, Bosch Rexroth ctrlX DRIVE and many more.

The behavior runs the CiA 402 power state machine (Switch-On-Disabled → Ready-To-Switch-On → Switched-On → Operation-Enabled, plus Quick-Stop-Active and Fault), so the drive only moves once the master has stepped it through the standard **0x06 → 0x07 → 0x0F** enable sequence.

**Supported modes of operation (object 6060h):**

* **1 – Profile Position (PP):** move to *Target Position* (607Ah) at *Profile Velocity* (6081h), started by the rising edge of controlword bit 4 (new set-point), acknowledged by statusword bit 12.
* **3 – Profile Velocity (PV):** run at *Target Velocity* (60FFh), direction follows the sign.
* **6 – Homing (HM):** rising edge of bit 4 marks the axis as referenced (simplified homing).

Cyclic synchronous modes (CSP/CSV/CST) and torque mode are not modeled.

**Scaling:**

* **Position Scale / Position Offset**: Drive millimeters / degrees per position increment, for Target Position (607Ah) and Position Actual (6064h).
* **Velocity Scale**: Drive speed in mm/s per velocity unit (Profile Velocity 6081h, Target Velocity 60FFh).
* **Acceleration**: Drive acceleration in mm/s² (or °/s²).

**Drive Status (Inspector controlled):**

* **Simulate Fault**: Forces a drive fault (statusword bit 3), cleared by controlword bit 7 (rising edge).
* **Simulate Warning**: Forces a drive warning (statusword bit 7).

**PLC Outputs (commands from master):**

* **Control Word** (6040h), **Mode Of Operation** (6060h), **Target Position** (607Ah), **Profile Velocity** (6081h), **Target Velocity** (60FFh).

**PLC Inputs (feedback to master):**

* **Status Word** (6041h), **Mode Display** (6061h), **Position Actual** (6064h), **Velocity Actual** (606Ch).

Pitfalls reproduced faithfully: controlword bit 2 (Quick Stop) and statusword bit 5 (Quick Stop) are **active low**; controlword bit 4 (new set-point) and bit 7 (fault reset) are edge-triggered. The decoded controlword / statusword bits and the state machine state are shown read-only in the Inspector.

<div align="left"><figure><img src="/files/ZkNsLP8ikzoIwHFbB3Qb" alt=""><figcaption><p>Drive_CiA402 with the controlword 6040h / statusword 6041h interface and decoded bits</p></figcaption></figure></div>

### Drive\_SEWMovilink (Pro, Beta) <a href="#drive-sewmovilink" id="drive-sewmovilink"></a>

{% hint style="warning" %}
This behavior is part of realvirtual **Professional**, was added in realvirtual **6.3.4** and is currently in **beta**. The API and properties may still change.
{% endhint %}

Drive\_SEWMovilink models a SEW-EURODRIVE drive using the **MOVILINK** unit profile (MOVIDRIVE / MOVIMOT / MOVI-C). The PLC writes control word 1 (PO1) and the speed setpoint (PO2); the drive returns status word 1 (PI1) and the actual speed (PI2). This is the native SEW process image used across conveyor and intralogistics applications and is different from PROFIdrive, so it is modeled separately.

MOVILINK uses three priority-ordered low-byte command bits instead of a numbered state machine: **controller inhibit > rapid stop > stop > enable**. The enable path requires the control word low byte to be **0x06**.

{% hint style="info" %}
Key pitfall: control word bit 0 is the **inverted** controller inhibit (1 = inhibit / hold, 0 = released), and bits 1/2 are active low (0 = rapid stop / stop). The enable byte is **0x06, not 0x07** - 0x07 sets bit 0 = inhibit. A zeroed control word (0x0000) is the fail-safe "no enable" state.
{% endhint %}

**Scaling:**

* **Max Speed**: Drive speed in mm/s (or °/s) at 100 % / maximum speed.
* **Encoding**: Speed setpoint encoding - *SPEED\[%]* (0x4000 = 100 %) or *SPEED* (0.2 rpm per bit).
* **Max Speed Rpm**: Maximum speed in rpm (nmax), used to convert the 0.2 rpm/bit encoding.
* **Acceleration**: Drive acceleration in mm/s² (or °/s²).

**Drive Status (Inspector controlled):**

* **Simulate Fault**: Forces a fault (status word bit 5), cleared by control word bit 6 (rising edge).
* **Fault Code**: Code reported in the status word high byte while a fault is active.

**PLC Outputs (process output data):**

* **Control Word 1** (PO1), **Speed Setpoint** (PO2).

**PLC Inputs (process input data):**

* **Status Word 1** (PI1, with the device-status digit / fault code in the high byte), **Speed Actual** (PI2).

<div align="left"><figure><img src="/files/q9ZW19oCeTE4fi2IhSrI" alt=""><figcaption><p>Drive_SEWMovilink with the MOVILINK control word 1 / status word 1 interface and decoded bits</p></figcaption></figure></div>

### Drive\_FestoFHPP (Pro, Beta) <a href="#drive-festofhpp" id="drive-festofhpp"></a>

{% hint style="warning" %}
This behavior is part of realvirtual **Professional**, was added in realvirtual **6.3.4** and is currently in **beta**. The API and properties may still change.
{% endhint %}

Drive\_FestoFHPP models a Festo drive using the **FHPP** (Festo Handling and Positioning Profile), the native profile of the Festo electric-handling family (CMMP-AS, CMMS-ST/AS, CMMD, CMMO-ST, CPX, CMMT in Festo-profile mode). FHPP is byte-oriented: the PLC writes the control bytes **CCON / CPOS** plus the setpoints, and the drive returns the status bytes **SCON / SPOS** plus the actual values.

**Two operating modes** (selected via CCON bits 6/7):

* **Record Select:** byte 2 selects a stored traversing record from the *Records* table (position, velocity, absolute/relative configured in the Inspector).
* **Direct Mode:** the target position (bytes 4-7) and velocity (byte 3, 0-100 %) are sent inline.

The positioning handshake follows the FHPP standard **START → ACK → MC**: the rising edge of CPOS.START latches the setpoints and begins the move, the drive answers with SPOS.ACK, and SPOS.MC (Motion Complete) goes high when the target is reached. Homing via CPOS.HOM marks the axis as referenced.

{% hint style="info" %}
Pitfalls reproduced faithfully: CCON.STOP (bit 1) and CPOS.HALT (bit 0) are **active low** (0 = stop / halt); CPOS.START / HOM and CCON.RESET are rising-edge; CPOS.TEACH is falling-edge; the velocity byte is unsigned %.
{% endhint %}

**Scaling:**

* **Position Scale / Position Offset**: Drive millimeters / degrees per position increment (Direct mode target / actual position).
* **Base Velocity**: Drive speed in mm/s at 100 % velocity (Direct mode velocity byte = 0-100 %).
* **Jog Speed**: Drive speed in mm/s for CPOS.JOGP / CPOS.JOGN.
* **Acceleration**: Drive acceleration in mm/s² (or °/s²).
* **Records**: Traversing record table (position, velocity, absolute/relative) for Record Select mode.

**PLC Outputs (FHPP output bytes):**

* **Ccon** (byte 0), **Cpos** (byte 1), **Record Or Cdir** (byte 2), **Velocity Percent** (byte 3), **Target Position** (bytes 4-7).

**PLC Inputs (FHPP input bytes):**

* **Scon** (byte 0), **Spos** (byte 1), **Record Or Sdir** (byte 2), **Position Actual** (bytes 4-7).

Force / torque mode and the FPC parameter channel are not modeled.

<div align="left"><figure><img src="/files/ymLGPL8M1q1TmusMmXap" alt=""><figcaption><p>Drive_FestoFHPP with the FHPP CCON/CPOS and SCON/SPOS byte interface</p></figcaption></figure></div>

© 2025 realvirtual GmbH [https://realvirtual.io](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.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.realvirtual.io/components-and-scripts/motion/drive-behavior.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
