LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

setting parameters for image acquisition

Hi,

I'm using a Basler 504K digital camera with a pcie-1429 card.   Could anyone help me figure out how to set the frame acquisition rate and the area of interest from within labview 8.5?  I thought that I'd be able to do this using the IMAQ set camera attribute VI, but it seems like the only available attributes to set are the ExSync and Exposure.

Thanks for the help,
Jason
0 Kudos
Message 1 of 6
(4,913 Views)
Hello Jason,

i already found an existing SRQ number.

Hello Josh,

I had the chance to speak with our in-house camera file expert today. While he did not cite any reason why associating camera attributes with pulse trains on a Camera Control Line would not work, he was concerned that you would have to stop the acquisition every time you wanted to change camera attributes. In other words, you would not be able to change camera attributes during a grab. You would need to end one acquisition completely and then start a new acquisition with newly configured camera attributes. Since this is the case, you may be better off using Basler's CCT+ to change camera attributes before each new acquisition sequence.

In case you would still like to bypass the CCT+, here are the nuts and bolts of the camera attribute/pulse train idea.
1. Download the NI Camera File Generator by following the links at www.ni.com/camera
2. Open the NI Camera File Generator, select your PCIe-1429 board, and choose Open Existing Camera File
3. Select Basler A501k.icd
4. Select File>>Save As... and save the camera file with a new name so you can always default to the old camera file if needed
5. Click the Camera Control tab
6. Click Add
7. Type FrameRateCtrl as the Attribute Name
8. Under list values, add as many values as the number of unique frame rates you will need. You can name each value the integer number (such as 74 to represent 74 fps).
9. Click OK
10. You should now see FrameRateCtrl in the Attribute Tree with the values you added nested beneath it.
11. Click on a FrameRateCtrl value and notice that the Serial, Pulse Generation, and Camera File Settings become active.
12. Click on the Pulse Generation tab and select Add
13. Choose a Camera Control line (I don't have your camera here, but I think you want Camera Control Line 0)
14. Choose milliseconds as units and then select a number that represents one half the period of the frequency that will match the desired frames per second rate. For example, if ...


. you are doing this for the 50 fps value, then use the number 10 because 20 milliseconds is the period corresponding to 50 Hz.
15. Click Add Number.
16. Select the second line under Pulse Equation.
17. Click Add Number.
18. Under Pulse Equation, you should now see a number for a high time and a number for a low time.
19. Click OK
20. Repeat steps 11 through 19 for each of the FrameRateCtl values.
21. Select File>>Save to save your newly modified camera file
22. Close the NI Camera File Generator
23. Open the NI Measurement and Automation Explorer
24. Find your PCIe-1429
25. Right-click on Channel 0, choose Open Camera, and select your modified camera file
26. Click on the Camera Attributes tab and note the presence of the new FrameRateCtrl attribute and its nested values
27. In LabVIEW, you can use IMAQ Set Camera Attribute to specify a new value for a camera attribute.
Note that, as mentioned before, you cannot change a camera attribute this way during an acquisition session.

For more information on programmatically changing camera attributes, check out the following links:

How Do I Programmatically Set Sub-Attributes for a Digital Camera?
http://digital.ni.com/public.nsf/websearch/AF9983D6A809946786256D6C00682983

Changing Camera Configuration Programmatically
http://sine.ni.com/devzone/cda/epd/p/id/1212

Setting My Camera Attributes Programmatically Does Not Permanently Change the Attributes
http://digital.ni.com/public.nsf/allkb/09794AF61D4CE35286256DBA0075150A

I hope this helps. Please let me know if this takes care of your issue or if you still have further questions.

We are able to control frame rate by setting the
two timers within the continuous internal control signal generated by the
camera. Timer 1 corresponds to the Exposure Time, while frame rate is
determined by adding Timer 1 and 2 (pg 3-6 of the Basler manual).

As for controlling/triggering flash signal through the framer grabber. It
appears to me that we should be able to control this signal in a similar
fashion using the internal sync of the camera (pg 3-3 of the Basler manual).

Here you can finde the icd file.

http://sine.ni.com/apps/utf8/nipc.product?pid=3802&asid=1102

Kind regards,

Elmar

0 Kudos
Message 2 of 6
(4,878 Views)
Hi Elmar,

Thanks for the help, what you're suggesting is exactly what I want to do unfortunately though its not quite working.  I followed the steps you very nicely outlined but when I tried to open the Basler A504k existing camera file, I got an error which read:

"A problem occurred while adding the interface.
The camera file has settings that are specific
to other IMAQ devices, or supports bit depths
or tap configurations that are not supported
by the selected device.  A new camera file will
be created"

However, I continued  by clicking OK and generated a new camera file by following your instructions.  When I selected this new camera file from MAX however I got a timeout error.  I then tried manually editing the original camera file by copying the following segment from the generated camera file into the original camera file:

   Attribute (FrameRateCtrl) {
      Value (List) {
         Name (50) {
            Action (PG) {
               Line (0) {
                  Start (High)
                  500000, 500000
               }
            }
         }
         Name (25) {
            Action (PG) {
               Line (0) {
                  Start (High)
                  1000000, 1000000
               }
            }
         }
         Default (50)
         Current (50)
      }
   }

Doing this allowed me to set 25 or 50 Hz as a frame rate however the actual camera frame rate does not correspond to 25 or 50 Hz (actual frame rates are ~ 16 and 25 Hz respectively).  So now I'm kind of stuck again.  If you have any suggestions I'd appreciate it, otherwise I'll probably contact Basler and ask them.

Thanks for the help.

Jason





0 Kudos
Message 3 of 6
(4,851 Views)
Hello Jason,

i looked at the compatibility report of the basler cam.
And i found these comments:

Basler CCT+ utility must be used to send serial commands. This camera file is for IMAQ 3.1 or later.  You must use the utility to configure your camera and then either close the utility or change the port to “No port selected”. Then you may launch MAX open the appropriate camera file. The only adjustments that you make in MAX are acquisition window size, output mode, and ExSync settings. You must make sure that all settings in MAX match the settings in CCT+. If you need to change something you must first click on “My System” or hit F5 in max in order for CCT+ to launch correctly.

Link: ftp://ftp.ni.com/support/imaq/camera_support/camera_files/digital/basler/Basler%20A504k%20Compatibility%20Report.htm


Kind regards,

Elmar

0 Kudos
Message 4 of 6
(4,839 Views)
Hello,

I realise that this issue may have been cleared up for the originator, but I'm sure there are people (like me a couple of days ago) that have a similar issue and are googling their way through the NI forums in search of an answer...

I'm using a Mikrotron MC 1302 for acquisition rates between 200 and 1000fps. Using the configuration utility provided by Mikrotron, I have written 8 user profiles to the camera, so that 8 seperate camera resolution, frame rate, exposure time etc can be called by a 8 different serial commands. I have then modified the "Grab and Save to AVI" sample VI by placing a combo-box attached to a case structure, each case containing the serial command, acquisition window dimensions (matching to the camera resolution in that user profile), and the folder to which the AVI will be saved (I have a seperate folder for each framerate).



Hopefully this will be of help to anyone starting their image acquisition. I am also open to suggestions and comments of this method.


Regards,
Fiachra





Message Edited by FiachraC on 04-03-2008 05:25 AM
0 Kudos
Message 5 of 6
(4,727 Views)

If this thread is still actual, please have a look at my report. I succeeded in communicating with the A504k via the 1429e, and have posted a sample VI there.

HTH, Enrico

0 Kudos
Message 6 of 6
(4,403 Views)