WriteUDT

From AdvancedHMI
Jump to: navigation, search

EthernetIPforCLXCom - WriteUDT

Used to write all data to a UDT in as few packets as possible using a Structure or Class that mimics the UDT. This is an extremely fast and efficient method to write a large amount of mixed data. NOTE : Requires Version 3.99x or higher

ControlLogix to .NET Data Type Equivalent

DINT Int32
LINT Int64
INT Int16
SINT SByte
BOOL Boolean
REAL Single
LREAL Double
STRING String

Code Samples

'* Writing all UDT data
'* First a Class or Structure is needed to hold the data
'* This Class/Structure must mimic the UDT

Public Class MyUDT
   Public DINTTag As Int32
   Public LINTTag As Int64
End Structure


Dim MyStructureInstance as MyUDT
MyStructureInstance.DINTTag=1234
MyStructureInstance.LINTTag=5678
MyValue=EthernetIPForCLXCom1.WriteUDT("MyUDTTag",MyStructureInstance)


More code samples can be found here:

https://github.com/AdvancedHMI/AdvancedHMICodeSamples