beckhoff — 6.5 Reading out the PLC variable declaration of a single variable

Samples: TcJavaToAds bb.putShort(transfer.getShortVal()); bb.putInt(transfer.getIntVal()); bb.put(transfer.getByteVal()); bb.putDouble(transfer.getDoubleVal()); bb.putFloat(transfer.getFloatVal()); // Write struct to PLC err = AdsCallDllFunction.adsSyncWriteReq(addr, 0x4020, // Index Group 0x0, // Index Offset 19, dataBuff); if(err!=0) { System.out.println("Error: Write request: 0x" + Long.toHexString(err)); } else { System.out.println("Success: Write struct!"); } // Close communication err = AdsCallDllFunction.adsPortClose(); if(err!=0) { System.out.println("Error: Close Communication: 0x" + Long.toHexString(err)); } } } The object to be transferred:

public class TransferObject { private short shortVal; private int intVal; private byte byteVal; private double doubleVal; private float floatVal; public TransferObject() { this.shortVal = Short.MAX_VALUE; this.intVal = Integer.MIN_VALUE; this.byteVal = 3; this.doubleVal = 4.1234; this.floatVal = 5.4321f; } public short getShortVal() { return shortVal; } public int getIntVal() { return intVal; } public byte getByteVal() { return byteVal; } public double getDoubleVal() { return doubleVal; } public float getFloatVal() { return floatVal; } } 6.5 Reading out the PLC variable declaration of a single variable The following information is transferred when accessing the variable declaration:

Variable name Data type TX1000 35 Version: 1.1