LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

"not an image" using reenterant subvi

Solved!
Go to solution

I would like to save four images (i16 array, typically 250*250) to tiff format.

 

To enhance the speed of saving, I used parallel structure (with different filename) and reenterant execution option in saving subvi.

 

In this case, I met the error "not an image" in "write tiff.vi".

Of course, when I used serial structure (released reenterant), four images were saved without this error.

 

I attach my demonstration this. (conveniently, I used dbl array but I believe it is not related to this error.)

Please run "not an image.vi" to check my problem.

 

Is it bug of labview or hard to manage four images simultaneously? 

 

labmaster.

*)source codes of Labview 8.6

Message Edited by labmaster on 05-31-2009 01:11 PM
Message Edited by labmaster on 05-31-2009 01:12 PM
0 Kudos
Message 1 of 5
(2,629 Views)
You are assuming the IMAQ VIs can be used in a reentrant manner. I don't have IMAQ, but I doubt very much this is the case. When you create a reentrant VI you must make sure that any subVIs that are used can be used in a reentrant manner.
0 Kudos
Message 2 of 5
(2,605 Views)

I'm worrying about the possibility.

I had better wait for NI's reply to confirm it. 

 

0 Kudos
Message 3 of 5
(2,595 Views)
Solution
Accepted by topic author labmaster

I haven't opened your VI, but here's something I've learned about vision.

 

Many of the vision functions can be used at the same time, to my knowledge. However, you have to remember that LabVIEW Vision is very tight with how it handles images in memory. If you're using the same VI each time, then it is likely that you are using the same image name for the IMAQ Create.VI (IMAQ Create has a string input tht defines how the image is stored in memory). Here's the problem: If the name is the same in each VI, then each VI is working on the same memory location each time. Therefore, if an image is in a different state in another VI, you can cause an error. At the minimum, you run the risk of each VI using one image, rather than each working independently.

 

If the VI's are used serially, this wouldn't happen because you would reallocate the memory every time, and only after you finished working on the previous image.

 

My recommendation (unless someone suggests something better) is to allow the SubVi's to have a string input, so that you can wire a unique name to each image as the VI's run. This should allow the programs to run in parallel.

0 Kudos
Message 4 of 5
(2,593 Views)

music2131 is correct. You are using the same IMAQ image string to identify your four images. Turn the string into a control and provide a unique string to each call of the subvi.

I tried this and it corrected the error.

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 5 of 5
(2,571 Views)