Simulation Tab on the Data Browser

Simulation variables are used to replace static values, dynamic tags and other functions that are used in expressions.

 

You can use simulations:

The possibilities are nearly endless. Simulation functions are invaluable in your design work.

You access the ICONICS local simulator functions on the Simulator tab of the Unified Data Browser. On the Simulator tab, you can select not only the function, but set the datatype that is returned, value limits and other features of the simulation that are described in the next section.

 

The Simulation Tab for Simulator Functions

 

The Unified Data Browser also exposes some variable data simulators meant to simulate tags and real-time data. To access a simulated tag, click on the Simulation node in the Shortcuts pane of the browser's Data Points tab, as shown in the figure below in the Grid view.

 

The Simulation View Displays Real Time Data Tag Functions

Simulator Variables

GraphWorX64 provides several different variables for local simulation which are useful for testing or simulating tags in GraphWorX64 displays. The following simulation variables are available for your use in the Local Simulation/Variables tab; each makes use of the localsim function. You can create additional variables by clicking the Simulation tab's Define New Variable button. The properties that define each variable are described following this list.

Properties of Simulator Variables

Each variable has its own properties. The properties you can set for variables are:

DataType Drop-Down List

The Define New Variable button in the Simulation tab allows you to define a new variable. After you click this button, enter values in the properties on the right side of the Simulation tab. After you enter a name in the Name property, the name appears at the top of the list of simulation tags, preceded by the function localsim::. To see an example, click here.

 

Using a Simulation Variable

When used as a variable, a simulation's syntax depends on the type of variable. For simulation variables within an expression, use the following syntax:

{{simulation_variable_name}}

 

Example:

x={{localsim:random}}

 

You can use the Simulation tab in the Unified Data Browser to select simulation variables. In the left-hand pane, select a simulation variable from the list. In the right-hand pane, you can edit the properties (described above) for each selected simulation variable. To create a custom variable, click the Define New Variable button and then select the variable mode in the properties.

 

To get a sense for how a variable is handled, in the figure below three different objects have had their data source set to the value localsim::var1. The circular knob's triangular indicator has a rotation dynamic assigned to it, and that rotation dynamic's data source was assigned to localsim::var1 as well. The local simulator for var1 is declaring a variable that can be written to or read from. The figure below is shown at runtime, and what you observe is that if you click and drag the knob around, the values in the two objects at the top (a Data Entry object and a Process Point) change accordingly. A value of 22 on the knob shows up as 22.00 in the objects. You can click in the Data Entry object, but not in the Process Point object. When you click in the Data Entry object and change the value to 53, the Process Point object and the indicator on the circular knob both change to reflect the var1 value of 53.

 

An Example of Using a Variable with a PPT and DE Label

All three objects are assigned the variable localsim::var1.

 

Localsim is a local simulator that can store a single value, or perform a function.

Tag Simulators

You can simulate OPC tags for OPC UA data source that varies over time (or could vary over time). To assign an OPC data tag, go to the DataSource property of the three different objects and assign them an OPC tag. You would open the Data Browser and go to the OPC UA node where you can locate the tag which will have a format similar to the following:

@\\ServerName\OPC_Server.Simulator.1\SimulatePLC.Ramp3.Value

 

If you assign a tag that has variable values, what you find at runtime is that the Process Point, Data Entry label, and Circular knob (described above) all display the value of the tag as it changes over time. You also find that the Data Entry label displays the value of the tag but has grey text and cannot get the focus of action (that is, it cannot be edited) because it is READ-only. Many OPC tags show a single value or state, and in that instance the assignment of the three objects above to a tag similar to:

@sim64:Double.Static("Static1").Value

ends up returning you to a condition that is similar to the one you saw earlier for the variable assignment localsim::var1; except you are now storing the variable value into an OPC tag value, albeit one that is a static value.

 

When you use a tag simulator, you are selecting an object in the OPC UA hierarchy. The properties of these objects are described in the next section, and are quite useful in understanding how OPC UA is organized.

Tab Simulator Object Hierarchy

You can see how the Simulator functions are organized by opening the Mesh view of the browser. The mesh for the Sim64 view is shown in the figure below. You can observe the following features:

  1. The remaining relationships are Organizes relationship from the FolderType objects that represent the storage location of the datatypes being returned: String, Long, Float, Double, Short, or Boolean.

  2. The Sim64 view has !Organized relation to its object class of Views. Each relationship is a one way relationship. For example, HasParentOf or IsChildOf. The Exclamation point tells you its the inverse relationship of IsChildOf, ContainedIn, etc.

  3. The Sim64 view has the HasTypeDefintion of a PlugInDAType that shows that the view is constructed of real time data access data, and that the system is extensible with additional functions of this type.

The Simulator View Object Hierarchy

The Sim64 object is currently selected as shown by the shadow effect.

 

The actual simulator functions themselves are contained within the different datatypes as shown in the figure below. Expanding the Long datatype displays the purple rectangles of the DataTypeObject: Static, Triangle, Step, Sine, Square, Random, and Ramp  which are the ultimate output that you select for your simulator. The green squares: Step, Square, Triangle, Random, Ramp, and Sine are folders; each expands to show additional content. As you select a simulator the address for the node appears in the Address bar. Shown selected below is the Static value, which would return a single unvarying value and is located on the path: @sim64:Long.Static("Static1").Value.

 

Simulation Value Object Relationships

 

See also:

Unified Data Browser