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

Samples: TcJavaToAds if(err!=0) { System.out.println("Error: AdsSyncReadReq: 0x" + Long.toHexString(err)); } else { ByteBuffer bb = ByteBuffer.allocate(0); bb = ByteBuffer.wrap(uint32Buff.getByteArray()); bb.order(ByteOrder.LITTLE_ENDIAN); System.out.print("Value:\t\t"); // In case of an array print each value. for (int i = 0; i System.out.print(bb.getInt() + "\t"); System.out.println("\n"); } break; default: // Iterate through ValueString[] and try to find a // datatype-match for (int i = 0; i if (adsDatatypeString[i].getValue() == adsSymbolEntry.getDataType()) { System.out.println("Datatype:

" + "\t" + adsDatatypeString[i].getLabel()); } } break; } } // User chooses to repeat process or not System.out.print("Exit(y/n): "); buffReader=new BufferedReader(new InputStreamReader(System.in)); userInput = buffReader.readLine(); if("y".equals(userInput.toLowerCase())) break; } catch (Exception ex) { System.out.print(ex.getMessage()); } } try { buffReader.close(); } catch (Exception ex) { System.out.print(ex.getMessage()); } // Close communication err = AdsCallDllFunction.adsPortClose(); if(err!=0) { System.out.println("Error: Close Communication:

0x" + Long.toHexString(err)); } } } public class ValueString { private int value; private String label; ValueString(int value, String label) { this.value = value; this.label = label; } public int getValue() { return value; } public String getLabel() { TX1000 38 Version: 1.1