¿Cómo podemos ayudarte hoy?

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

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

Schneider Electric Mexico

¿Necesitas ayuda?

¿Necesitas ayuda?

Selector de productos

Selector de productos

Encuentra rápida y fácilmente los productos y accesorios adecuados para tus aplicaciones.

Pedir presupuesto

Pedir presupuesto

Comienza tu consulta de ventas en línea y un experto se pondrá en contacto contigo.

¿Dónde comprar?

¿Dónde comprar?

Encuentra fácilmente el distribuidor de Schneider Electric más cercano a ti.

Centro de ayuda

Centro de ayuda

Encuentra recursos de soporte para todas tus necesidades en un solo lugar.

  • Documentación de productos
  • Descargas de software
  • Selector de productos
  • Sustitución y reemplazo de productos
  • Centro de ayuda y contacto
  • Encuentra nuestras oficinas
  • Obtén un presupuesto
  • Dónde comprar
  • Comunidad Schneider Electric
  • Empleo
  • Perfil corporativo
  • Informar una conducta indebida
  • Accesibilidad
  • Sala de redacción
  • Inversores
  • EcoStruxure
  • Búsqueda de empleo
  • Blog
  • Política de privacidad
  • Aviso de Cookies
  • Términos y condiciones
  • Change your cookie settings