V2020.1.56.3_ Logic Simulator
Overview
The Logic Simulator manages all child components connections to the gateway adapters.
A Logic Simulator enables Prespective to connect to external logic controllers like PLCs. A Simulator object is a container that manages the connection to an https://unit040.atlassian.net/wiki/spaces/TEST/pages/2883710 and a collection of Logic Components.
The configuration result is saved as an XML policy file.
In this article you find information on how to setup this manager to establish a connection. Specific adapter configurations can be found under each adapter.
Where to find
The Logic Simulator can be found under Logic.
This will create a PreLogicSimulator in the Hierarchy.
Feature overview
Gateway Settings are adapter-specific, please see the https://unit040.atlassian.net/wiki/spaces/TEST/pages/2883710 for more information about specific adapters.
Configuration Settings are Twincat ADS specific. If using other external gateways, ignore this section
Simulation Settings |
|
---|---|
Simulator Name | Name used for to identify the simulator |
Start in Playmode | Automatically start the simulator when entering playmode |
Stream Connection | Shows the current state of the connection to the external source |
Content Lifecycle State | Returns the current status of the lifecycle management if supported by the selected adapter |
Stream Client State | Returns the state of the client |
Content life cycle management is not (yet) supported for most adapters
Component Settings |
|
---|---|
Component (#0) | Shows a list of all child components of this simulator |
Component settings automatically updates when a logic component is attached to the simulator
Signal Naming Rule Overrides | The naming rule override field can be used to apply the set rules to all connected child components. Increment the size generates a new rule |
---|---|
Signal Naming rules (#1) |
|
Size | Amount of signal naming rules |
Rule: $ALL |
|
Target | $ALL : this rule applies to all signals within this instance, overruled by all below options $INPUT : this rule applies to all PLC Input signals within this instance, overruled only by a custom rule $OUTPUT : this rule applies to all PLC Output signals within this instance, overruled only by a custom rule $VARIABLE : this rule applies to all PLC Variable signals within this instance, overruled only by a custom rule [CUSTOM] : applies only to the signal with the name [CUSTOM], overrides all other rules |
Sim Name Formatting | Naming used within Prespective to identify the IO Variables that can be used to here: {{SIM_ROOTPATH}} : unity path to the active simulator root object {{SIM_NAME}} : name of the simulator used in unity {{COMP_SIMPATH}} : unity path to the prelogic component {{COMP_NAME}} : name of the prelogic component {{IO_NAME}} : name of the IO defined in the signal definition {{INST_NAME}} : variable that can be modified by the instance naming rule |
PLC Address Formatting | Naming used within on the PLC to identify the IO The same variables can be used as in the sim name |
Sim Path Separator | Separator character used in the the Sim Name Formatting “_” by default |
PLC Path Separator | Sepearator character used in the the PLC Address Formatting “.” by default |
Apply Signal Naming Rule Overrides | Overrides the signal naming rules on all connected child components |
Instance Naming Rule Overrides | One can set the implicit naming rule override in this field per simulation component type |
---|---|
Instance Naming rule (#0) |
|
Size | 0 = default. When entering 1, following fields appear |
Target Script | The component script file on which the naming rule applies
|
Naming Rule | The actual implicit naming rule that should be applied |
Apply Instance Naming Rule Overrides | Applies the set rule to all connected child components with attached TargetScript |
{{INST_NAME}} needs to be used in the signal naming rule to apply an implicit naming rule
A policy file has all the necessary information to connect to the external source. The dataset consist of two parts:
Active Controller Definition and Type Definitions
Active controller definition consists of two parts, the adapter specific connection parameters and the IO definition.
<Server settings example >
< Input definition export example >
< Type Definition export example>
Policy Settings |
|
---|---|
Policy Export Settings |
|
Export Type Policy | Exports the type definition for the specific adapter. On by default |
Legacy Commenting | When on it does not export a Description element. Off by default |
Comment to Split Signals By Component | Split the IO definition into inputs, output and variable blocks. On by default |
Name And Address On Single Line | Puts the name and address element on a single line,. On by default |
Allow Initial Value | Adds the initValue field in the export. On by default |
Allow Priority | Adds the priority element on the export. On by default |
Export Policy to XML | Exports the file to the given XMLPath provided by the Adapter settings |
Open Policy File | Opens the exported file with the default XMLprogram defined in windows if the file exists |
Prespective Documentation