LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

illegal operation of IMAQ for LabView5.0

i am using the Imaq for LabView to do Image analysis. i have develop a
simple program which just use IMAQ Snap.vi to aquire a single image and
then do a seqence of image analysis, it does work well. But when i try
to put it in a for loop and coutinuously excute it for up to 100 times,
it is always interrupted in the tenth excution and a message box is
poped up saying "the program has performed an illegal operation and will
be shut down", i have checked everythings which could possibly cause
this trouble and still can't find out. if you have the relative
experience or suggestion, be sure let me know.

thanks a lot!

Jacob


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
0 Kudos
Message 1 of 4
(4,789 Views)
i checked it again and find the error source is the IMAQ snap.vi,
the error code is "-1074397179" which means an "invalid parameter #1",
but i still can't find the solutiion. i am using PCI-1408
and IMAQ Vision for LabView 4.1.1. i appreciate any help.

Jacob
In article <7kcl4m$87o$1@nnrp1.deja.com>,
jacobzj@my-deja.com wrote:
>
>
> i am using the Imaq for LabView to do Image analysis. i have develop a
> simple program which just use IMAQ Snap.vi to aquire a single image
and
> then do a seqence of image analysis, it does work well. But when i try
> to put it in a for loop and coutinuously excute it for up to 100
times,
> it is always interrupted in the tenth excution and a message box is
> poped up saying "the program has performed an illegal operation and
will
>
be shut down", i have checked everythings which could possibly cause
> this trouble and still can't find out. if you have the relative
> experience or suggestion, be sure let me know.
>
> thanks a lot!
>
> Jacob
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
>


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
0 Kudos
Message 2 of 4
(4,789 Views)
Jacob,
I am not 100% sure why you are getting the error that you are getting
but one thing to check is if you are running these vi's in
multithreaded mode. IMAQ Vision 4.1.1 was released before LabVIEW 5.0
(the first to introduce multithreading) and therefore these libraries
are not multithread safe. National Instrument's next IMAQ Vision
release will have libraries that are multithread safe.

Another thing that may help:
Instead of using a snap in a loop which configures the board allocates
and deallocates memory each time you run through the loop, try doing all
memory management outside of the loop. This can be done simply, by
looking at the grab example that ships with NI-IMAQ. You will notice
that there is a loop around the vi called IMAQ Grab Acquire. You can
send the output of this vi to your image processing functions.

While this may work better, it is generally safer to use a "ring" as
opposed to a grab. Since a grab uses only one buffer, it is possible
that it is being overwritten, while we are in the process of copying
the data out. A ring works the same as a grab, but instead, we have
multiple buffers which help in cases where our copying of the buffers
may be slow.

I hope this helps,
Tony Iglesias
IMAQ Product Support Engineer
National Instruments

In article <7kdv8o$n3r$1@nnrp1.deja.com>,
jacobzj@my-deja.com wrote:
> i checked it again and find the error source is the IMAQ snap.vi,
> the error code is "-1074397179" which means an "invalid parameter #1",
> but i still can't find the solutiion. i am using PCI-1408
> and IMAQ Vision for LabView 4.1.1. i appreciate any help.
>
> Jacob
> In article <7kcl4m$87o$1@nnrp1.deja.com>,
> jacobzj@my-deja.com wrote:
> >
> >
> > i am using the Imaq for LabView to do Image analysis. i have develop
a
> > simple program which just use IMAQ Snap.vi to aquire a single image
> and
> > then do a seqence of image analysis, it does work well. But when i
try
> > to put it in a for loop and coutinuously excute it for up to 100
> times,
> > it is always interrupted in the tenth excution and a message box is
> > poped up saying "the program has performed an illegal operation and
> will
> > be shut down", i have checked everythings which could possibly
cause
> > this trouble and still can't find out. if you have the relative
> > experience or suggestion, be sure let me know.
> >
> > thanks a lot!
> >
> > Jacob
> >
> > Sent via Deja.com http://www.deja.com/
> > Share what you know. Learn what you don't.
> >
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
>


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
0 Kudos
Message 3 of 4
(4,789 Views)
Tony, thank you very much,it's very imformative, i still have
some problem to be found out.

> I am not 100% sure why you are getting the error that you are getting
> but one thing to check is if you are running these vi's in
> multithreaded mode. IMAQ Vision 4.1.1 was released before LabVIEW 5.0
> (the first to introduce multithreading) and therefore these libraries
> are not multithread safe. National Instrument's next IMAQ Vision
> release will have libraries that are multithread safe.

I recently found out the error source is the "IMAQ Attribute.vi", in
which the Global VI "RefNum Array" has the definition with a predefined
maximum size of 10, i tried to increase it to 120, but the problem is
still there and the error code is the same.

> An
other thing that may help:
> Instead of using a snap in a loop which configures the board allocates
> and deallocates memory each time you run through the loop, try doing
all
> memory management outside of the loop. This can be done simply, by
> looking at the grab example that ships with NI-IMAQ. You will notice
> that there is a loop around the vi called IMAQ Grab Acquire. You can
> send the output of this vi to your image processing functions.

since the grab.vi use a while loop, I can't send the output image to my
image processing function unless stop the grab acquisition, what i want
to do is that continually acquire the image and output one image to the
image processing function at the fixed interval.

hope you could give me some hint, I really appracite your help.

Jacob
University of illinois



Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
0 Kudos
Message 4 of 4
(4,788 Views)