LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Access violation during IMAQ to variant conversion

Labview Crash Report :

Exception: Access violation (0xC0000005) at EIP=0x0000000141924FCB

Version: 14.0.1f3 (64-bit)

 

Easy to reproduce with LabVIEW 2014 64bits, Windows 7 :

1) Create one or more IMAQ Images (no matter image type or size)

2) Create then delete one or more images

3) Create more than 255 new images.

4) Try to convert first created in 1) into variant

5) Crash

 

I joined crash report and VI to reproduce.

Download All
0 Kudos
Message 1 of 16
(4,369 Views)

@amounier wrote:

Labview Crash Report :

Exception: Access violation (0xC0000005) at EIP=0x0000000141924FCB

Version: 14.0.1f3 (64-bit)

 

Easy to reproduce with LabVIEW 2014 64bits, Windows 7 :

1) Create one or more IMAQ Images (no matter image type or size)

2) Create then delete one or more images

3) Create more than 255 new images.

4) Try to convert first created in 1) into variant

5) Crash

 

I joined crash report and VI to reproduce.


Not sure about the reason, But Try to Swap the values of Build Array Before Closing IMAQ ref.

I tried and crash didnt happened during Swap

 

 

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 2 of 16
(4,347 Views)

Sorry I didn't explain the context.

For my application I need to acquire, process, display a lot of images (more than 255) from different cameras.

I need to allocate/deallocate some images during initi/uninit, and others between acquisitions to resize buffers.

I just used variants to pass data into more generic functions, so I solved crash problem using directly IMAQ images for the moment.

 

For me there is clearly a bug that's why I report this simple VI. I just hope the problem is only located into variant conversion and IMAQ data is not corrupted...

0 Kudos
Message 3 of 16
(4,329 Views)

@amounier wrote:

I just used variants to pass data into more generic functions, so I solved crash problem using directly IMAQ images for the moment.

 


You have, in fact, solved the problem.  An IMAQ "image" is not really an "image" (that is, something that has a certain number of pixels of a certain type), but is more akin to a "pointer to memory" where images are stored.  As such, it doesn't make logical sense to try to turn them into variants, which probably explains the crash when you do so.

 

If you are passing an IMAQ Image into a processing routine, you can use IMAQ functions to find out whatever you need to know about the particular Image being carried by this wire, and adjust your processing code accordingly.

 

Bob Schor

0 Kudos
Message 4 of 16
(4,318 Views)

Sorry Bob but I can't really aggree. I have, in fact, around the problem.

Variant data purpose is to convert "any" LabVIEW data type into more generic. A pointer or an IMAQ image are not exception.

In my exemple I show that fonctionality is working for 1 image, but if you create then delete Elsewhere in the program 256 images, function doesn't work any more. I conclude there's just a LabVIEW memory management problem, in IMAQ or variants data.

0 Kudos
Message 5 of 16
(4,294 Views)

I found another way to crash LabVIEW in similar conditions : update value of IMAQ control by reference.

Again it's working fine with 255 images, and crash with 256.

 

I updated the VI with new crash demo (save your work before using it).

0 Kudos
Message 6 of 16
(4,167 Views)

First of all I dont find any reason of using VARIANT.

Second....(lets keep it in the code)..you might find the answer in the code itself.

Please let me know this crashes or not..!

0 Kudos
Message 7 of 16
(4,158 Views)

Thx for your answer (even if I feel a little assaulted), but I can't open your VI. Can you save it for lv2014 ?

0 Kudos
Message 8 of 16
(4,152 Views)

For a while I also thought of whats going on.!!

Message 9 of 16
(4,149 Views)

Nice ! It doesn't crash with IMAQ dispose "All Images" option.

I still don't understand why it's working with 254 images and not with 256.

Hypothesis : Maybe without the option and with a lot of images, LV doesn't trace well images already unallocated, then at software closure attemps to unallocate again... and crash.

Using this option at the end of the main programm seems a good way to ignore the memory probem.

 

Thx your comment was usefull.

0 Kudos
Message 10 of 16
(4,128 Views)