Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Notifications
Login / Register
Community
Community
Notifications
close
  • Forums
  • Knowledge Center
  • Events & Webinars
  • Ideas
  • Blogs
Help
Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Login / Register
Sustainability
Sustainability

Join our "Ask Me About" community webinar on May 20th at 9 AM CET and 5 PM CET to explore cybersecurity and monitoring for Data Center and edge IT. Learn about market trends, cutting-edge technologies, and best practices from industry experts.
Register and secure your Critical IT infrastructure

Using the Automation Interface with C(sharp)

Geo SCADA Knowledge Base

Access vast amounts of technical know-how and pro tips from our community of Geo SCADA experts.

cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Home
  • Schneider Electric Community
  • Knowledge Center
  • Geo SCADA Knowledge Base
  • Using the Automation Interface with C(sharp)
Invite a Co-worker
Send a co-worker an invite to the portal.Just enter their email address and we'll connect them to register. After joining, they will belong to the same company.
You have entered an invalid email address. Please re-enter the email address.
This co-worker has already been invited to the Exchange portal. Please invite another co-worker.
Please enter email address
Send Invite Cancel
Invitation Sent
Your invitation was sent.Thanks for sharing Exchange with your co-worker.
Send New Invite Close
Top Labels
Top Labels
  • Alphabetical
  • database 32
  • Web Server and Client 31
  • WebX 19
  • Request Form 18
  • Lists, Events & Alarms 16
  • ViewX 15
  • Application Programming 12
  • Setup 12
  • Telemetry 8
  • Events & Alarms 7
  • Lists 7
  • Mimic Graphics 7
  • Downloads 6
  • Support 5
  • IoT 5
  • SCADA 5
  • Geo SCADA Expert 5
  • Drivers and Communications 4
  • Security 4
  • DNP 3 3
  • IEC 61131-3 Logic 3
  • Trends and Historian 2
  • Virtual ViewX 2
  • Geo Scada 1
  • ClearSCADA 1
  • Templates and Instances 1
  • Releases 1
  • Maps and GIS 1
  • Mobile 1
  • Architectures 1
  • Tools & Resources 1
  • Privacy Policy 1
  • OPC-UA 1
  • Previous
  • 1 of 4
  • Next
Latest Blog Posts
  • OPC UA - Driver and Server
  • Requirements for Generating a Valid OPC UA Server Certificate
  • Load Events Using LoadRecord and LoadRecords
  • Geo SCADA Embedded Component Licenses
  • Geo SCADA 2023 Known Issues
Related Products
product field
Schneider Electric
EcoStruxure™ Geo SCADA Expert

Invite a Colleague

Found this content useful? Share it with a Colleague!

Invite a Colleague Invite
Anonymous user
Not applicable
‎2021-06-09 04:00 PM
1 Like
0
2596
  • Bookmark
  • Subscribe
  • Email to a Friend
  • Printer Friendly Page
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2021-06-09 04:00 PM

Using the Automation Interface with C(sharp)

Originally published on Geo SCADA Knowledge Base by Anonymous user | June 10, 2021 01:00 AM

📖 Home  Back  
Using the automation interface with C# is very similar to using it within VB, apart from the obvious syntax differences between the two languages.

We do recommend you use the .Net Client interface though. If you look in the Start Menu folder for ClearSCADA, you'll notice a "Client API" shortcut. This link will take you to the documentation for the automation interface. You should start in the ClearScada.Client.Simple Namespace. The key classes to use are "Connection" and "DBObject".

However, to use the automation interface:
  • When C# is running, select Project - Add Reference

  • Select the COM tab

  • Scroll down until you find the "Scx V6 Automation Interface" entry

  • Select OK. You will see the entry added to the References section in the solution explorer (by default on the right hand side of the screen).

  • Use the following code to connect to the server and create an internal analog point.


string sSystem = "MAIN";string sUid = "Eng";string sPwd= "";// Define the server object and create a new instance of itScxV6DbClient.ScxV6Server objServer = new ScxV6DbClient.ScxV6Server();// Connect to the serverobjServer.Connect(sSystem, sUid, sPwd);// Define the object and create a new internal analog pointScxV6DbClient.ScxV6Object obj = objServer.CreateObject("CPointAlgManual", "$Root");

Note: You can download the free Visual C# 2005 Express Edition (along with other languages) from the Microsoft website. This can be used for commercial software development (see http://msdn.microsoft.com/en-gb/express/aa718399.aspx point 4).

Accessing properties/methods directly



Using Obj.Interface.CurrentValue for example, like you would from VB won't work from C#. This is because "Interface" is a vanilla IDispatch so you need to use late binding.

In VB.Net the compiler will do the plumbing for you automatically. In C# you currently need to use reflection manually, as shown in the example below.
// Get objectScxV6DbClient.ScxV6Object O = S.FindObject( "New Analogue Point" );// The line below doesn't work because Interface is declared in the IDL as a vanilla IDispatch, instead we need to use late-binding via Reflection// O.Interface.LoadDataValues( Values, Times, Qualities );// Instead, use reflection:// Get the Historic aggregateobject Historic = O.Interface.GetType().InvokeMember( "Historic", System.Reflection.BindingFlags.GetProperty, null,O.Interface,null );// Invoke the LoadDataValues methodif ( Historic != null )  Historic.GetType().InvokeMember( "LoadDataValues", System.Reflection.BindingFlags.InvokeMethod, null, Historic, new object[] { Values, Times, Qualities } );


Go: Home Back
Labels:
  • Application Programming

  • Web Server and Client

Author

Biography

Anonymous user

Link copied. Please paste this link to share this article on your social media post.

  • Back to Blog
  • Newer Article
  • Older Article
To The Top!

Forums

  • APC UPS Data Center Backup Solutions
  • EcoStruxure IT
  • EcoStruxure Geo SCADA Expert
  • Metering & Power Quality
  • Schneider Electric Wiser

Knowledge Center

Events & webinars

Ideas

Blogs

Get Started

  • Ask the Community
  • Community Guidelines
  • Community User Guide
  • How-To & Best Practice
  • Experts Leaderboard
  • Contact Support
Brand-Logo
Subscribing is a smart move!
You can subscribe to this board after you log in or create your free account.
Forum-Icon

Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.

Register today for FREE

Register Now

Already have an account? Login

Terms & Conditions Privacy Notice Change your Cookie Settings © 2025 Schneider Electric

This is a heading

With achievable small steps, users progress and continually feel satisfaction in task accomplishment.

Usetiful Onboarding Checklist remembers the progress of every user, allowing them to take bite-sized journeys and continue where they left.

of