PLC API

If a PLC is to be simulated via the TwinCAT Simulation Manager, the original PLCs and the simulation PLC must contain the TcSimManager.lib.

Global Variables

TcSimManager.lib contains the universal DWORD 'dwSimState', through which the PLCs are informed about the current state of the simulation.

VAR_GLOBAL
    dwSimState : DWORD;
END_VAR

Flag

Description

0

Simulation mode on / off

The flag is set by the TwinCAT Simulation Manager when the switchover to the simulation mode has been successful. At this point the mode can be read by the PLC.

1 - 31

Reserved

Blocks

Name

Description

FB_SimDelayedLatch

Delayed latch

FB_SimPosMotor

Position-controlled simulation motor

FB_SimSimpleVeloMotor

Simple velocity-controlled simulation motor

FB_SimVeloMotor

Velocity-controlled simulation motor

Auxiliary blocks

Name

Description

FB_SimClock

Clock block

FB_SimDelay

Delay block

FB_SimDerivative

Derivative block

FB_SimIntegral

Integral block

FB_SimPastCpuCounterTicks

Timing block

FB_SimRamp

Ramp block