Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Camera attribute writeable during acquisition.

I'm trying to set a camera attribute during acquisition.

The attribute "integration_time" was added using the NI Camera File Generator.

During the acquisition the camera adjusts its integration time and I want to set the current

integration time using imgSetCameraAttributeNumeric in CVI.

 

The problem is the attribute is not accessible during acquisition so imgSetCameraAttributeNumeric returns an error.

 

How do I have to change the camera file to make the attribute writeable during acquisition.

 

Thank you in advance.

 

Kind regards,

Bernhard

0 Kudos
Message 1 of 7
(4,264 Views)

Did you try to stop the camera live mode, set the attribute and then start again the live mode?

0 Kudos
Message 2 of 7
(4,201 Views)

The system adapts the integration time on a frame to frame basis, the camera itself is designed to do this.

It would not help to stop acquisition after each frame and then to restart acquisition for the next.

0 Kudos
Message 3 of 7
(4,197 Views)

I believe the attribute model of the IMAQ driver requires restarting the acquisition to change settings. Have you tried just having you code send the serial commands directly to change the setting you want?

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

That is my problem, I send the serial command directly, the detector I use does not have a NI camera file, but I created one myself.

Now after sending the new integration time, during acquisition, I would like to update the camera attribute "integration time" which I included in the camera file.

Unfortunatelly I haven't found out how the make the attribute writeable during acquisition.

 

0 Kudos
Message 5 of 7
(4,160 Views)

Hi,

 

ICD file's camera attributes are mainly useful for :

  • handlling together the grabber and camera settings and make sure their state are consistent. For instance, you can send a serial command to set the camera in trigger mode and in the same time, set pulse generation that will trigger the camera.
  • hiding the details of camera and grabber settings to the user or application developper. A standard user can just set these attributesand acquire some images in MAX, then save his own default configuration. Someone writing an application specific to the camera can also read/write IMAQ camera attributes without having to deal with "low level" serial commands, some IMAQ properties,...
  • handling some IMAQ properties you can simply not access through the IMAQ SDK (tap configuration, bit depth also I think, ...)

 

In your particular case, I'm surprised you're not able to write the attribute during runtime. The attribute you added to handle the exposure time is probably doing more than just sending a serial command to the camera and on of those other tasks it may contain is not allowed in runtime.

I would help if you provide us the attribute definition or the complete icd file.

 

 

Some comments though :

 

ICD file's camera attributes are mainly useful for :

  • handlling together the grabber and camera settings and make sure their state are consistent. For instance, you can send a serial command to set the camera in trigger mode and in the same time, set pulse generation that will trigger the camera.
  • hiding the details of camera and grabber settings to the user or application developper. A standard user can just set these attributesand acquire some images in MAX, then save his own default configuration. Someone writing an application specific to the camera can also read/write IMAQ camera attributes without having to deal with "low level" serial commands, some IMAQ properties,...
  • handling some IMAQ properties you can simply not access through the IMAQ SDK (tap configuration, bit depth also I think, ...

So if you just need to set the exposure time with a serial command, I would suggest you don't do it through a camera file attribute but you use the IMAQ Serial Read and Write functions.

That way, you can manage this in a straight forward way and an important thing is that you will also be able to get the exposure value that is really set on the camera. Indeed the Camera attribute read (or get I'm not sure) will just return you the camera file setting, which might not be exactly what is currently set in the camera.

 

You say you want to update the exposure time frame by frame. I'm not sure you'll be able to achieve this level of speed and/or determinism by sending the exposure time with a serial command as it means software jitter, some delay in just sending the command, and also, you may have no idea when the new exposure will actually be applied after the command has been received.

If you really target a frame to frame update, I would strongly recommend some real time (or probably FPGA) hardware and software and also, if this mode exists in your camera, the use of the pulse width trigger mode (the name might be different depending on the manufacturer) : in this mode the exposure time is defined by the duration of the trigger pulse. So if instead of sending a serial command, you are able to control the duration of trigger pulses, you can make sure the exposure will be updated for each frame.

 

 

Sami Fathallah
ALLIANCE VISION
HW and SW Components for Scientific Imaging and Machine Vision
http://www.alliancevision.com
0 Kudos
Message 6 of 7
(4,157 Views)

I'm sorry for expressing my problem unclear.

 

I'm using RT LabVIEW. During the acquisition each acquired frame is analyzed and depending on the result of the analysis the integration time of the detector is adjusted by sending the command to the detector direclty via the serial interface.

All this is done in CVI. The analysis and setting of the integration time is functioning as intended, we have tested it up to a frame rate of 5.5 kHz.

All this is fine.

 

I just would like to update a variable in the camera attributes after the integration time is set, to be able to access the current integration time from within LabVIEW.

I have a solution to make the current integration time available to LabVIEW, though it is not realy a nice and clean one.

 

If it doesn't work with camera attributes it is not the end of the world, however since the manual states that some attributes are writeable during acquisition I was just wondering how to make a camera attribute writeable.

The documentation on this topic is a little bit thin.

 

Thank you all for your help so far.

 

Kind regards,

Bernhard

0 Kudos
Message 7 of 7
(4,151 Views)