{}

Our Brands

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

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:
Explore more
Range:
Users group

Discuss this topic with experts

Visit our Community for first-hand insights from experts and peers on this topic and more.
Users group

Discuss this topic with experts

Visit our community and get advice from experts and peers on this topic and more
Explore more
Range:
Explore more
Range:
move-arrow-top
Your browser is out of date and has known security issues.

It also may not display all features of this website or other websites.

Please upgrade your browser to access all of the features of this website.

Latest version for Google Chrome, Mozilla Firefox or Microsoft Edgeis recommended for optimal functionality.
Your browser is out of date and has known security issues.

It also may not display all features of this website or other websites.

Please upgrade your browser to access all of the features of this website.

Latest version for Google Chrome, Mozilla Firefox or Microsoft Edgeis recommended for optimal functionality.
Your browser is out of date and has known security issues.

It also may not display all features of this website or other websites.

Please upgrade your browser to access all of the features of this website.

Latest version for Google Chrome, Mozilla Firefox or Microsoft Edgeis recommended for optimal functionality.