Need to write values to OPC HDA|Classic OPC: DA, A&E, HDA, XML-DA, etc.|Forum|OPC Foundation

Avatar
Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
Lost password?
sp_Feed sp_PrintTopic sp_TopicIcon
Need to write values to OPC HDA
Avatar
Yatindra Kamath
Member
Members
Forum Posts: 3
Member Since:
05/17/2017
sp_UserOfflineSmall Offline
1
05/24/2017 - 04:00
sp_Permalink sp_Print

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

Avatar
Yatindra Kamath
Member
Members
Forum Posts: 3
Member Since:
05/17/2017
sp_UserOfflineSmall Offline
2
05/24/2017 - 21:53
sp_Permalink sp_Print

Please can someone help me here? I am using the OpcNetApi assemblies

Avatar
Rod Stein
Canada
Member
Members
Forum Posts: 27
Member Since:
04/01/2014
sp_UserOfflineSmall Offline
3
05/25/2017 - 08:34
sp_Permalink sp_Print

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

Avatar
Yatindra Kamath
Member
Members
Forum Posts: 3
Member Since:
05/17/2017
sp_UserOfflineSmall Offline
4
05/25/2017 - 08:56
sp_Permalink sp_Print

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

Forum Timezone: America/Phoenix
Most Users Ever Online: 510
Currently Online: Peter Huisman, Ahmad Qureshi
Guest(s) 68
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 10
Topics: 1396
Posts: 4716