Home > Net > C # through OPCAutomation development OPC
C # through OPCAutomation development OPC
Time:09-22
Code to connect server is successful, can be read to the server nodes, but call SyncRead method of data read times wrong where to look a lot of information can't get a wrong point, please everyone a great god action, attached code Public void kepProcess () { KepGroup=KepGroups. Add (" Group0 "); KepGroup. UpdateRate=250; KepGroup. IsActive=true; KepGroup. IsSubscribed=true;
//when KepGroup triggering event data change in KepGroup. DataChange +=new DIOPCGroupEvent_DataChangeEventHandler (KepGroup_DataChange); KepItems=KepGroup. OPCItems; Int [] temp=new int [2]. \ [0]=0; KepItems. AddItem (" Random Int1 ", 1); OPCItem bItem=KepItems. Item (1); Array serverHandles=temp (Array); An Array of values. Array Errors; Object the cancel; The Object Qualities; KepGroup. SyncRead ((short) OPCAutomation. OPCDataSource. OPCCache, serverHandles. Length, ref serverHandles, out values, out Errors, out Qualities, out cancel); }