Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How to set an attribute in .icd file which has multiple parameters (e.g. ROI) ?

Good morning.  I was wondering how I could create an attribute in a camera .icd configuration file which accepted multiple parameters.  For example, on my camera, the serial syntax for setting a region of interest is "roi x1 x2 y1 y2".  However, in the .icd file I don't know how to specify an attribute which accepts multiple parameters.  For example, the "vertical binning" setting is defined in the .icd file as an Integer as follows (where "sbv" is the serial command to be issued to the camera, and %d is the variable integer):

 

Attribute (Vertical Binning) {
Value (Integer) {
Min (1)
Max (8)
Increment (1)
Display {
Multiplier (1.000000)
Offset (0.000000)
Precision (0)
Units (units)
}
Default (1)
Current (1)
Action (Serial) {
Command (sbv %d\r)
Response (\r\nOK>)

 

How can I create an attribute in the file which has multiple parameters, such as four integers (one each for a corner of a region of interest).  Thanks!

0 Kudos
Message 1 of 5
(3,099 Views)

So far I could not find an example that used multiple parameters. However, have you tried something like the following?

 

Default (0,0,0,0)
Current (0,0,20,20)

 

Basically, try to use four integers as the representation for 'one variable.'

Ravi A.
National Instruments | Applications Engineer
0 Kudos
Message 2 of 5
(3,092 Views)

I am also trying to do something similar to this.  I tried the suggestion given but it still only allows 1 parameter.  A snippet of my .icd file is below.

 

            Attribute (ROI Settings) {
               Value (Integer) {
                  Min (0)
                  Max (79)
                  Increment (1)
                  Display {
                     Multiplier (8.000000)
                     Offset (0.000000)
                     Precision (0)
                     Units (Pixel)
                  }
                  Default (0, 0, 0, 0)
                  Current (0, 0, 0, 0)
                  Action (Serial) {
                     Command (ROI %d, %d, %d, %d\r)
                     Response ()
                     Timeout (1000)
                     Delay (100)
                  }
               }
            }

 

 

Any answer or help is appreciated.

 

Thanks,

Bruce

0 Kudos
Message 3 of 5
(2,992 Views)

Bruce,

 

You can try setting the Acquisition Window in Measurement & Automation Explorer under Acquisition Parameters for your camera then save those settings.  I believe that sets an ROI with using the Top Left coordinates and the width and height you desire.

Regards,
Isaac S.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 5
(2,965 Views)

Thanks for your input.  This particular camera has windowing capability (which allows much faster frame rates when in windowing mode) so I was trying to utilize a command that is sent to the camera that changes the window size and location using just one command.  Fortunately I have the ability to set the windowing location of the camera using 4 separate commands, but the camera firmware designers wanted to reduce the instruction set by removing the redundant discrete commands and just have 1 command to set the windowing location.  I will try need to convince them not to remove the 4 separate commands from this and future cameras.

 

Bruce

0 Kudos
Message 5 of 5
(2,962 Views)