Hi,
If you are only passing a single array, you can pass the array in the ActiveX field.
So you can use the API method "Post UI Message", and pass the array directly into the ActiveX field. (Locals.MyArray for example).
In your callback function for getting your UI message, here is the code you want to use:
HRESULT CVICALLBACK ApplicationMgr_OnUserMessage(CAObjHandle caServerObjHandle,
void *caCallbackData, TSUIObj_UIMessage uiMsg)
{
LPUNKNOWN tempActiveXRef;
VARIANT tempTSWaveform;
VARIANT tempVariant = CA_VariantEmpty();
CAObjHandle TSWaveform = 0;
double * measurementData;
ERRORINFO errorInfo;
//Get waveform ActiveX data
TS_UIMessageGetActiveXData (uiMsg, NULL, &tempActiveXRef);
//Convert LPUNKNOWN to Variant
tempTSWaveform = CA_VariantIUnknown (tempActiveXRef);
//Convert variant to object handle
CA_VariantConvertToType (&tempTSWaveform, CAVT_OBJHANDLE, &TSWaveform);
//Get contents of waveform
TS_PropertyGetValVariant (TSWaveform, &errorInfo, "", 0, &tempVariant));
// Convert the one-dimensional Safe Array passed in the Variant parameter
// into a dynamically allocated C-style array.
CA_VariantGet1DArray (&tempVariant, CAVT_DOUBLE, measurementData, NULL);
// Frees the memory
CA_VariantClear(&tempTSWaveform);
CA_VariantClear(&tempVariant);
CA_FreeMemory(measurementData);
}
Hope this helps!
Allen P.
TestStand R&D