Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

problem with matlab, win me & cwimaq.ocx

I have been using the cwimaq.ocx ActiveX control in Matlab and after upgrading the computer I have run into a problem.
The old computer used:
win98, matlab 5.3 and ni-imaq v 2.2.1
the new computer is using:
win me - I have tried almost all possible combinations of matlab 5.3, matlab 6.1 and ni-imaq 2.2.1, 2.5, 2.5.1 and 2.5.3 and no luck, I just cannot run my old code.
Before I reinstall the machine using a win2k I just want to try my luck here.

I have an ActiveX control in Matlab and when I try to get an interface to the Images collection
interfacehandle=get(imaqcontrolhandle,'Images');
I get the following error from Matlab 6.1:
unable to create descriptor cache

Any idea what is causing this?

Thanks in advance
0 Kudos
Message 1 of 3
(3,396 Views)
We don't have any documented problems with the IMAQ ActiveX controls being used on WinME. It sounds like there might be an issue with how it is being called from Matlab. Also, the error you are getting is a Matlab error, not an IMAQ error so it is hard to tell what is happening. I would be surprised if the OS is the culprit, but I would check with Matlab to see if there are any issues with upgrading and breaking old code.

Jack Arnold
Application Engineer
National Instruemnts
0 Kudos
Message 2 of 3
(3,396 Views)
After having tried numerous combinations of drivers as well as matlab 5.3/6.1 I only found one working combination.

Win2k, Matlab 5.3 Imaq 2.2.1

Another issue - I was installing Ni-Daq version 6.6 on win2k and I got a lot of dialog boxes with no text so I had to guess what options to choose.

I'm using the following code in matlab:

-- this bit initializes the two controls I am using --

imaqfig = figure('visible','off');
hardwcontrol = actxcontrol('CWIMAQControlsLib.CWIMAQ.1',[20 20 60 60],imaqfig);
hardwarecontrol = actxcontrol('CWDAQControlsLib.CWAOPoint.1');
pp=invoke(hardwarecontrol,'ChannelString',0);
status=invoke(hardwarecontrol,'SingleWrite',0);
-- end of init.m --

-- this bit snaps one picture and displays it in a windo
w --
figure;
pp=invoke(hardwcontrol,'AcquireImage');
ImProp = get(hardwcontrol,'Images');
ImPropsingle = invoke(ImProp,'Item',1);
tilarray=invoke(ImPropsingle,'ImageToArray');
billed=mat2gray(tilarray');
imshow(billed);
-- end of snap.m --

What is happening is that I cannot access the Images property of the ActiveX control.

Thanks for your help
0 Kudos
Message 3 of 3
(3,396 Views)