05/17/2017
Hi Nathan,
I have a requirement where I am writing historical values back to the OPC HDA. I see how it is done in the DA but I guess it will not be the same. I am trying the below code but it doesnt seem to do a "replace". Please can you help me out here.
Opc.ItemIdentifier identifier = new Opc.ItemIdentifier("Saw-toothed Waves.Int1"); //Tag
Opc.Hda.ItemValue item = new Opc.Hda.ItemValue();
item.Value = 777; // This is the value i want to write
item.Quality = Opc.Da.Quality.Good;
item.Timestamp = new DateTime(2017, 05, 24, 16, 13, 20,017);
Opc.Hda.ItemValueCollection collection = new Opc.Hda.ItemValueCollection(identifier);
collection.Add(item);
List<Opc.Hda.ItemValueCollection> coll = new List<ItemValueCollection>();
coll.Add(collection);
ResultCollection[] cll = _hdaServer.Replace(coll.ToArray()); //This doesnt work it gives me an INVALIDRESPONSE exception.
Please help me out
-Yatindra
Hi Yatindra, first I need you to confirm that the OPC Server you are trying to write to supports the needed HDA call. It looks like you are trying to do a replace call on the Matrikon OPC Simulation server. That server won't allow you to write HDA to it.
Rod
Rod Stein Manager of Technology Matrikon OPC http://www.matrikonopc.com
05/17/2017
Rod,
Thanks for your reply.
I believe you can use the Matrikon simulation server as a historian for storing rolling buffer of 100 tag values. I am able to successfully use the Matrikon HDA explorer to replace and insert values to the server. Are you saying that the OpcNetApi doesnt have the required methods to write to the server like the HDA explorer.
yatindra
1 Guest(s)