Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Imaq vision for measurement studio - ROI Width runtime error 30381

PROBLEM - Imaq vision for measurement studio

Running sample program:- NI-IMAQ\SSAMPLE\VB\GRAB.vpb

Getting Error message:

"Run time error 30381 - Starting IMAQ operation - The ROI is not properlt aligned. The total number of bytes bounded by the ROI Width must be aligned to a DWORD boundary"

How do I fix this problem please???

Hardware: PXI-1428 revision b with Hitachi KP-F120CL - NI certified for this card. Camera works fine using MAX

Software NI-IMAQ - 3.1.1
NI-DAQ - 7.4.0f0
IMAQ VISION 7.1.0
Image Services library 7.1.1.948
Image Processing 7.1.1.4004

Thank You SCRAGGA
0 Kudos
Message 1 of 7
(3,787 Views)
Hi Scragga
What settings do you have set in MAX for your camera file? This may be affecting the image input.

Mike
0 Kudos
Message 2 of 7
(3,774 Views)
Dear MJK
The MAX settings are:-

a) Under mage display:- 1390 x 1040 1:1 16bit image

b)GENERAL TAB: Mfr: Hitachi Model: KP-F120CL Channel: 0

c)ACQUISITION TAB
Max Image Size: Width 1576 Height 1049
Detect Pixel Clock: ON
Acquisition Window: LEFT 0 WIDTH 1392 TOP 0 HEIGHT 1040
Bit Depth: 0
timeout: 100 Msec

d)CAMERA ATTRIBUTES
Mode: Normal
Shutter: 1/30
Speed: normal
Partial scan: OFF
Trigger Pol: Normal
HD Reset: OFF
Clock Phase: OFF

I have tried changing the acquisition window settings - but no effect - not really sure what values will correspond to DWORD boundaries but tried multiples of 8, 16, 32 and 64 with no avail

Incidentally the camera also works correctly with Imaq Vision Assistant
0 Kudos
Message 3 of 7
(3,769 Views)
Hi Scragga
Have you tried changing the bit depth of the image on the viewer. This is set by

CWIMAQViewer1.Image.Type = cwimaqImageTypeI16

Mike
0 Kudos
Message 4 of 7
(3,767 Views)
Mike,
I just tried changing the bit depth in the Grab program - no change - still get ROI error
Scragga
0 Kudos
Message 5 of 7
(3,760 Views)
Mike,
I may have been wrong to say that it is working correctly in MAX. While GRAB works alright, I do not seem able to update the camera file.
If I use SAVE then the file remains unchanged
If I use SAVE AS then the camera file is corrupted to zero length
The display shows an error message - " the user.dll may not be loaded"

I still get ROI eror in VB GRAB application??

Scragga
0 Kudos
Message 6 of 7
(3,758 Views)
Mike
Further to my last post,
Using SAVE AS completely destroys the existing Camera file ( it offers to overwrite existing file) - sets it to zero length - get error message "the session you requested failed to execute - check the user dll is on the system"

using SAVE does actualy update the Camera file - but when I close and reboot MAX the displayed settings for Acquisition Window do not show saved values in the file. E.G. Max startup values for width and height are Width 8, Height 1 even when file values are 1344 and 1024.

In the VB application CWAIMAQ properties the Device TAB initially shows correct device type and interface and img0 name. But if I clck on the General "Load Default Settings" the device TAB nows says words to the effect that device does not exist.

Any ideas
0 Kudos
Message 7 of 7
(3,749 Views)