Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

IMAQ: Cannot access data from Annular Region

I am writing a Vision APP in VB and need to be able to write out some ROI parameters to disk. These parameters are created by the user using the mouse. I have been able to figure out the contents of the regions collection by looking at the XData and YData arrays.

However, if the Shape is a rotated rectangle or an annulus I find that these methods say:

The XData property, YData property, Shape property, and the SetRegion methon are obsolete and do not support the annulus or rotated rectangle shapes.

I have tried many combinations of the CopyTo method with the regions to no avail. I've been a bit frustrated by some of the help files for methods that might have been useful. For example:

CWIMAQVision.CreateCWIMAQ
Annulus:
Use this method in application development environments where object creation may not be straightforward.

I have been able to programatically create annulii and rotated rectangles but even for these I cant get the data back out.


How do I get the center, radii and start/end angles for an annulus from a Viewers Regions collection?



Chuck
0 Kudos
Message 1 of 2
(5,780 Views)
Chuck -

The XData and YData properties have indeed been obsoleted. The easiest way to get information from an annulus (for example) is to create a CWIMAQAnnulus object (using Dim or CWIMAQVision.CreateCWIMAQAnnulus), and set this object to be the region you wish to get information about. For example, to get information about the first region on a viewer:

Dim annulus As CWIMAQAnnulus
If CWIMAQViewer1.Regions(1).Shape = cwimaqRegionAnnulus Then
Set annulus = CWIMAQViewer1.Regions(1)
' annulus now holds the data in the first region.
End If

The same technique should work on any CWIMAQRegions object.

Hope this answers your question. If not, please reply and I'll do my best to help.

Gregory Stoll
IMAQ R&D
National Instruments
Greg Stoll
LabVIEW R&D
0 Kudos
Message 2 of 2
(5,780 Views)