11-21-2006 01:54 PM
@dowNow wrote:
Ha ha, no I do not have experience with sharing an image handle across
processes, I saw your post and thought I would join the question
because I need to do this too and I don't want to pass/copy the image
as a big string of bytes.
I will say, however about the escape characters, if you are passing the
string from a LabVIEW code module up to Locals, there is a setting in
the Specify Module dialog that allows you to set a LabVIEW string
control entry in the table to ASCII or binary, that might help getting
it into the Local correctly.
Another approach would be to pop open a floating LabVIEW window from
within your seqeunce/execution and display the image there and not on
the front panel of the OI.
11-22-2006 10:36 AM
11-22-2006 01:09 PM
11-27-2006 03:23 PM - edited 11-27-2006 03:23 PM
You can just use UIMessaging to pass the information back to the OI.
http://zone.ni.com/devzone/cda/tut/p/id/2898
http://zone.ni.com/devzone/cda/tut/p/id/4532
Regards,
Message Edited by Sam R on 11-27-2006 03:23 PM
11-28-2006 02:18 PM
I've managed to pass an image from one LabVIEW executable to another. Haven't compiled it into my Operator Interface as of yet:
SharedImageDLL.zip
----------------------------
Demonstrates passing an image from one LabVIEW executable to another through a Windows DLL.
Run "WriteImage.exe" and select an image file.
Run "ReadImage.exe and that image will be read out of memory and displayed.
SharedImageDLL.c - Use LabWindows/CVI to compile into a DLL.
Based on the code on MSDN "Using Shared Memory in a Dynamic-Link Library"
Modified to use byte arrays instead of strings. The problem with using a string is that the flattened Image image is loaded with NULL characters and processing stops when read. Because an array is used, the 'SetSharedMem' function needs to be passed the size of the array. The function 'GetBuffersize' was added so LabVIEW can initialize an array before requesting the array data.
Developed with:
LabVIEW 7.1
LabWindows/CVI 7.1
To run executables:
IMAQ 3.7.0 (make work with earlier versions, but "IMAQ Flatten to String" is required.
LabVIEW Run-Time 7.1
I was too deep into this to try the UI Message suggestion.
11-28-2006 03:45 PM
11-28-2006 04:53 PM
I guess I'm not sure on the terminology here. I thought I was using the TestStand API directly to try and transfer the Image data from the sequence to the OI . From what I now understand the UIMessaging is how I was tapping into the sequence to get the data. At any rate, I don't see how to make that work with and I needed the workaround above.
Did you try my example out?
11-29-2006 02:30 PM
11-29-2006 03:35 PM
11-30-2006 05:04 PM
You are correct Cabman. You will have to have LV code that will decode those characters that put the / in there. It should be simple to create that. Basically you just need to loop through and look for all the / in your code and the characters following the /. Let's say I do have /00 then just replace that with 00. This way you can still pass it as a UI message you just have to have the decoder in your OI to handle the string correctly.
I'm sorry this is a pain but for now that's how it is. The problem with this method is that in the future if TestStand handles strings differently then your OI will have to be modified.
Regards,