Mimic.Parameters

The Mimic.Parameters property can be used to access the parameters of the Mimic that is running the script.

When the Mimic.Parameters property is used, the parameters can only be read by the script.

Syntax

Mimic.Parameters.Parameter Name

Description

Provides access to the parameters for the Mimic on which the script is running.

Arguments

Parameter Name {string}

The name of the parameter that you want to access.

Returns

Variant. The value that is returned is dependent on the type of parameter being accessed.

Example:

A Mimic contains 2 embedded Mimics. The embedded Mimics represent a dial and have the following configuration:

The Mimic has these parameters:

  • CurrentValue—Sets the Mimic to display the CurrentValue property of the database item that is associated with the parameter.
  • FullScale—Sets the Mimic to display the FullScale property of the analog point that is associated with the parameter. This is the point's maximum value.
  • Name—Sets the Mimic to display the Name property of the database item that is associated with the parameter.
  • ObjectLink—Sets the Mimic to link to the pick action menu of the database item that is associated with the parameter.
  • ZeroScale—Sets the Mimic to display the ZeroScale property of the analog point that is associated with the parameter. This is the point's minimum value.

The Value line on the Mimic has the following animations:

  • PivotType—4
  • Rotation—("Parameter:Point.CurrentValue" / ("Parameter:Point.FullScale" - "Parameter:Point.ZeroScale")) * 90

This sets the line to rotate according to the current value of the database item that is associated with the parameter. The angle of rotation is calculated based on the database item's FullScale, CurrentValue, and ZeroScale values.

The Value field has the following animations in place:

  • PickParam—"Parameter:Point.ObjectLink"
  • PickType—1
  • Value—"Parameter:Point.Name" + ': ' + STR("Parameter:Point.CurrentValue")

These animations set the value field to provide access to the pick action menu for the item associated with the Point parameter, and to also display the name and current value of the

The Value field is linked to the CurrentValue, Name, and ObjectLink parameters.

The 'Parameter Details' button is associated with a script pick action. The script for the pick action is:

Sub ParameterTest

Set test = Mimic.Parameters

Form.Init("Parameter Details")

Form.AddStaticText 2, 1, "Parameter"

Form.AddStaticText 20, 1, "Value"

Form.AddStaticText 2, 2, "-------------"

Form.AddStaticText 20, 2, "-------"

 

Form.AddStaticText 2, 3, "Full Scale"

If test.Point.FullScale = "" Then

Form.AddStaticText 20, 3, "<blank>"

Else

Form.AddStaticText 20, 3, test.Point.FullScale

End If

Form.AddStaticText 2, 4, "Zero Scale"

If test.Point.ZeroScale = "" Then

Form.AddStaticText 20, 4, "<blank>"

Else

Form.AddStaticText 20, 4, test.Point.ZeroScale

End If

Form.AddStaticText 2, 5, "Current Value"

If test.Point.CurrentValue = "" Then

Form.AddStaticText 20, 5, "<blank>"

Else

Form.AddStaticText 20, 5, test.Point.CurrentValue

End If

Form.AddStaticText 2, 6, "Name"

If test.Point.Name = "" Then

Form.AddStaticText 20, 6, "<blank>"

Else

Form.AddStaticText 20, 6, test.Point.Name

End If

Form.AddStaticText 2, 7, "Object Link"

If test.Point.ObjectLink = "" Then

Form.AddStaticText 20, 7, "<blank>"

Else

Form.AddStaticText 20, 7, test.Point.ObjectLink

End If

Set button = Form.AddPushButton(10, 10, "OK")

Form.Show()

End Sub

The script sets the 'Parameter Details' button to display a Form when selected. The Form references the parameters for the Mimic, for example, the point.ZeroScale parameter. When the 'Parameter Details' button is selected in Run Mode, it will display a Form that shows the FullScale, ZeroScale, Name, CurrentValue, and ObjectLink address of the database item that is associated with the Mimic.

The Mimic is saved and is then embedded twice on a Mimic named 'Meters'. The first embedded version of the Mimic is associated with an analog point named 'Point 1' and the second embedded version of the Mimic is associated with a point named 'Point 2'.

The value lines on the embedded Mimics are rotated according to the values of 'Point 1' and 'Point 2' respectively. Similarly, the Value fields show the Name and CurrentValue values for 'Point 1' and 'Point 2'.

When the 'Parameter Details' button for the first version of the embedded Mimic (the embedded Mimic associated with 'Point 1') is selected, a Form is displayed. The Form shows the FullScale, ZeroScale, Name, CurrentValue, and ObjectLink address of the 'Point 1' point.

Similarly, when the 'Parameter Details' button for 'Point 2' is selected, a Form is displayed containing the FullScale, ZeroScale, Name, CurrentValue, and ObjectLink address of the 'Point 2' point.


Disclaimer

Geo SCADA Expert 2020