LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple calls to SubVI using Vision Acquisition

Hello Friends,

 

I am using Vision Acquisiiton block in subVI that is programmed for continuous acquistion. This SubVI is called by main VI multiple times. It works correctly when called for the first time but presents the error below when called for second time.

 

Error -1074360316 occurred at IMAQdx Get Image.vi

 

Possible reason(s):

NI-IMAQdx: (Hex 0xBFF69004) Invalid camera session

 

When I looked at the code in Vision Acquisition block, I saw "First Call" being used. It looks like reference to the camera is only setup at first call and hence this module fails when my subVI is called for second time. Any way to fix this? or Any trick to show subsequent calls to SubVI as first call?

 

Thanks

 

0 Kudos
Message 1 of 15
(4,125 Views)

Hi,

 

I tried to recreate the error on my machine but was unable to.  Is there anyway you can post the SubVI? 

 

Regards,

 

Greg H.

Applications Engineer
National Instruments
Message 2 of 15
(4,110 Views)

Please look at the attached program. MainVI calls the Vision VI when Vision button is pressed. This Vision VI has the Vision Acquisition module used.

 

When I click on Vision Button, a new VI is launched. This new VI captures video from my usb camera and reads data from text file. It works well on the first go. As soon as the file is completed or you press the stop button in the new VI, the MainVI is launced again. Now, if you press the Vision Button and Start the new VI again, thats when I get the error I reported.

 

Let me know if you have any suggestions or require more information.

0 Kudos
Message 3 of 15
(4,104 Views)

Hi,

 

I ran your program using a USB camera on my system and disabling the read from measurement file.  I ran the main VI and selected vision.  Then the vision VI started to run and I selected start.  It began acquiring images until I pressed freeze.  Then this VI would close and the main VI would show up and I started the process over again.  I did this 5 times and received no error, I was able to sequentially call the vision VI multiple times.  Can you post a screen shot of the error you are getting as well as the version of the Vision Acquisition Software you have.

 

Regards,

 

Greg H.

Applications Engineer
National Instruments
Message 4 of 15
(4,096 Views)

Please find the attached screenshot. August 2011 is the version of Vision Acquisition Software (From NI License Manager). I am using 64 Bit Windows 7.

0 Kudos
Message 5 of 15
(4,092 Views)

Hi,

 

I am still unable to recreate the error on my machine.  Can you list the exact steps you perform when this error occurs? 

 

Regards,

 

Greg H.

Applications Engineer
National Instruments
0 Kudos
Message 6 of 15
(4,083 Views)

Follow are the steps I follow:

 

1) Run MainVI

2) Press Vision

Now Another GUI comes up

3) Press Start

4) Press Freeze

5) Select the file (attached. you will need to unzip)

You will see graphs being populated. Within 2-3 seconds

6) Press Stop

The First GUI reappears

7) Press Vision

😎 Press Start

Now you should have the error I posted in my previous message.

0 Kudos
Message 7 of 15
(4,077 Views)

Hi,

 

I ran through the steps several times and was still unable to see the error you were getting.  What versions of the Vision Acquisition Software and LabVIEW are you using?  Also, the camera you are using is a USB webcam correct?

 

Regards,

 

Greg H.

Applications Engineer
National Instruments
Message 8 of 15
(4,063 Views)

From NI License Manager:

 

Vision Acquisition Software (August 2011)

Labview 2011

Are there any more specifications I can provide with regards to exact version I am running? If yes, please point me to appropriate place to find them. 

 

 

Yes. I am using USB webcam. Should I try manually installing the webcam drivers? Win 7 detected automatically when I plugged it in. 

0 Kudos
Message 9 of 15
(4,054 Views)

Hi,

 

If you open Measurement & Automation Explorer there is a category on the left hand side called My System.  If you expand that there is a software category.  With in that there should be version numbers for NI-IMAQ, NI-IMAQdx.  Could you provide these version numbers?

 

Regards,

 

Greg H.

Applications Engineer
National Instruments
Message 10 of 15
(4,042 Views)