Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

can you optimize(not simply set) camera attributes in an VI instead of in MAX?

I have a JAI BM 500-CL  camera, and NI PCIe 1427 card. I could use Measurment & Automation (MAX) to access my camera, and do a grab. during grabing, I could adjust the camera attributes in MAX, for example, exposure time, and at the same time, looking at the image window of MAX,  to find out what is the best setting for my experiment.  at the end, save the change, exit MAX and later if I use labview, these setting are kept defualt. this is convenient. Can I do the same thing in a VI instead of MAX? I know you could use SetCameraAttribute.vi to set a value to that attribute, but once you set, you could not change it during grab. I tried to modify the example, LL Grab.vi, to put a  SetCameraAttribute.vi in the loop, but it seems not work. then I tried to add another IMAQ start.vi in the loop too. but got an error message, saying " there is no IMAQ start". I wonder if anyone else tried. 

 

thanks,

t.z.

  

  

0 Kudos
Message 1 of 9
(4,598 Views)

then I tried to add another IMAQ start.vi in the loop too. but got an error message, saying " there is no IMAQ start". I wonder if anyone else tried.

Can you attach your vi?
0 Kudos
Message 2 of 9
(4,588 Views)

Due to the way camera serial commands work in the camera file, the acquisition must be started and stopped when changing any camera attributes. Basically it is due to the fact that many serial actions can change certain parameters of the acquisition. In MAX, when you are changing things while it is acquiring, MAX is silently stopping the acquisition, changing the attribute, and starting it back up again.

 

If you want to control some features while acquiring (say exposure time) you can always just directly send the camera-specific commands using the serial read/write VIs in your appliction. Otherwise you can simply restart the acquisition each time like what MAX does.

 

Eric 

0 Kudos
Message 3 of 9
(4,579 Views)

hi, Muks,

  this is a VI which I modified by  Bluechees's suggestion.

 

regards,

t.z.

0 Kudos
Message 4 of 9
(4,555 Views)

Hi, Bluecheese,

  i tried to follow your idea and modified my VI, each time when I tried to modify an attribute, I use IMAQ stop.vi, then set the attributes and start again. one thing is the system response very slow. it seems working, but one more problem showed up: you did not see smooth moves in the image windows, but like slow motion.  I wonder why. see the attached VI in above post. 

 

regards,

t.z.

0 Kudos
Message 5 of 9
(4,554 Views)

You have the right idea, but you made a few mistakes.  Here are the problems:

 

1.  Remove both sequences.  They aren't doing anything for your program.

 

2.  Remove the 1000 msec delay when changing the attributes.  That just slows down your program.

 

3.  I assume you want it to update the attributes whenever you press the Reset button.  If this is true, you need to switch the True and False cases.  Right now it updates the attributes every time through the loop unless you press Reset.

 

4.  I don't know if the frame number is reset when you stop and start an acquisition.  If it is, you will need to reset your frame number also.  You would need to use a shift register to store the frame number instead of the loop index.

 

5.  If you must acquire every frame, change the number of frames in the acquistion setup to be a larger number like 30 or so.  With 1 frame, you can only get the next image.  If missing frames is fine, I would remove the wire for the frame index (connected to loop counter) and just let it return the next image.

 

There may still be other issues with your code, but this should get you going.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 6 of 9
(4,542 Views)

I am looking for a camera file for the JAI BM500CL. Can you help?

0 Kudos
Message 7 of 9
(4,178 Views)

Yes:

 

I C D file in the link below 🙂

 

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

 

-AK2DM

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 8 of 9
(4,171 Views)

Great. Thanks!

0 Kudos
Message 9 of 9
(4,167 Views)