PLC Editor
Note: Logic Modeling is still in Early Access. Logic Modeling features created during Early Access, including plugins and integrations, may not be fully compatible with future versions of Visual Components.
The PLC Editor is used to create and manage Simulation PLCs and their Variable Pairs. Simulation PLCs represent external software or physical PLCs in Logic Modeling and provide a way to exchange data between the simulation and external processes.
Each Simulation PLC contains its own Variable Pairs. Variable Pairs can be used to exchange data with an external process or to exchange values between Function Block Diagrams.
Opening the PLC Editor
To open the PLC Editor, open the Logic tab and select PLC Editor.
Simulation PLCs
Simulation PLCs contain the Variable Pairs used for exchanging data. The upper section of the PLC Editor lists the Simulation PLCs in the layout. When you select a Simulation PLC, its Variable Pairs are displayed in the Variable Pairs section.
Creating a Simulation PLC
To create a Simulation PLC:
- In the PLC Editor, select + in the Simulation PLC section.
- Select the new Simulation PLC.
- Configure the Simulation PLC in the Properties panel.
Variable Pairs
Variable Pairs represent values that can be exchanged between Logic Modeling and an external process. They can also be used to exchange values between Function Block Diagrams.
Each Variable Pair belongs to a Simulation PLC. Select a Simulation PLC in the PLC Editor to view and manage its Variable Pairs.
Creating a Variable Pair
To create a Variable Pair:
- In the PLC Editor, select the Simulation PLC to which you want to add the Variable Pair.
- In the Variable Pairs section, select +.
- Select the new Variable Pair.
- Configure the Variable Pair in the Properties panel.
Variable Pair properties
Configure the following properties for a Variable Pair:
- Name: Specifies the name of the Variable Pair.
- Address: Specifies the identifier used to map the Variable Pair to a value in an external process.
- DataType: Specifies the IEC 61131-3 data type of the Variable Pair.
- Direction: Specifies the direction in which data is exchanged.
- ValueHandlingStrategy: Specifies how incoming values are handled.
Direction
The following directions are available:
- SimToPlc: Data is written from the simulation to the PLC.
- PlcToSim: Data is written from the PLC to the simulation.
- Bidirectional: Data can be exchanged in both directions.
Value handling strategy
The value handling strategy determines how new values are handled when values are received by the Variable Pair.
- Latest: Uses the latest value.
- Minimum: Uses the smaller value when comparing a new value with the existing value.
- Maximum: Uses the larger value when comparing a new value with the existing value.
- All: Queues values so that multiple received values can be processed.
Adding a Variable Pair to a Function Block Diagram
Before adding a Variable Pair, select the Function Block Diagram to which you want to add it.
- In the PLC Editor, select the Simulation PLC that contains the Variable Pair.
- Select the Variable Pair that you want to add.
- Select + to add the Variable Pair to the active Function Block Diagram.
The Variable Pair is added to the Function Block Diagram as a node and can be connected to Function Block ports.
Data transport
A Simulation PLC can use a data transport to exchange Variable Pair values with an external process. The data transport handles communication between Visual Components and the external process.
The refresh rate of the Simulation PLC determines how often its data transport is updated.