@@ -265,7 +265,7 @@ func (m *Connection) parsePlcValue(dataType driverModel.AdsDataTypeTableEntry, a
265265 if len (arrayInfo ) > 0 {
266266 // This is an Array/List type.
267267 curArrayInfo := arrayInfo [0 ]
268- arrayItemTypeName := dataType .GetDataTypeName ()[strings .Index (dataType .GetDataTypeName (), " OF " )+ 4 :]
268+ arrayItemTypeName := dataType .GetSecondaryName ()[strings .Index (dataType .GetSecondaryName (), " OF " )+ 4 :]
269269 arrayItemType , ok := m .driverContext .dataTypeTable [arrayItemTypeName ]
270270 if ! ok {
271271 return nil , fmt .Errorf ("couldn't resolve array item type %s" , arrayItemTypeName )
@@ -286,10 +286,10 @@ func (m *Connection) parsePlcValue(dataType driverModel.AdsDataTypeTableEntry, a
286286 startPos := uint32 (rb .GetPos ())
287287 curPos := uint32 (0 )
288288 for _ , child := range dataType .GetChildren () {
289- childName := child .GetPropertyName ()
290- childDataType , ok := m .driverContext .dataTypeTable [child .GetDataTypeName ()]
289+ childName := child .GetMainName ()
290+ childDataType , ok := m .driverContext .dataTypeTable [child .GetSecondaryName ()]
291291 if ! ok {
292- return nil , fmt .Errorf ("couldn't find data type named %s for property %s of type %s" , child .GetDataTypeName (), childName , dataType .GetDataTypeName ())
292+ return nil , fmt .Errorf ("couldn't find data type named %s for property %s of type %s" , child .GetSecondaryName (), childName , dataType .GetSecondaryName ())
293293 }
294294 if child .GetOffset () > curPos {
295295 skipBytes := child .GetOffset () - curPos
@@ -299,7 +299,7 @@ func (m *Connection) parsePlcValue(dataType driverModel.AdsDataTypeTableEntry, a
299299 }
300300 childValue , err := m .parsePlcValue (childDataType , childDataType .GetArrayInfo (), rb )
301301 if err != nil {
302- return nil , errors .Wrap (err , fmt .Sprintf ("error parsing propery %s of type %s" , childName , dataType .GetDataTypeName ()))
302+ return nil , errors .Wrap (err , fmt .Sprintf ("error parsing propery %s of type %s" , childName , dataType .GetSecondaryName ()))
303303 }
304304 plcValues [childName ] = childValue
305305 curPos = uint32 (rb .GetPos ()) - startPos
@@ -309,7 +309,7 @@ func (m *Connection) parsePlcValue(dataType driverModel.AdsDataTypeTableEntry, a
309309 // This is a primitive type.
310310 valueType , stringLength := m .getPlcValueForAdsDataTypeTableEntry (dataType )
311311 if valueType == apiValues .NULL {
312- return nil , errors .New (fmt .Sprintf ("error converting %s into plc4x plc-value type" , dataType .GetDataTypeName ()))
312+ return nil , errors .New (fmt .Sprintf ("error converting %s into plc4x plc-value type" , dataType .GetSecondaryName ()))
313313 }
314314
315315 adsValueType , ok := apiValues .PlcValueTypeByName (valueType .String ())
0 commit comments