LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error -1074360302 When Setting the OffsetX in IMAQdx Property Node

Solved!
Go to solution

We are reworking our previous vision acquisition module by replacing the legacy IMAQ with IMAQdx session. However, I met some problems when trying to set the ROI in IMAQdx session. Here is the detailed information (the original program is so large that rewrite a simple VI here to state the problem):

 

1. When using the legacy IMAQ, we change the region of interest by using the property nodes to set 'ROI Height', 'ROI Width', 'ROI Left' and 'ROI Top'. It works without problem.

2. In the new program, we hope to change the ROI by setting properties of 'Height', 'Width', 'OffsetX' and 'OffsetY'. I ran into problems when writing values to OffsetX:

    2.1 The camera interface is camera link. Hardware resolution is 2560x2048. Frame grabber is NI PXIe 1435.

    2.2 In the first picture, I set the Height=1500, OffsetX=0, OffsetY=0 and Width=2000, and I can capture the image with right size and offset

    2.3 However, in the second picture, if I only change the OffsetX to 100 and OffsteY to 0, I will get the error -1074360302 (out of range) and get no image. I also try other values but it seems I cannot write in any value larger than 0

    2.4 The third picture is the block diagram and I also attach the source file. Is there anyone running into the same error... It is so strange...Capture1.PNGCapture2.PNGCapture5.PNG

0 Kudos
Message 1 of 3
(1,638 Views)
Solution
Accepted by topic author Khadgar_nr

OffsetX, OffsetY, Width, Height and all numeric IMAQdx parameters have min, max and increment constraints that you must respect when writing their values.

Since these can change dynamically depending on the current configuration (especially these 4 parameters), you need to read the constraints using the generic interface, then coerce the desired value to obtain the value to write.

Try the code attached.

 

raphschru_0-1622500838021.png

 

0 Kudos
Message 2 of 3
(1,582 Views)

Hi Raphschru,

 

Thanks very much for your reply! I think you are absolutely right that I must notice to the parameter input range. I tried your code and it worked well as I desired.

 

I think the root cause of my original code is that I want to set the OffsetX, OffsetY, Width and Height at the same time, without defining the max & min limit for Offset X and Offset Y first. The VI seems limit the input range for Offset X and Offset Y to 0 if the width and height are not written in in advance. Thus, besides your attached solution, if I first set the properties of IMAQdx Width and Height and then set the Offset X and Offset Y, the VI also works.

 

Thank you very much!

0 Kudos
Message 3 of 3
(1,550 Views)