Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Delphi programming / CWIMAQ control

Maybe the file that you need is 'NiVisSvc.dll'.
In my system I have NiVisSvc.dll, NiVision.dll and
cwimaq.ocx all at the \windows\system directory.


It's seem that you should have at least the ocx with your installation of the NI-IMAQ so if you don't, call NI.

Try to ask a question at http://www.ni.com/support/

Yariv
0 Kudos
Message 11 of 19
(2,346 Views)
Yarive wrote:
>
> Maybe the file that you need is 'NiVisSvc.dll'.
> In my system I have NiVisSvc.dll, NiVision.dll and
> cwimaq.ocx all at the \windows\system directory.
>
> It's seem that you should have at least the ocx with your installation
> of the NI-IMAQ so if you don't, call NI.

As a last ditch before contacting NI, I uninstalled and reinstalled
everything. This time cwimaq.ocx appear on my system! (Which is odd
because I am sure I asked for VB support the first time round.)
Furthermore, I can use the ActiveX control to acquire images!

That's the good news. The slightly bad news is I now get a dialog
box saying:

"This unlicensed copy of IMAQ Vision may be used for demons
tration
purposes only."

when I first use the control. This is not a show-stopper but it is
annoying nonetheless. I'll try and get it licensed somehow. Any tips?

Another annoyance is I seem to be lacking the VB help file cwimaq.chm.
Maybe there is a copy on NI web site - I'll look.

Thanks, Yarive, for your continuing help and support. 🙂

Francis
0 Kudos
Message 12 of 19
(2,346 Views)
Francis Burton (that's me) wrote:
> As a last ditch before contacting NI, I uninstalled and reinstalled
> everything. This time cwimaq.ocx appear on my system! (Which is odd
> because I am sure I asked for VB support the first time round.)
> Furthermore, I can use the ActiveX control to acquire images!
>
> That's the good news. The slightly bad news is I now get a dialog
> box saying:
>
> "This unlicensed copy of IMAQ Vision may be used for demonstration
> purposes only."
>
> when I first use the control. This is not a show-stopper but it is
> annoying nonetheless. I'll try and get it licensed somehow. Any tips?
>
> Another annoyance is I seem to be lacking the VB help fi
le cwimaq.chm.
> Maybe there is a copy on NI web site - I'll look.

Alright, I had an email exchange with one of the UK technical support
staff and was advised on how to reinstall NI-IMAQ properly. It turns
out that I had uninstall ALL National Instruments software (including
NI-DAQ), physically remove the frame-grabber and MXI cards from the
computer, reinstall all the software again and then put the cards back.

That is what I did. The good news is all my DAQ stuff still works
(phew!). The bad news is the problems mentioned above haven't gone away.

Oddly, the CWIMAQ ActiveX control supplied on the CD-ROM appears to be
the full version, whereas the CQIMAQViewer control is an "evaluation
copy" - despite what the documentation implies (i.e. that it should be
a full version too).

However, I reckon that I can like without CWIMAQViewer if I can connect
CWIMAQ to my own device context/canvas. Having some documentation on the
CWIMAQ control would be very helpful in this regard.

So while I
try and get the problem with CWIMAQViewer sorted out with
NI, does anyone have a copy of the file cwimaq.chm they'd be willing to
share with me? (If necessary, I can send some kind of proof that I have
actually bought the hardware!)

Thanks!

Francis
0 Kudos
Message 13 of 19
(2,346 Views)
Hello Francis

The CWIMAQViewer is a component of the IMAQ Vision for Measurement Studio toolkit that is sold separate from NI-IMAQ. While NI-IMAQ installs the full CWIMAQViewer control, the evaluation message will remain until IMAQ Vision is purchased and installed.

Sorry for the confusion!

Kyle V
0 Kudos
Message 14 of 19
(2,346 Views)
Kyle V wrote:
> The CWIMAQViewer is a component of the IMAQ Vision for Measurement
> Studio toolkit that is sold separate from NI-IMAQ. While NI-IMAQ
> installs the full CWIMAQViewer control, the evaluation message will
> remain until IMAQ Vision is purchased and installed.

Kyle - Thanks for your definitive reply. It looks like I will have
to work with CWIMAQ alone, as I don't think I can justify the cost
of purchasing IMAQ Vision merely to remove the message!

I assume that I can hook CWIMAQ up to my own display handling code.
(If I am incorrect in this assumption, could someone please let me
know now!) I can guess at the meanings and usage of the design-
time
properties of the CWIMAQ control, but it looks like I will need more
information about the Images property and possibly about methods too.
I assume this information is contained in the missing help file
cwimaq.chm.

Can I download this file from the NI website? If not, how else can
I get hold of a copy?

Finally, may I suggest that another "Note" be added to the existing
documentation (NI-IMAQ User Manual, Chapter 5, p5-3) to explicitly
state that one must purchase IMAQ Vision for Measurement Studio to
use an unencumbered version of the CWIMAQViewer control.

Cheers,
Francis
0 Kudos
Message 15 of 19
(2,346 Views)
You can use the method

aVariant := Image.ImageToArray()

where Image is a single item of the colection CWIMAQ.Images.

aVariant is 2D byte array which you can copy to a canvas, bitmap etc.
Look also at the Delphi help for VarArrayLock().

Yariv
0 Kudos
Message 16 of 19
(2,346 Views)
Yarive wrote:
> You can use the method
>
> aVariant := Image.ImageToArray()
>
> where Image is a single item of the colection CWIMAQ.Images.
>
> aVariant is 2D byte array which you can copy to a canvas, bitmap etc.
> Look also at the Delphi help for VarArrayLock().

This looks like an essential technique. Thanks for the tip!

Francis
0 Kudos
Message 17 of 19
(2,346 Views)
Yarive wrote:
> You can use the method
>
> aVariant := Image.ImageToArray()
>
> where Image is a single item of the colection CWIMAQ.Images.

When sampling in continuous mode, how does CWIMAQViewer (and, by
extension, my copying code) know there is a new image to display?
Specifically, when doing something like:

CWIMAQViewer.Attach CWIMAQ1.Images(1) 5-10, User Manual

what callback/eventhandler is set up, and how can I emulate this
in my own code?

Francis
0 Kudos
Message 18 of 19
(2,346 Views)
You should handle the event
AcquiredImage() which "fires when your IMAQ device acquires the specified number of images. CWIMAQ generates this event only for acquisitions that you initiate with the Start method.

When using the CWIMAQ control, set its properties programmatically in your code or through the property pages. Then call the Start method to begin an asynchronous acquisition. CWIMAQ calls the AcquiredImage event procedure as your IMAQ device acquires images if the AcquiredImageEnable property is set to True.

This event is only fired for asynchronous acquisitions."


Yariv
0 Kudos
Message 19 of 19
(2,346 Views)