LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

A strange question when configuring a Gige camera with IMAQdx.

Hello,

We are trying to acquire images from a Gige camera using the Labview 2018 (32-bit) and IMAQdx 18.5.To open the shutter, I used the Enumerate Attributes and Property Node modules to set the Pulse Rev value as shown below. However, I heard nothing and only a black screen was shown. So, I turned on the Highlight Execution and saw how it worked. To my surprise, I heard a voice of clatter and a normal image was received. But when I turned off the Highlight Execution, I could not get the image again. What should I do? Thanks in advance.

 

VI.jpg

0 Kudos
Message 1 of 18
(4,162 Views)

Please take pity on those of us using laptops who don't have 27" screens to see the tiny images you have squeezed into your picture.  Instead, attach the VI itself, allowing us to see everything at a comfortable viewing scale (even if we have to scroll around), to use the "Help" if there's an unfamiliar function, and maybe even try out pieces of your code.

 

So if you run at full speed, you see nothing, but if you run very slowly, images appear.  What does that suggest?

 

What Frame Rate does your camera support?  How large are the Images?  Where are the buffers?  What Camera are you using (not all Cameras are created Equal)?  What is the "Pulse Rev" value, and how do you know you are setting it?

 

You do know, I suppose, that LabVIEW Vision is one of the more difficult and underdocumented part of LabVIEW, right?  It's often a struggle ...

 

Bob Schor

0 Kudos
Message 2 of 18
(4,142 Views)

Thanks for your attention and comments. I am sorry that I did not provide more details as follows.

 

1. NI MAX always works very well with the camera. Actually, we attempt to replace NI MAX with a labview program.

2. We have tried three ways to check where the problem might be:

1) start with "highlight execution" => turn off the highlight execution once the loop is running

2) start normally => turn on the highlight execution when the loop is running

3) run normally always.

The camera is good in the first way, does not work in (2), and sometimes good, sometimes bad in (3). Then, I guess the problem just comes from the module of IMAQdx Configure Grab VI or outside the loop.

3. I am using a hyperspectral camera with a maximum frame rate of  330 FPS and  an image size of 1024*224. The engineer told us the shutter inside the camera is controlled by the following functions: MotorShutter_PulseFwd = close shutter, and MotorShutter_PulseRev = Open shutter. So, we need to change such a value to open the shutter firstly.

 

shutter.jpg

 

Attach the VI file for reference. Thanks in advance.

0 Kudos
Message 3 of 18
(4,118 Views)

When you ran with MAX, I assume you found the Camera in Devices and Interfaces, opened a Test Panel, then did a Snap or a Grab.  Did it work?  You seem to say that it did.  If it worked "out of the (MAX) Box" without your doing fancy things with the Shutter attribute, then simply leave this parameter alone (getting rid of the Enumerate Attributes and the Property Node to set the Shutter) and simply Configure Grab and start the Camera.  Let GenICam do the work for you.

 

Bob Schor

0 Kudos
Message 4 of 18
(4,112 Views)

Thanks for your helpful suggestions.Yes, we can acquire images from the camera with NI-MAX. However, it is also necessary to reset the shutter value manually to open, otherwise we will receive a black screen in NI-MAX. Actually, we want to integrate the camera with other sensors such as GPS. Hence, we hope to log images and other kinds of data by labview instead of NI-MAX.

0 Kudos
Message 5 of 18
(4,107 Views)

Morning, Maple.

 

I was (unsuccessfully) trying to learn exactly how you get images in MAX.  Of course you want to use LabVIEW and IMAQdx to run your camera, but you say that your code doesn't do it.  So tell me exactly what you do to be able to get images in MAX.  Start with plugging the camera into your PC (is it an Ethernet connection or USB3?), what happens when you open MAX, what (or how) do you "manually configure" with MAX (please name the Attribute and how you set it), and what "button you push" to get images.

 

(Almost) anything you can do "manually" with MAX you should be able to do with equivalent IMAQdx code.  It (usually) works for me (except when it doesn't, of course -- not all Cameras are Created Equal).

 

Bob Schor

0 Kudos
Message 6 of 18
(4,100 Views)

Actually, we have a hyperspectral camera and a thermal camera. The thermal one works very well both with MAX and the shipping examples included in the labview.

 

We follow the procedure as below to trigger the hyperspectral camera with NI-MAX

1) Doube-click the camera listed on the left of the MAX, and hear a clatter from the shutter,

2) Change the "Motor Shutter Pulse Rev" value from 200 to 201, and hear a clatter from the shutter,

3) Click the "Grab" button, and receive the following image.

hyperspectral camera with MAX.jpg

 

When triggering the camera by the labview program in the Highlight Execution mode, I hear clatters when the data flow enters the modules of Open Camera and Property Node. Then, we can receive the image we want. It is almost equivalent to NI-MAX.

 

However, I will not hear anything and receive just a black screen if I run the labview program normally.

0 Kudos
Message 7 of 18
(4,081 Views)

Aha -- perhaps the key words are "I hear clatter from the shutter", and it works in "Highlight Execution" mode.  Sounds like it takes a bit of time for the (mechanical) shutter to open -- try Open Shutter, Wait 500 msec, Grab.  If this works, try reducing the delay (you can probably get it down to a few tens of milliseconds).

 

Bob Schor

0 Kudos
Message 8 of 18
(4,073 Views)

Thanks for your continued attention. As our camera is being used to scan the field, I will try your suggestion when it is free. By the way, I have another question. I can receive an image with 1024*224 pixels from the module of "Get Image Data" as shown below, however, the size of image data array is 344064 instead of 1024*224=229376. I  realy can not understand it......image.jpg

0 Kudos
Message 9 of 18
(4,066 Views)

You didn't get the entire Image.  1024 * 224 * 2 = 458,762 bytes (notice near where you circled, your image is a 16-bit image, so each pixel is 2 bytes).  You only read 168 scan lines (instead of 224).

 

IMAQdx is tricky.  The functions that NI provides generate (behinds the scenes) GenICam calls using a (small) subset of the GenICam standard.  I believe that NI has tested IMAQdx against Basler and Axis cameras, and it seems to work for those models (I've used it successfully with Axis camera).  On the other hand, cameras from other manufacturers can be more problematic (I've been struggling for several months with another brand of camera, with very marginal success).

 

Bob Schor

0 Kudos
Message 10 of 18
(4,058 Views)