# ADS ## DataTypes TwinCAT uses some DataTypes that have to be converted when receiving values from a PLC. The equivalents in JAVA are noted below with the respective function to use for conversion. For more information refer to https://infosys.beckhoff.com/index.php?content=../content/1031/tcplccontrol/925445771.html&id= | DataType in ADS | Converts to Java Primitive | Size in Bits | Size in Bytes | Convert Function | | --------------- | -------------------------- | :----------: | :--------------------------------: | ------------------------- | | BOOL | Boolean | 8 | 1 | Convert.ByteArrToBool() | | BYTE | Byte | 8 | 1 | Convert.ByteArrToByte() | | WORD | | 16 | 2 | | | DWORD | | 32 | 4 | | | SINT | | 8 | 1 | | | USINT | | 8 | 1 | | | INT | Short | 16 | 2 | Convert.ByteArrToShort() | | UINT | Short | 16 | 2 | Convert.ByteArrToShort() | | DINT | Int | 32 | 4 | Convert.ByteArrToInt() | | UDINT | Int | 32 | 4 | Convert.ByteArrToInt() | | REAL | Float | 32 | 4 | Convert.ByteArrToFloat() | | LREAL | Double | 64 | 8 | Convert.ByteArrToDouble() | | STRING | | - | 1 pro Zeichen + 1 Nullterminierung | Convert.ByteArrToString() | | TIME | | 32 | 4 | | | TOD | | 32 | 4 | | | DATE | | 32 | 4 | | | DT | | 32 | 4 | |