{}

Our Brands

Impact-Company-Logo-English Black-01-177x54

Schneider Electric USA Website

Welcome to our website.
How can we help you today?
Example of using mimic script to build custom pick menus

This sample program is intended to demonstrate one or more programming functions or methods and is presented as programming example only. Schneider Electric assumes no liability for the use or application of this example program or any portion thereof.


This is an example of a mimic script that builds custom pick menus. Once the script is executed, a custom pick menu would appear with 2 options: Point Control and Another Submenu. The Point Control has 3 options - to control a particular point to 0, to 10 and to 20.

In this example the script is placed on a mimic which is a part of a symbol and uses a mimic parameter instead of an actual database point. This mimic should be embedded onto another mimic and the mimic parameter called Point needs to be set in order for this script to work.

Public Sub BuildCustomMenu()
Dim objPoint, iValue
Dim Submenu1, Submenu2
Set objPoint = Server.FindObject(Mimic.Parameters.Point.FullName)
Menu.Init()
Set Submenu1 = Menu.AddMenu("Point Control")
Submenu1.AddItem("Set " & objPoint.FullName & " to 0")
Submenu1.AddItem("Set " & objPoint.FullName & " to 10")
Submenu1.AddItem("Set " & objPoint.FullName & " to 20")
Set Submenu2 = Menu.AddMenu("Another submenu")
ivalue = Menu.Display()
If iValue = 1 Then
    objPoint.Interface.CurrentValue = 0
End If
If iValue = 2 Then
    objPoint.Interface.CurrentValue = 10
End If
If iValue = 3 Then
    objPoint.Interface.CurrentValue = 20
End If
End Sub

Schneider Electric USA

Explore more
Range:
Articles that might be helpful Users group

Discuss this topic with experts

Visit our Community for first-hand insights from experts and peers on this topic and more.
Explore more
Range: