fdupont-epsilia commented on issue #1626:
URL: https://github.com/apache/plc4x/issues/1626#issuecomment-2470830447

   Follow up on the connection problem.
   
   I did some digging. Turns out the Beckhoff in production doesn't returns « 
basic types » (UDINT, USINT, REAL, BOOL, and more) in the dataTypeTable 
(ReservedIndexGroups.ADSIGRP_DATA_TYPE_TABLE_UPLOAD).
   « java.lang.NullPointerException » is the result of not finding « UDINT » 
when doing 
`SymbolicAdsTag("TwinCAT_SystemInfoVarList._AppInfo.OnlineChangeCnt", 
org.apache.plc4x.java.api.types.PlcValueType.UDINT`
   
   Doesn't seems to hit a size limit. Received everything declared in 
adsTableSizes.
   symbolCount: 1640, symbolLength: 226832, dataTypeCount: 213, dataTypeLength: 
175744, extraCount: 2000, extraLength: 11
   
   I would appreciation if anyone has idea why those types are missing.
   
   In preliminary test, adding them manually works. Could it break something?
   Will continue testing and adding other types during the day.
   
   Example of one, adding them at line 387 :
   
   
https://github.com/apache/plc4x/blob/729860ef9294c2871cb49a72ca73eb17eb71ba78/plc4j/drivers/ads/src/main/java/org/apache/plc4x/java/ads/protocol/AdsProtocolLogic.java#L387
   ```java
   String dataTypeName = "UDINT";
   if (!dataTypeTable.containsKey(dataTypeName))
   {
     dataTypeTable.put(dataTypeName, new AdsDataTypeTableEntry(
       120,// entryLength,
       1,// version,
       0,// hashValue,
       0,// typeHashValue,
       4,// size,
       0,// offset,
       19,// dataType,
       4225,// flags,
       0,// arrayDimensions,
       0,// numChildren,
       dataTypeName,// dataTypeName,
       "",// simpleTypeName,
       "",// comment,
       Collections.emptyList(),// arrayInfo,
       Collections.emptyList(),// children,
       new byte[]{-107, 25, 7, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 2, 0, 
15, 1, 68, 105, 115, 112, 108, 97, 121, 77, 105, 110, 86, 97, 108, 117, 101, 0, 
48, 0, 15, 10, 68, 105, 115, 112, 108, 97, 121, 77, 97, 120, 86, 97, 108, 117, 
101, 0, 35, 120, 102, 102, 102, 102, 102, 102, 102, 102, 0, 0, 0, 0})// rest)
     );
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to