Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Delphi programming / CWIMAQ control

Hi!

I'd like to use NI-IMAQ with Delphi 5. What is the recommended
way of doing this?

For my application, use of the cwimaq.ocx Active X control
would probably suffice, but I can't find this file anywhere.
There is nothing I can see in Chapter 5 of the NI-IMAQ User
Manual to suggest that this component is an "extra" or that
I would need anything more than NI-IMAQ installed in order
to use it (unlike e.g. the CWIMAQVision control, which needs
IMAQ Vision).

Can anyone tell me where cwimaq.ocx is located, or what I
must do to obtain a copy?

Cheers,
Francis
0 Kudos
Message 1 of 19
(5,412 Views)
The vision module for measurement studio contains the cwimaq.ocx.

Regarding Delphi, I suggest you to upgrade to version 6.02 due to its better ActiveX handling.

Yariv
0 Kudos
Message 2 of 19
(5,412 Views)
Yarive wrote:
>
> The vision module for measurement studio contains the cwimaq.ocx.

Ah, I was afraid it would turn out to be part of another
package which I would have to buy. I can't really afford
to spend 495 GBP just for the ability to program NI-IMAQ
in Delphi. Are there equivalent files to NIDAQ.PAS and
NIDAQCNS.PAS for NI-IMAQ which I could use instead?

> Regarding Delphi, I suggest you to upgrade to version 6.02 due to its
> better ActiveX handling.

Is Delphi 5's ActiveX handling buggy, incomplete, or just
inefficient? (I suppose I should know if I am going to go
down that route - don't like to upgrade just for the sake of
it, as Delphi 5 works very well for me at the moment!)

Cheers,
Francis
0 Kudos
Message 3 of 19
(5,412 Views)
You can translate the NI-IMAQ header and create your own ni-imaq.pas.
Look at http://www.drbob42.com/tools/index.htm (headConv)

There were some problems with the ActiveX support (_TLB files) in Delphi 6.0. The 6.02 update solve this.
However, It isn't relevant as you won't use the IMAQ ActiveX.

Yariv
0 Kudos
Message 4 of 19
(5,412 Views)
> You can translate the NI-IMAQ header and create your own ni-imaq.pas.
> Look at http://www.drbob42.com/tools/index.htm (headConv)
>
> There were some problems with the ActiveX support (_TLB files) in
> Delphi 6.0. The 6.02 update solve this.
> However, It isn't relevant as you won't use the IMAQ ActiveX.

Yariv - Many thanks for your help! I thought that I would
have to convert the header files myself semi-manually, so
it's good to find there is a tool which can do it.

Francis
0 Kudos
Message 5 of 19
(5,412 Views)
Look at the link
http://digital.ni.com/softlib.nsf/websearch/887B27C0505AFC6686256B1200712794?OpenDocument&node=132060_US
There you can download the cwimaq.ocx and according to the readme.txt file (at the same page) you can deploy it without IMAQ Vision licence.

You can e-mail me to yariv@rmvision.co.il for any help or to discuss your application.

Yariv
0 Kudos
Message 6 of 19
(5,412 Views)
Look at the link
http://digital.ni.com/softlib.nsf/websearch/887B27C0505AFC6686256B1200712794?OpenDocument&node=132060_US
There you can download the cwimaq.ocx and according to the readme.txt file (at the same page) you can deploy it without IMAQ Vision licence.

You can e-mail me to yariv@rmvision.co.il for any help or to discuss your application.

Yariv
0 Kudos
Message 7 of 19
(5,412 Views)
Yarive wrote:
>
> Look at the link
> http://digital.ni.com/softlib.nsf/websearch/887B27C0505AFC6686256B1200712794?OpenDocument&node=132060_US
> There you can download the cwimaq.ocx and according to the readme.txt
> file (at the same page) you can deploy it without IMAQ Vision licence.

Using the CWIMAQ and CWIMAQViewer controls would be the way to get my
application (see below) up and running quickly. Unfortunately, it gives
me the message "Newer version of IMAQ Vision required".

So I think I will have a go using the headConv-converted .pas header
files.

My application will perform a few simple functions:

- acquire images from camera in ring mode at 1 to 20 times per second
("free-running" at full rate is accepta
ble _if_ each frame is time
stamped)

- display current image after cropping to a square ROI, left-right
mirroring, and overlaying of a "software graticule"

- save all or selected images from ring after acquisition stopped to
disk (BMP is fine)

- control camera exposure times etc. (can be done already via an ocx
supplied with the JAI CV-A50 camera)

Francis
0 Kudos
Message 8 of 19
(5,412 Views)
If you choose to convert the header, convert only a minimal set of functions that you need for the image acquisition and use TPaintBox for image display. You don't need all the complexity of IMAQViewer.

Yariv
0 Kudos
Message 9 of 19
(5,412 Views)
Yarive wrote:
>
> If you choose to convert the header, convert only a minimal set of
> functions that you need for the image acquisition and use TPaintBox
> for image display. You don't need all the complexity of IMAQViewer.

I am getting nowhere with the converted header files. They produced
numerous errors which I could progressively reduce in number by
deleting lines. After a while it seemed that it would be easier to
do it the other way and manually construct a minimal .pas file for
NI-IMAQ based on nidaq.pas supplied with NI-DAQ. That has calls in
the form:

function AI_Check ( ... ):nidaqStatus; stdcall; external nidaqdll;

const
nidaqdll = 'nidaq32.dll';

So I looked for the equivalent DLL fi
le for NI-IMAQ, and couldn't
find anything which looked like the right thing. I presume it
must exist, because there's a reference to it on page 1-3 of the
NI-IMAQ User Manual. Do you know what it is called?

Otherwise, I will have to reconsider using the ActiveX control.

But I can't understand why installing NI-IMAQ 2.5.1 didn't put
any .ocx files on my disk. The Release Notes that came with the
software says:

"This release of NI-IMAQ includes the following revisions:
...
IMAQ Vision 6.0 ActiveX hardware control for creating image
acquisition applications in Microsoft Visual Basic"

and

"Your NI-IMAQ software kit contains the following components:
...
IMAQ Vision 6.0 ActiveX hardware control for Microsoft Visual Basic"

Should I contact someone in NI about this? If so, who would be
my best bet?

Cheers,
Francis
0 Kudos
Message 10 of 19
(5,412 Views)