Difference between revisions of "WriteUDT"

From AdvancedHMI
Jump to: navigation, search
(Created page with " == '''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 extremel...")
 
 
Line 38: Line 38:
 
  '* This Class/Structure must mimic the UDT
 
  '* This Class/Structure must mimic the UDT
 
<code>
 
<code>
  Public Structure MyUDT
+
  Public Class MyUDT
     DINTTag as Int32
+
     Public DINTTag As Int32
     LINTTag as Int64
+
     Public LINTTag As Int64
 
  End Structure
 
  End Structure
  

Latest revision as of 17:39, 7 May 2019

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