LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Get Image Freezing

Hi everyone,

Using Labview 2016.

I'm trying to make a simple acquisition VI to run so I can use it as a SubVI later, but it always freezes and displays the Error -1074360293.

I believe that it may be quite easy to fix, but can't imagine what is wrong.

The printscreens are attatched below.

Please help me if you can.

Thanks

Oscar

0 Kudos
Message 1 of 8
(3,931 Views)

-Which camera are you using?

-The error says within the timeout IMAQdx was not getting any image.

-Can you check by using MAX and see you can capture images properly?

-You shouldn't be using IMAQdx Open camera and configuring inside loop.

-I believe you are stopping the vi by pressing Abort button which is not recommeded at all.

 

-Please check below links for free LabVIEW learning resources:

NI Learning Center

NI Getting Started

LabVEW Basics

LabVIEW Graphical Programming Course

Using the Context Help Window

Thanks
uday
0 Kudos
Message 2 of 8
(3,925 Views)

Hi udka, thanks for the attention.

I'm using a Logitech c270 USB-Web Cam (2 of them, actualy).

On MAX the cameras acquire images just fine

Why doesn't it get an image? Shouldn't IMAQ Create be creating them?

I deleted the While Loop so it can run a single time, and that way it works just fine.

But I'm using this VI as a SUBVI, and it usually freezes at Get Image inside one of the SUB VI's when the VI runs for a few times in a row.

I'm sending you some prints of the VI so you can understand better.

The other problem I have is getting the Image captured inside the SUBVI (when it works) to be displayed at the superior VI Frontal Panel. Maybe it's because both VIs are equal and the reference is the same ? I don't know, it just don't work.

My intention is to run it continuosly, that's why I didn't have a stop button, or something.. Would you suggest me to do that ?

 

Please help me again (:

Thanks

Oscar

 

Download All
0 Kudos
Message 3 of 8
(3,880 Views)
  • The Abort Execution button stops the VI immediately, before the VI finishes the current iteration. Aborting a VI that uses external resources, such as external hardware, might leave the resources in an unknown state by not resetting or releasing them properly. Design VIs with a stop button to avoid this problem.
  • IMAQ Create creates image reference but inside subvi only you are disposing it by IMAQ Dispose.
  • The While loop loop is meant to run continuously but until you end the loop gracefully with a boolean button.
  • Finally I suggest you to look at the tutorials I mentioned in my previous post. 
Thanks
uday
0 Kudos
Message 4 of 8
(3,877 Views)

The concept of an "Image" is very different in IMAQdx than what you may be used to thinking.  You probably think of an Image as "something you look at", perhaps represented as a 2D array of pixels.  But in IMAQdx, an Image, what you get (and need) with Create Image, is a buffer, a storage location for image data that can be manipulated, "written to" (for example, by a Camera) and "read from" (for example, to display on an "Image Display").  Think of it as similar to a Pointer to a Picture, not the Picture itself.

 

You may notice that many IMAQ functions require one or two Image inputs and outputs, usually shown as carried on a "bumpy" purple wire (sort of like a Path wire, but purple).  That's another visual indication that this is "something a little different".

 

With this as a hint, stop coding and "Write some Documentation".  Using words (in any spoken language), describe what you want to do, thinking about the (forgive the pun) Big Picture.  Don't get lost in the details.  Now think how you might implement some of these Big Steps in LabVIEW.  [Sometimes, having 3 Big Steps is best accomplished by having three sub-VIs, each of which does One Thing].

 

Bob Schor

0 Kudos
Message 5 of 8
(3,874 Views)

Hello again udka !

Thanks a lot for answering me..

 

First:

So, i changed the Abort for a more elegant solution for stoping the VI using an event. 

I have now 3 events 0, 1, 2.

0: "Main Event", activated by a Value Change (signaling) using an User Event.

1: "Stop this VI", activated by a Value Change of a Boolean control on the Front Panel

2: "Timeout", activated when the time between 2 events overcomes a value on the left top of the Event Structure. In this case  Time Span.

 

Second:

I'm now disposing the Image outside the SubVI and  being able to display it.

 

 

Although I made these modifications the Get Image keeps having the same problem, and sometimes even in the first execution... The Stop doesn't seem to work right away either..

 

I will take a more deep look at these tutorials but I cannot imagine why this "Get Image" problem keep occuring, I believe it's something on the SubVI.. 

Do you see something wrong in it ?

I am attatching printscreens of the modified VIs.

Please, please, shine a light on this problem... It should be simple but just isn't working..

 

Thanks in advance

Download All
0 Kudos
Message 6 of 8
(3,837 Views)

-Do you get any error? like the same timeout error you are getting?

-There are mainly three types of acquisition: Snap(single image), Grab(Continuous acquisition) and Sequence(Fixed number of images). Which one you are looking for?

-There are examples for each in LabVIEW->Help-> Search with above names.

-Grab function works in two modes: Wait for Next Buffer(Yes) means untill next acquired image is available it'll not finish and hence it is stuck there waiting for next acuired buffer image to be ready.

-If you keep no(False) then it returns whatever was acquired last. But whenever you go to grab it might return last acquired duplicate.

-So you keep mode to false and keep track of Buffer number it returns. If it is changed means you have to take that image else it is duplicate.

-In 2015 version i think labview introduced Last New mode which returns only the no returned buffer.

-If you want single image just use Snap method.

 

-I just realized we're still back there only two months ago!! https://forums.ni.com/t5/LabVIEW/How-to-trigger-multiple-producer-consumer-loop-simutaneously/m-p/33...

 

Thanks
uday
0 Kudos
Message 7 of 8
(3,826 Views)

It is extremely difficult for us to work with pictures of code (such as the .PNG files you attached).  To your credit, you have created multiple sub-VIs for your project.  Are they also contained within a LabVIEW Project file (.lvprog)?  If so, they are probably also in a single containing Folder.  If they actually are in one folder, then ask Windows to Compress the folder for you.  It will build a .ZIP file that contains all of your VIs.  Attach that, and we will have a much better view of your code and can provide better help to you.

 

Bob Schor

0 Kudos
Message 8 of 8
(3,807 Views)