From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

IMAQdx Error "Unable to set attribute" when changing AquisitionMode in GigE camera

Solved!
Go to solution

I am working on a C# application using NI-IMAQdx for acquisition using a Basler acA 1600-20gm GigE camera (the camera specifics may or may not be relevant). My application needs to alternate between continuous acquisition mode (to simulate 'live' video) and a triggered Single Frame acquisition using Line 1 to trigger the camera.

 

When I attempt to change from Continuous Mode to Single Frame Triggered Mode, I get an "Unable to set attribute" error when trying to set the AcquisitionMode to SingleFrame from its current Continuous setting.

 

When changing from Continuous to Triggered I also change the TriggerMode from Off to On.

 

I have tried changing the order of setting the attributes (TriggerMode then AcquisitionMode and vice versa).

 

It is unclear whether this is a camera issue (i.e. is the camera in a state where it is unable to accept the attribute change), or an IMAQdx software issue.

 

Any thoughts or suggestions are appreciated.

 

Thanks,

--Dave

0 Kudos
Message 1 of 4
(3,499 Views)

Hi Dave,

 

Could you post a screenshot of the error or its full text, and your code? Are you setting these properties while the acquisition is running?

 

I'm thinking that we may only be able to set these properties at the configuration stage, and not after we've begun acquisition.

 

Nick

Applications Engineer

National Instruments

0 Kudos
Message 2 of 4
(3,472 Views)
Solution
Accepted by topic author mpu

Hi,

 

a) are you stopping the acquisition before setting the attribute?

 

b) This error is not caused by IMAQdx, it is typically a problem caused by "conditionally visible/settable" attributes, which is very common for triggers, especially with Basler cameras.

 

Basically, Basler has two types of trigger modes that are not exactly compatible with IMAQdx' snap/grab/sequence model. There is a "Acquisition Start" and a "Frame Start" mode.

"Acquisition Start" ties the trigger signal to start either acquiring continuously (grab), 1 image (snap, but in the background it's implemented with start/stop) or n images (same thing).

"Frame Start" uses a running acquisition, and gets the next image.

 

You now have a couple of ways to implement this. Most important is that you make sure you stop the acquisition, before you switch.

 

I would personally write the application so that it always is in "continuous acquisition" (grab) mode, and stop it when you switch modes. The application would be always triggered (case A: software = free run, case B: line x). When switching to case B, I would only grab one image, and then immediately also stop the acquisition.

Message 3 of 4
(3,464 Views)

Thank you! I had been stopping the continuous non-triggered acquisition before trying to change the Acquisition Mode from Continuous to Single Frame. As you suggested, I stopped the acquisition before changing the Trigger Mode from off to on, but just left the Acquisition Mode as Continuous. As I am no longer changing the mode, I don't get the exception, but am still able to trigger the acquisition. The key was being able to set up a triggered acquisition with the camera set in Continuous Mode.

 

Thanks also for the information on the quirks of the Basler camera.

 

--Dave

0 Kudos
Message 4 of 4
(3,436 Views)