Click here to Skip to main content
15,888,351 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a user defined type [UDT] in a PLC, I am trying to access the type using the OPC.CPX item type.
How do I create the CPX item and define the structure for the UDT for example :
I have a user defined type 'Machine' in the PLC with
Machine.Start bool
Machine.Stop bool
Machine.HMIName string
Machine.Hours DInt
Machine.Params[] DInt32

I know how to get these as individual tag elements Opc.Da.Items , but how can I do this with a CPX type so I can treat the thing as an object that it is., rather than pieces of the object. [Consider if I have 1000 machines , I do not want to use 5,000 individual tags to read and write , and I also want to read as an object and write as an object etc..
- this makes it much easier for me to update my poco's that represent the UDT's as well.


Any help is appreciated thanks in advance.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900