Sign In Help
Schneider Electric
HelpSign In
Schneider Electric Exchange
  • Home
  • Collaborate
  • Develop
  • Shop
Home Collaborate Develop Shop Log in or Register Help

Invite a Co-worker

Send a co-worker an invite to the Exchange 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
  • Home
  • Collaborate
  • Exchange Community
  • :
  • SCADA & Telemetry Solutions
  • :
  • Geo SCADA Expert Forum
  • :
  • [Imported] DDK Questions
Community Menu
  • Forums
    • By Topic
        • EcoStruxure IT
          • EcoStruxure IT forum
        • Industrial Automation
          • Industry Automation and Control Forum
          • Alliance System Integrators Forum
          • Machine Solutions in the Digital Transformation
          • EcoStruxure Automation Expert / IEC 61499 Forum
          • Industrial Edge Computing Forum
          • Level and Pressure Instrumentation Forum
          • Modicon User Group
          • PLC Club Indonesia
          • SEE Automation Club Forum
          • Fabrika ve Makina Otomasyonu Çözümleri
          • Форум по промышленной автоматизации СНГ
        • SCADA & Telemetry Solutions
          • Geo SCADA Expert Forum
          • SCADA and Telemetry Devices Forum
        • Power Distribution IEC
          • Power Distribution and Digital
          • Power Standards & Regulations
          • Paneelbouw & Energie Distributie
          • Eldistribution & Fastighetsautomation
        • Power Distribution Softwares
          • EcoStruxure Power Design Forum
          • SEE Electrical Building+ Forum
          • LayoutFAST User Group Forum
        • Wireless Information Network Solutions
          • Instrument Area Network
          • Remote Monitoring
          • Tank Level Monitoring
          • Remote Data Collection
        • Solutions for your Business
          • Solutions for Food & Beverage Forum
          • Solutions for Healthcare Forum
    • By Segment
        • Food & Beverage
          • Solutions for Food & Beverage Forum
        • Healthcare
          • Solutions for Healthcare Forum
      • EcoStruxure IT
        • EcoStruxure IT forum
      • Industrial Automation
        • Industry Automation and Control Forum
        • Alliance System Integrators Forum
        • Machine Solutions in the Digital Transformation
        • EcoStruxure Automation Expert / IEC 61499 Forum
        • Industrial Edge Computing Forum
        • Level and Pressure Instrumentation Forum
        • Modicon User Group
        • PLC Club Indonesia
        • SEE Automation Club Forum
        • Fabrika ve Makina Otomasyonu Çözümleri
        • Форум по промышленной автоматизации СНГ
      • SCADA & Telemetry Solutions
        • Geo SCADA Expert Forum
        • SCADA and Telemetry Devices Forum
      • Power Distribution IEC
        • Power Distribution and Digital
        • Power Standards & Regulations
        • Paneelbouw & Energie Distributie
        • Eldistribution & Fastighetsautomation
      • Power Distribution Softwares
        • EcoStruxure Power Design Forum
        • SEE Electrical Building+ Forum
        • LayoutFAST User Group Forum
      • Wireless Information Network Solutions
        • Instrument Area Network
        • Remote Monitoring
        • Tank Level Monitoring
        • Remote Data Collection
      • Solutions for your Business
        • Solutions for Food & Beverage Forum
        • Solutions for Healthcare Forum
      • Food & Beverage
        • Solutions for Food & Beverage Forum
      • Healthcare
        • Solutions for Healthcare Forum
  • Blogs
    • By Topic
        • Industrial Automation
          • Industrial Edge Computing Blog
          • Industry 4.0 Blog
          • Industrie du Futur France
        • SCADA & Telemetry Solutions
          • SCADA and Telemetry Blog
        • Power Distribution IEC
          • Power Events & Webinars
          • Power Foundations Blog
        • Power Distribution NEMA
          • NEMA Power Foundations Blog
        • Power Distribution Softwares
          • EcoStruxure Power Design Blog
          • SEE Electrical Building+ Blog
        • Solutions for your Business
          • Solutions for Food & Beverage Blog
          • Solutions for Healthcare Blog
          • Solutions for Retail Blog
        • Community experts & publishers
          • Publishers Community
    • By Segment
        • Food & Beverage
          • Solutions for Food & Beverage Blog
        • Healthcare
          • Solutions for Healthcare Blog
        • Retail
          • Solutions for Retail Blog
      • Industrial Automation
        • Industrial Edge Computing Blog
        • Industry 4.0 Blog
        • Industrie du Futur France
      • SCADA & Telemetry Solutions
        • SCADA and Telemetry Blog
      • Power Distribution IEC
        • Power Events & Webinars
        • Power Foundations Blog
      • Power Distribution NEMA
        • NEMA Power Foundations Blog
      • Power Distribution Softwares
        • EcoStruxure Power Design Blog
        • SEE Electrical Building+ Blog
      • Solutions for your Business
        • Solutions for Food & Beverage Blog
        • Solutions for Healthcare Blog
        • Solutions for Retail Blog
      • Community experts & publishers
        • Publishers Community
      • Food & Beverage
        • Solutions for Food & Beverage Blog
      • Healthcare
        • Solutions for Healthcare Blog
      • Retail
        • Solutions for Retail Blog
  • Ideas
        • Industrial Automation
          • Modicon Ideas & new features
        • SCADA & Telemetry Solutions
          • Geo SCADA Expert Ideas
          • SCADA and Telemetry Devices Ideas
  • Knowledge Center
    • Building Automation Knowledge Base
    • Industrial Automation Knowledge Base
    • Industrial Automation How-to videos
    • SCADA & Telemetry Solutions Knowledge Base
    • Digital E-books
    • Success Stories Corner
    • Power Talks
  • Events & Webinars
    • Innovation Talks
    • Innovation Summit
    • Let's Exchange Series
    • Technology Partners
  • Support
    • Ask Exchange
    • Leaderboard
    • Our Community Guidelines
    • Community User Guide
    • How-To & Best Practices
    • More
