We use named sets to manage various aspects of our product the 2 most critical are the product type (Brand) and the raw material types (RawMat).
We are at a point in our plant where we need to automatically read those 2 entire named sets (index and name) into a SQL database whenever there is a change to the named set, so that our recently added MES and ERP systems have access to that information.
Does anyone have any suggestions to make this possible?
In reply to Matt Stoner:
In reply to Lun.Raznik:
Do you happen to use OPC to get data from DeltaV? If yes, you can use something like below to get the named set name instead of the the index.
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApp1 { internal class Program { static void Main(string[] args) { string hostname = "change2machineName"; //machine name or IP Opc.URL url = new Opc.URL($"opcda://{hostname}/OPC.DeltaV.1"); var opc_item = new Opc.Da.Item(new Opc.ItemIdentifier("MOD1/AI1/L_TYPE.CVS")); opc_item.ReqType = typeof(string); Opc.Da.Server server = new Opc.Da.Server(new OpcCom.Factory(), url); server.Connect(new Opc.ConnectData(null, null)); var result = server.Read(new Opc.Da.Item[] { opc_item }); Console.WriteLine($"{result[0].ItemName}:{result[0].Value}"); server.Disconnect(); Console.WriteLine("This should close connection to the server, key to continue"); Console.ReadKey(true); } } }
Take note on the use of .CVS field to read the value.
This blogpost details how a sample OPC client can be created:
iotgarage.blogspot.com/.../sample-opc-client-using-opc-net-api.html