0

here is my scenario:

  • I have an entry screen, where an Operator requests to download a recipe (Entity “E1”)
  • “E1” sends a request to SQL Server to prepare the recipe (Entity “E2” a SP on SQL Server)
  • “E2” prepares the recipe data and sets it in a table for Wonderware to download (Entity “E3”)
  • “E3” Currently has a script that keeps polling the table to find out if data is available for it at a 2” interval.

What I am trying to obtain is this:

  • “E1” sends the request to SQL Server to prepare the recipe (Entity “E2”)
  • “E2” prepares the recipe data and sets it in a table for Wonderware to download (Entity “E3”)
  • “E2” sets a value in a specific Field Attribute of “E3” named (BoolRecipeAvailable) to true, (maybe call a DLL to do it?)
  • “E3” has a script that gets activated by BoolRecipeAvailable going to True or on a DataChange.

I have a Wonderware toolkit that can read/write inside a running Galaxy. How can I call one of its methods from the SQL Server stored procedure that prepares the requested data? This would allow me to use the DataChange or OnTrue events to start the script performing the download, without having to be time-activated.

Anyone ever ran into a similar situation? Thank you,

Marco

The current system has a script that every 2" queries a SQL table to check if there is data prepared for it, but due to the fact that 'When' is determined by the operator, most of this script runs are useless.

Tleilax
  • 77
  • 10
  • So I found out that SQL server can connect to CLR dll methods. I am in the process of writing a simple DLL that would allow SQL Server to execute a method in this module, so that: “E1” sends the request to SQL “SQL prepares the recipe data and sets it in a table SQL Calls the CLR DLL passing the needed value and attribute “E3” script gets activated by BoolRecipeAvailable that has been set to true by the CLR Object. – Tleilax Nov 08 '19 at 18:44
  • OK more news on this one. I was able to create a DLL that declares one method that can be seen by SQL servr as a stored procedure. Tested it and it works fine. My next step now is from this DLL to call a method in another DLL. That method is able to write a value in an attribute inside my Galaxy therefore allowing me to run a script on a datachange, rather than on a time basis. Anybody knows how to reference a DLL from inside a DLL itself? I built a Desktop app that does: – Tleilax Nov 14 '19 at 13:49
  • update: Now I have a DLL with procedures I can call from SQL server, that I wrote in C# to create a DLL. In order to import an assembly I need to have access to MxAccess assembly which is in the GAC. Getting an error about visibility. ANyone has any idea on how to solve this? – Tleilax Nov 19 '19 at 21:35
  • Resolved. Test machine had a previous version of the DLL needed which was exposing only 4 interfaces rather than 5 like the most recent version. Updated DLL on test system, resolved the issue. – Tleilax Dec 18 '19 at 15:16

0 Answers0