Join Now
How can we help?
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: 
51304members
Join Now
245511posts
Join Now

[Imported] DDK Questions

Options
  • Subscribe to RSS Feed
  • Mark Topic as New
  • Mark Topic as Read
  • Float this Topic for Current User
  • Bookmark
  • Subscribe
  • Mute
  • Printer Friendly Page
Back to Geo SCADA Expert Forum
sbeadle
Sisko sbeadle Sisko
Sisko
‎2019-11-05 02:18 PM
0 Likes
0
276
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content
‎2019-11-05 02:18 PM

[Imported] DDK Questions

>>Message imported from previous forum - Category:ClearSCADA Software<<
User: florian, originally posted: 2018-10-25 20:15:03 Id:300
This is a re-posting from the obsoleted (October 2018) "Schneider Electric Telemetry & SCADA" forum.

-------------------------------

**_davidhopkins:_**
**_Hi,_**

**_I've making a Simple Driver DDK driver which connects to a PLC via a .NET API._**

**_I have a number of questions about how to correctly use the DDK, which don't seem to be clearly answered by the "Creating a Driver with the Simple Driver Development Kit" guide, or the "Simple Driver Development Kit Reference" CHM file which ships with the DDK._**

**_I thought I might ask the questions here on the forum, so the answers are available to other people using the DDK._**

**_Here are the questions:_**

**_1. Because my driver just calls synchronous methods in a .NET assembly, I don't need to manage a socket or explicitly handle timeouts. But I do need to initialise a stateful .NET object which represents a connection to my target device, clean up that object when ClearSCADA disconnects, and re-create it when attempting to restore a failed connection. Should I be setting up and tearing down my channel's client object in OnConnect()/OnDisconnect() overrides, or in PerformConnect()/PerformDisconnect() overrides, or even OnDefine()/OnUnDefine()?_**

**_2. What's the difference between OnConnect() and PerformConnect(), anyway? When should I use one or the other?_**

**_3. What is my driver expected to do if the connection attempt fails? Should my OnConnect()/PerformConnect()/OnDefine() method throw exceptions? Or should it just call SetStatus() and set it to "Offline" or "Failed" or "FailedRetryDefine", perhaps with a message string?_**

**_4. If the connection is successfully established but fails later, what is the driver expected to do? I think the Channel is supposed to call SetStatus(Failed) rather than throw exceptions. Do I also need to SetStatus on the associated Scanners, or will that happen automatically when the Channel is marked as failed? Does my channel need to undefine its scanners, or will ClearSCADA manage the lifecycle of the scanners when the channel fails?_**

**_5. What's the expected trigger for attempting to reestablish a failed connection? Do I just wait for ClearSCADA to call OnDefine()/OnConnect()/PerformConnect() again? Or wait for OnPoll() to be called? Or should I attempt to re-establish the connection when OnScan() is called on a scanner linked to the failed Channel?_**

**_6. The documentation for the DriverScanner.OnTimeout() method says "You should call the base class if you find the timer id is not one of yours." Is there a specific range of uint values which are safe to use for my own timers? It's not clear which values ClearSCADA uses for its internal timers. I don't want to accidentally break an internal timer by defining a timer of my own with the same id._**

**_7. Same question for DriverChannel.OnExecuteAction(). The documentation says "You should call the base class if the transaction is not handled by your driver". What range of values for transaction ids are safe for me to use for my own custom transactions, so I don't risk masking one of ClearSCADA's internal driver action types?_**

**_8. On the channels and scanners, what's the difference between calling SetFailReason(), and calling SetStatus() with a "Failed" value and a string message?_**

