LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Basler camera

Solved!
Go to solution

Hi everyone, 

I have a basler camera and I want to use it to see a certain process. And sometimes I need to secord the process. for that I created a case structure to have a start recording button in front panel. 

 

The problem is I dont get a proper video, even I record for 30 seconds I get a 0 seond 'video'. 

How can I solve this problem?

thanks in adcance 

0 Kudos
Message 1 of 7
(185 Views)
Solution
Accepted by topic author Natig

You want to start the video once, then use the "write frame" VI over and over to record each image as a frame of your video.

Message 2 of 7
(115 Views)

Is your camera set up so that it "talks" to LabVIEW and is capable of recording a Video?

 

To find out, do the following:

  1. Open MAX (the Measurement and Automation Explorer).
  2. Plug in your Camera and connect it to your computer.
  3. Does it show up under "My System" under Devices and Interfaces?

If the answer is "No", you need to figure out how to connect it.  Next:

  1. Click on the Camera (in MAX).  On the right, it should pop up a display with some information about the Camera, and should give  you a "Snap" and "Grab" control at the top.
  2. Press "Snap".  Did you get an Image?
  3. Now press "Grab".  Do you get a Video?

Wasn't that easy?  (I'm assuming it worked).

 

Now, let's take a brief look at your code.  Before putting all the Bells and Whistles into the code, try to get a simple Picture or Video (a "Snap" or a "Grab").  Let the Camera figure out the settings.  Don't start with a "Do Everything" Express VI (or if you must, leave most of the Controls unwired so they take their default values).

 

Forget the Camera, look at your basic LabVIEW structure.  You have a While Loop that runs until you push Camera, and then it stops.  [Camera?  Isn't "Stop" a better name for this control?].  Inside this (let's call it) "Camera Loop", there is a Case Statement governed by a Boolean called "Start Camera".  [Another spectacularly wrong name -- yes, the code inside the True branch will run as long as you don't press the switch again, but what does it do?  Who knows?  Maybe it creates one (or more) images (depending on the speed of the loop).

 

Each time it runs, one image comes out and goes to a Case Statement "on top".  If "Start Recording" is False, nothing happens.  If it is True, you open an AVI file, write the (single) image to the file, then close the file.  When/if another image comes in, you do the same thing, overwriting the previous image.  Is this what you want to do?

 

My advice is to concentrate on writing simple IMAQdx code to do a Snap (single Image) to an Image Window, and when that works, try programming a Grab.

 

I must say, as I have dabbled in a variety of interesting aspects of LabVIEW, one of the most challenging things I encountered was LabVIEW Vision.  Fortunately, I had a colleague who needed my help straightening out his convoluted VIs, and we more-or-less "taught ourselves" how to do LabVIEW Vision, largely by writing simple little VIs (no Express VIs, please) to "learn the Tricks of the Trade".  Know any colleagues who have do visual processing (even non-LabVIEW -- image processing, with at least 4 dimensions to keep in mind (image width, height, the pixel value, and if video, "time" = Frame Number).

 

Bob Schor

 

 

Message 3 of 7
(112 Views)

And how can I write it over and over as video? by using while loop? I dont want to record every second of my experiment I want to add like start recording button but it seems a case structure is not a solution for that😑 

0 Kudos
Message 4 of 7
(43 Views)

Thank you for your answer, yes that part was easy and as you advised I made a vi for grab, it also works. Problem arises when I want to record a video with avi. The code that I have written dont produce a viode but a picture. 

0 Kudos
Message 5 of 7
(39 Views)

Solved: create vi was inside the loop. that was the problem. 

thanks for answering 

0 Kudos
Message 6 of 7
(29 Views)
Feel free to mark solution and give Kudos for the help
0 Kudos
Message 7 of 7
(20 Views)