Browse all
Browse all
Explore Club PDL

Discover Club PDL: Explore rewards, events, training, and more.

Explore Tools for the Trade

Browse Trade Talk: our hub for all electrician tools and resources.

Explore Training

Explore PDL’s training hub to upskill with courses on our product ranges.

Explore C-Bus Automation

Discover C-Bus: find range information, support resources, and training.

Explore Wiser Smart Home

Discover Wiser Smart Home for electricians: find range information, support resources, and training.

Explore Inspiration & Planning

Browse our Home Inspiration and Planning Hub for everything Electric Home Design.

Explore Design Professionals

Browse our Design Professionals hub for specification resources for Interior Designers and Architects.

Explore Residential Builders

Browse our Residential Builders hub to find partnership details and resources for builders.

Example of creating a new object from a mimic script in ClearSCADA

FA280488

16 June 2025

DISCLAIMER 

Theis 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 a small example to show how a database object can be created from a mimic script in ClearSCADA. The script below creates a instance of a template and names the newly created instance based on the user's input.

Sub CreateInstance

sInstanceName = InputBox("Enter instance name")

If Len(sInstanceName) > 0 Then
    'Specify ClearSCADA Server object.   
    Set oServer = CreateObject ("Serck.ScxV6Server") 

    ' Provide connection information to connect to the ClearSCADA Database. The SystemName should be the same as in the Configure Connections utility.
    oServer.Connect "SystemName", "UserName", "UserPassword"
               
    ' Get references to the Group to create the instance in.
    Set oGroup = oServer.FindObject (Server.ThisObject.Parent.FullName)
               
    ' Create the instance by passing the class information.
    Set oNewUser = oGroup.Create("CTemplateInstance")
               
    ' Name the instance.
    oNewUser.Rename(sInstanceName)
    
    Server.SetOPCValue oNewUser.FullName + ".TemplateId", 9 
               
    oServer.Disconnect()

End If
              
End Sub
;