04-22-2012 01:19 PM
I modify the teststand simple operator interface for labview, passing image data from teststand to labview gui by posting ui message. I want show the image on gui. but it dosen't show the image and there are no error after building.
I holpe somebody can give me help, thank you in advance.
for detail please see the attachment.
Labview2010,Teststand2010
04-23-2012 09:48 AM
Are you trying to pass binary image data as string data? If so you need to use SetValBinary and GetValBinary when passing binary data as a string. Storing binary data in strings is not a standard thing to do so requires some additional processing.
Are you getting the image from a VI? If so inside your VI do something like the following:
myStringRef = Engine.NewPropertyObject(PropValType_String, false, "", 0);
myStringRef.SetValBinary("", 0, LVStringvalConvertedToAnArrayOfBytes);
thread.PostUIMessageEx(myEventCode, 0, myStringRef.GetValString("", 0), NULL, true);
Close myStringRef
From inside your UI do something like:
myStringRef = Engine.NewPropertyObject(PropValType_String, false, "", 0);
myStringRef.SetValString("", 0, msg.StringData);
LVByteArray = myStringRef.GetValBinary("", 0);
Close myStringRef
// Do whatever you need to with LVByteArray.
Hope this helps,
-Doug
04-24-2012 04:29 AM
Thank you for your replay.
Actually, I want to use LabVIEW and Teststand to setup a vision testing system.
first, I write the sequence using VIs of NI vision tools. it works well.
but, the next step, I want to show the image processing in the sequence steps to user. so the operator interface(OI) need to display the image in real time. I add a image display control in the operator interface, and them I add a "RunState.Thread.PostUIMessageEx" function in VI to post the image reference to operator interface.
Here is a problem, the data type of image reference in Teststand is LabVIEWIOControl which consists of Device Name(Data type is ASCII string) and Session Number(Data type is number(U32)), and the "PostUIMessageEx" function does not support the LabVIEWIOCantrol.
So the Operator Interface need image reference data, but teststand can't provide, it only can provide the Device Name of string data type.
OK, if posting the Device Name to OI, the Device Name can be cast to image reference. the OI can display the image. all of this is in the labview development enviroment.
but after building a *.exe, It doesn't work. and there are no error,too.
04-24-2012 09:37 AM
To work in an exe you probably need to make sure both your exe and VIs are using the same runtime engine (and running in the same process). You probably need to load and run your VIs in your teststand steps using the correct version of the runtime engine rather than the development environment.
Hope this helps,
-Doug