**_9. Are there any diagrams avaiable which show the lifecycle of Channels and Scanners? I'm looking for schematic of their state machines, how the Channel and associated Scanner state machines interact, and what order the various methods will be called for the Channel and all its attached Scanners during startup and shut down. And, particularly, what ClearSCADA will do if various parts of the startup sequence fail, or the channel or scanner calls "SetFailed" or "SetStatus(Failed)". Do I ever have to call OnUndefine or OnDisconnect manually or does ClearSCADA ensure that these methods get called when things fail?_**

---------------

bevanweiss:
I can only answer a few of these... (it's been a while since I was looking through the DDK)
1. PerformConnect() sounds like the correct method to override here. 'You should override this method if your driver needs to use its own connect code. If your driver uses the built-in serial, you should call the base class'. I think this fits your implementation.
2. OnConnect() is like a hook that is called when the channel itself is connected (i.e. after PerformConnect() returns a success status)
3. Yes, on failure you should SetStatus() and include a message string with SetFailReason().
4. OnPoll() should throw an Exception here. OnPoll() is supposed to be the only thing which checks and drops channels I believe.
5. OnConnect() would be the appropriate method here I believe.
6. I'm not sure on the ID here, however... I would request a range of UIDs from Schneider for your driver development, you should already have done this for assigning them to OPC property ID.. I'd just use a spare ID from this.
7. This is definitely the OPC ID that you should get from Schneider..
8. I believe SetStatus(status, failmessage) is a bit newer, and does replace the combo of SetStatus(), SetFailReason()
9. The state machine part... not sure how much info you'd get with this. But when it comes to the OnUndefine / OnDisconnect. You shouldn't have to call these yourself. They are hooks that trigger when the appropriate event within ClearSCADA occurs (i.e. OnUndefine will be called when configuration is modified and saved...


You should take all of this with a grain of salt however..

-----------

**_davidhopkins:_**
**_Hmmm._**

**_Well, I defined overrides for PerformConnect() and PerformDisconnect() - and they never get called by the driver framework, even when I disable and enable the channel. So, I'm still pretty confused about the purpose of those methods and the conditions under which they get invoked._**

**_I'm still having trouble with figuring out how to correctly indicate failures to the framework, too. I've got my target PLC turned off, so none of my connection attempts are working. In my OnConnect method, when I catch the exception from my failed connection attempt, I call SetStatus(SourceStatus.Failed, "Error message")._**

**_But as soon as I return from OnConnect without actually throwing an exception, ClearSCADA sets the channel status to "Online" by itself._**

**_I've put breakpoints on every reference to SourceStatus.Online or ServerStatus.Online in my code, and I'm not hitting any of them, but the channel is still getting set to "Online" somehow._**

-------------

bevanweiss:
I would expect that given you're using a custom channel you would have overridden (on the channel):
* OnDefine
* OnUnDefine
* OnValidateConfig
* OnPoll (which should test the connection and throw an exception on error)
* OnConnect (if you need to do stuff after connection is established)
* OnDisConnect (if you need to do stuff after connection is disconnected)
* OnExecuteAction (because you will generally want some custom actions available)
* PerformConnect
* PerformDisconnect
* PerformWrite
* PerformRead
* PerformPurge
* IsPortConnected

And then for your scanner you'd override:
* OnDefine
* OnUnDefine
* OnValidateConfig
* OnScan
* OnControl (if you are allowing controls from points connected to the scanner)
* OnExecuteAction
* OnUpdateStatistics
* CheckReply

We've really only done basic serial port comms using this DDK... so unfortunately I'm not speaking from experience on the PerformConnect etc overrides. But it's certainly what the DDK is alluding to (whether that matches reality may be a different story)

 

Labels
  • SCADA
Share
  • All forum topics
  • Previous Topic
  • Next Topic
Related Products
Schneider Electric
EcoStruxure™ Geo SCADA Expert
Top Experts
User Count
sbeadle
Sisko sbeadle Sisko
188
BevanWeiss
Sisko BevanWeiss
53
AdamWoodland
Lt. Commander AdamWoodland Lt. Commander
16
JChamberlain
Lieutenant JChamberlain Lieutenant
16
AndrewScott
Lieutenant AndrewScott
15
See More Top Experts
Find a Service Provider
Find a certified partner to help you address your integration, installation, maintenance and project needs.
View all Providers
Support

Have a question? Please contact us with details, and we will respond.

Contact Us
FAQ

Look through existing questions to find popular answers.

Learn More
About

Want to know more about Exchange and its possibilities?

Learn More

Full access is just steps away!

Join Exchange for FREE and get unlimited access to our global community of experts.

Connect with Peers & Experts

Discuss challenges in energy and automation with 30,000+ experts and peers.

Get Support in Our Knowledge Base

Find answers in 10,000+ support articles to help solve your product and business challenges.

Ask Questions. Give Solutions

Find peer based solutions to your questions. Provide answers for fellow community members!

Register today for FREE

Register Now

Already have an account?Log in

About Us FAQ Terms & Conditions Privacy Notice Change your cookie settings
©2020, Schneider Electric