Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving an imaq image to disk using CWIMAQVision

Great, thanks Chris
0 Kudos
Message 41 of 56
(5,542 Views)

timmkish,

 

I am very sorry, but I don't have a solution for you yet. There is unfortunately not one document or person that knows all the answers. In fact, our documentation is very poor for the non-VDM functions for file I/O. I'm still not sure why you cant use some of the VDM file I/O calls, since one of OUR engineers said that it is possible. That is another facet of the problem that I am looking into. 

 

I know that this problem has taken a significant amount of time, which I am sory for. For the time being though, I would reccomend just using the trial version of VDM, which is basically the full version without being activated.

 

Hopefully I will hear more promising results back from R&D by next week.

Chris Van Horn
Applications Engineer
0 Kudos
Message 42 of 56
(5,530 Views)
Chris, thanks for the help.  Unfortunately, I need to deploy this code on a standalone system that is going to run autonomously for 6 months, so the trial version isn't going to be any help.  Let me know if you hear anything more.
0 Kudos
Message 43 of 56
(5,517 Views)

Good News. You can use the CWIMAQVision ActiveX control without licensing issues as long as you only call functions that do not require a license. Writing files does not require a license so you can ship Visual Basic executables that use the Vision ActiveX control with the Vision dll and if you only write files/display images, you won't need a Vision license on the machine.

 

Here's the simple example I tested with:

 

Private Sub Command1_Click()
Dim dxSession As IMAQdxSession
Dim imaqImage As New CWIMAQImage
niimaqdx.Functions.IMAQdxOpenCamera "cam0", IMAQdxCameraControlModeController, dxSession
niimaqdx.Functions.IMAQdxSnapCW dxSession, imaqImage
CWIMAQViewer1.Attach imaqImage
CWIMAQVision1.WriteJPEGFile imaqImage, "c:\\dummy.jpg"
'CWIMAQVision1.CannyEdgeFilter imaqImage, imaqImage
End Sub

If you uncomment the CannyEdgeFilter function, you'll get an error about licensing, but if you leave it commented out, it works great.

 

Hope this helps,

Brad

Message Edited by Brad on 12-03-2008 01:20 PM
0 Kudos
Message 44 of 56
(5,484 Views)

Brad,

Thanks for the help, but if I even add a CWIMAQVision Object to my form (without even making a function call from the CWIMAQVision Object) upon executing the code, clicking the 'Snap' button, there is an immediate error and the compiler informs me that I have an unlicensed copy of NI Vision.

 

I check my NI license manager and it says everything is fine.

0 Kudos
Message 45 of 56
(5,478 Views)
Vision Acquisition Software v8.6 is what I have installed on my machine
0 Kudos
Message 46 of 56
(5,472 Views)

Hey timmkish,

 

 I'm wondering if we could have some association problems with your drivers. You need to make sure that you have no conflicting older drivers or versions of vision. Also, you need to make sure you have a license for IMAQdx. I know all of these are simple to look at, but you shouldn't be getting this error. I'm still looking into it for you. Thanks as always for your patience.

Chris Van Horn
Applications Engineer
0 Kudos
Message 47 of 56
(5,466 Views)
You're sure you have the driver licensed correctly? If you remove the Vision ActiveX control from the Form your application can acquire images without problems? Here is a screenshot of my license manager (tried on a clean machine with just Visual Basic and Vision Acquisition Software), and the VB code I used.
0 Kudos
Message 48 of 56
(5,465 Views)

You're sure you have the driver licensed correctly? If you remove the Vision ActiveX control from the Form your application can acquire images without problems? Here is a screenshot of my license manager (tried on a clean machine with just Visual Basic and Vision Acquisition Software), and the VB code I used.

Are you trying this on your machine or deploying it to another machine? If you put it on another machine, that machine needs to have IMAQdx licensed correctly.

0 Kudos
Message 49 of 56
(5,463 Views)
Alright, I think I see what the problem is now. When I built into an exe and installed Vision, I'm getting the same problem you are...let me dig a little bit more.  The previous attachment is screwed up, so here's a good one if you're interested:
0 Kudos
Message 50 of 56
(5,461 Views)