Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

1394 visual basic 6.0 30821

I am having problem running VB6 test code for a 1394 camera.

 

I have a AVT Pike 1394 camera. I can use MAX to work with. I am able to run the cam and take pics. The interface is named "cam2".

 

I downloaded VDM and Measurement Studio evaluations. The camera works with Vision Assistant.

 

I have trouble to run the Hardware.vbp that is in the legacy examples that come with VDM. First when I open the project it warns me that cwimaq.ocs version 8 is not registered, upgrade to version 9.0. Then when I run the code, it throws runtime error 30821, the passed interface or session is invalid. It fails here: CWIMAQ1.LoadInterfaceDefaults.

 

I played with IMAQ properies and typed in "cam2" as Interface, on the Device tab it sasy no device associated with this interface. Not sure if this is the problem.

 

I am rusty with VB, I did it long time ago. Not sure if I need to modify more settings.

 

I appreciate any help.

 

Thanks,

Xianmin

0 Kudos
Message 1 of 10
(3,450 Views)

Xianmin-

I have a few additional questions about your application:

1. The IMAQdx driver associated with VDM is only supported with IEEE1394 IIDC (DCAM) compliant cameras.  Is your camera compliant with this standard?
2. What version of the IMAQdx driver do you currently have installed on your system?
3. What device is your camera setup in MAX?  (This seems like your issue.  It appears your device name is not being recognized by your example.  Make sure these match.)
4. Do any of the examples work correctly?

Regards,

Mike S
NI AE
0 Kudos
Message 2 of 10
(3,418 Views)

As an AVT staffer, I can answer George's question #1:  The Pike is IICD/DCAM 1.31 compliant.

 

The other responses are up to Xianmin...  😉

 

Cheers,

 

Scott

0 Kudos
Message 3 of 10
(3,416 Views)

Hi Scott, thank for your reply.

 

Mike, Scott answered your first one.

 

2. I am not sitting in front of my office pc, i don't have the version with me, but I've checked with another NI support person and verified the driver version is the latest. I downloaded everything, measurement studio, vdm and drivers from NI in the past 2 weeks. (I have VAS2009.zip, I remember)

 

3. The camera work fine in both MAX and Vision Assistant. It is named cam2 in MAX

 

4. This is the problem I have, I can't make the example work.

 

The OS is Windows 7.

 

I do have a later post for the similar issue, so it feels like a double post, I appologize for that.

 

The problem with VB example: I opened the Hardware.vbp in VB6.0, tried to modify IMAQ control. The interface dropdown list doesn't show any interfaces in MAX, I guess it should. I typed in "cam2" manually. On the Device tab it says no device is associated with the interface, I have a feeling that this is not right.  I ran the code and got a runtime error 30821, the interface or session is invalid. I guess it can't find the camera.

 

Any suggestions?

 

Thanks,

Xianmin

0 Kudos
Message 4 of 10
(3,411 Views)

This is from MAX

0 Kudos
Message 5 of 10
(3,402 Views)

Xianmin-

Make sure you are using the IMAQdx examples not the IMAQ examples.  An IEEE 1394 camera requires the IMAQdx driver to work correctly.  And it calls to reason that this device would not show up correctly in the IMAQ examples.  

Regards,

Mike S
NI AE
0 Kudos
Message 6 of 10
(3,387 Views)

Mike,

 

How do I choose? The example I tried to run is in Vision folder. All the controls are already registered. In VB I don't think I have any choice.

 

Thanks,

Xianmin

0 Kudos
Message 7 of 10
(3,383 Views)

Xianmin-

Mine are located at the directory below.  Depending on your OS and how your computer’s user accounts are setup it may be a little different.

C:\Documents and Settings\All Users\Documents\National Instruments\NI-IMAQdx\Examples\Legacy MSVB 6.0

Regards,

Mike S
NI AE
0 Kudos
Message 8 of 10
(3,362 Views)

I only see legacy VB6 exmaples under Vision. I am building a brand new system with XP now. I will try my luck.

 

Thanks

0 Kudos
Message 9 of 10
(3,354 Views)

Xianmin-

Because these examples are for a legacy development environment, they are not installed in the standard installation.  You will need to make sure you select these examples to install.

Regards,

Mike S
NI AE
0 Kudos
Message 10 of 10
(3,341 Views)