10-31-2014 06:52 PM
Snippet
In the following code segment, i am trying to send a frontendcallback an array of struct items. in the callback i added a msgbox to show what is in the stuct at the sequence. when i call this frontend callback in a sequence and pass the array of objects from teststand, i see the msgbox show up for each item in the array with its current values. when i call this from my user interface, the msgbox shows up once and all variables are black.
why is teststand not able to unpack my container? i sent the same container from teststand to the user interface and it unpacked the same way im packing it, below.
so what am i missing?
PropertyObject ArgContainer = Eng.NewPropertyObject(PropertyValueTypes.PropValType_Container, true, "MYARRAYITEMS", 0); PropertyObject[] ArgListArray = new PropertyObject[MAYARRAY.Count]; ArgContainer.SetNumElements(MYARRAY.Count, 0); // loop here for each MYARRAY Item found in list. for (int index = 0; index < MYARRAY.Count; index++) { ArgListArray[index] = Eng.NewPropertyObject(PropertyValueTypes.PropValType_Container, false, "", 0); ArgListArray[index].Name = ""; ArgListArray[index].NewSubProperty("ITEMA", PropertyValueTypes.PropValType_Number, false, "", 0); ArgListArray[index].SetValNumber("ITEMA", 0, index); ArgListArray[index].NewSubProperty("ITEMB", PropertyValueTypes.PropValType_Boolean, false, "", 0); ArgListArray[index].SetValBoolean("ITEMB", 0, Eil[index].Enabled); ArgContainer.SetPropertyObjectByOffset(index, 0x1, ArgListArray[index]);
}
Eng.CallFrontEndCallbackEx("MYFRONTENDCALLBACKID", ArgContainer);
all my callbacks which have a single item, not in an array are received correctly and work. but when i use the second container everything is misinterpretended on the sequence end.
thanks in advance.