NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

It doesn't work after building for passing image data from teststand to labview gui

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

0 Kudos
Message 1 of 4
(3,126 Views)

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

0 Kudos
Message 2 of 4
(3,112 Views)

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.

 

0 Kudos
Message 3 of 4
(3,105 Views)

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

0 Kudos
Message 4 of 4
(3,099 Views)