Hey Liam,
An array can only be one type of element, and you are attempting to create an array that contains multiple different data types. The following two lines create IO (container) which contains IOToBeProcessed (array of containers) -
ThisContext.AsPropertyObject.SetPropertyObject("Locals.IO",PropOption_InsertIfMissing,ThisContext.Engine.NewPropertyObject(PropValType_Container,False,"",0)), ThisContext.AsPropertyObject.SetPropertyObject("Locals.IO.IOToBeProcessed",PropOption_InsertIfMissing,ThisContext.Engine.NewPropertyObject(PropValType_Container,True,"",0)),
Therefore, to access or create new properties within the array of containers, you will have to index the array and create an element within each specific container in the array. For example, in the following three lines, within the first container in the array (element 0), Name and Modbus Address properties are being added to that container, and to the second container in the array (element 1), Type is being added.
Locals.SetValString("IO.IOToBeProcessed[0].Name",PropOption_InsertIfMissing,""), Locals.SetValNumber("IO.IOToBeProcessed[0].Modbus Address",PropOption_InsertIfMissing,0), Locals.SetValString("IO.IOToBeProcessed[1].Type",PropOption_InsertIfMissing,""),
See the variables window during runtime: