NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Using NI IMAQ Vision Library Add-on within TestStand

I have set the adapter type to LabVIEW and am calling VI's from the
..\LabVIEW 7.0\vi.lib\vision\driver\basic.llb

I am trying to call "IMAQ Create" to create an image buffer. The
output parameter is a "New Image" which is the reference number of the
buffer that was created. If I create a local variable
"Locals.imaqImage" which is a number then I get an error that it is an
invalid parameter type.

The LV 7.0 Vision Development kit has the parameter as an Image
Reference (these typically have a default value of U32).

I need to be able to create the buffers so that I can pass them into
the IMAQ Snap functions. I have succesfully performed these operations
in LV but I am trying to create a sequence by implementing the same
log
ic in TestStand.

NOTE: These functions are not part of the IMAQ driver. Those functions
begin with the prefix img
0 Kudos
Message 1 of 8
(4,978 Views)
Unfortunately, the IMAQ image object isn't storable inside of TestStand. Storing a 2D array isn't viable either, a) because of size, and b) because you'd be permanently swapping backwards and forwards from image to 2D array, and that adds a lot of overhead.
The workaround is to over-wrap the vi's you're calling, and if you want to store the image reference do so into a global variable. That way you can make separate calls like IMAQ Create, followed by IMAQ Snap, and they'll reference the same global variable.
This works, even if you compile the .vi's you make into a dll.

Hope that helps

Sacha Emery
Applications Engineer
National Instruments UK
// it takes almost no time to rate an answer Smiley Wink
Message 2 of 8
(4,974 Views)
That's not a good work around since there are alot of VI's in IMAQ and I am using approximately 50. This adds considerably to the development time and cost.

Will this be addressed in future versions of TestStand? I have interoperability within other toolkits, why was this not addressed in TS 3.0?
0 Kudos
Message 3 of 8
(4,974 Views)
Hello,

I need to store image-references (not the whole image)in TestStand to.
These Image references are string based (based on the name of the image you give to the imaq create.vi)

So I tried to cast the image reference to a string, store it, read it from an other step an cast it to an image. At my PC it works, but at an other once it doesn't work (error text "IMAQ Get
Image Info. Not an image."; Error Code: 1074396120)

So I took the "ReadFile Example.vi" and inserted the Type Cast with the same effect. It works at my PC and at on other it doesn't work..

What's happen?

Ciao TPoint
0 Kudos
Message 4 of 8
(4,897 Views)
The IMAQ image reference is not a U32. It contains a lot more data than a U32. However, there is a trick you can use to pass the image between steps.

You will need to use Flatten To String in your VI. Pass this string as an output parameter. In TestStand, you will need to make sure you accept this parameter as a Binary String rather than ASCII string. The flattened version of this string occasionally contains a null character, so TestStand will properly escape it if you use the Binary String configuration on the Configure VI pane. You can store this variable in a string, and pass it back to another LabVIEW step where you can unflatten the string there. Hope this helps!

The reason it may not be working on another machine could be that you have different adapter settings. LabVIEW will attempt to clean up references that were left open, and that may be the case for what you are expiriencing. Is there any difference in the adapter settings on each machine? (LV Runtime vs. Development)
Allen P.
NI

Message Edited by AllenP on 06-03-2005 01:09 PM

0 Kudos
Message 5 of 8
(4,888 Views)
Hi,

There is an example found here
It might be useful.

Regards
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 6 of 8
(4,877 Views)
Hello there,

The solution is easy but as always hidden. Flatten to string converts the whole image. The resulting string is very long.. It's faster to handle references.

In the Vision Library (vi.lib\vision\DatatypeConversion.llb\IMAQ Image Datatype to Image Cluster.vi..) is a VI that converts the image to cluster of a string and an U32.. I don't know why this VI isn't in the type palettes. But it works,

thank You

TPoint
Message 7 of 8
(4,868 Views)

Hi TPoint,

A very big THANKS to you 🙂 It works well. I looked for this solution since days...

0 Kudos
Message 8 of 8
(4,371 Views)