LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Changing controls while program is running (using a while loop) gives timeout message?

I have been trying to acquire some pictures and videos using a Flir Blackfly camera, LabView 2026 Q1 and NI-IMAQ. I initially started using the example code "stream to avi files.vi" which was working as intended.

 

I then tried changing some of the camera parameters while the program is running. I want to be able to change exposure time etc. while in the same take. To do this, I added a shift register to the acquisition loop and added a code snippet that I will attach in a screenshot. In theory, at each repetition of the loop, this should check if the parameters in the cluster are still the same, and if they are not, it should update the camera parameters. It should then continue to take the next picture of the video, again following the example VI.

 

The "Exposure" sub Vi here just contains some property nodes to update camera parameters, and is working as intended on its own.

 

My problem is that my code, in general, is working. Sometimes it will just freeze for a second, but then change the parameters and continue on. But sometimes it will also just freeze, and then give me a timeout error: Error -1074360293 occurred at IMAQdx Get Image2.vi. Clearly my code is causing it to take too long before acquiring the next image.

 

Now here is where I am confused: I took this code snippet from the example code "Acquire triggered images.vi", and I also copy-pasted the exact same code snippet into the example code "Aquire every image.vi" (with my adjustments). In both of those examples, it is working fine. Starting the program will show the camera feed, and then I can change the values and see the changes in real time. It's not even freezing. It is working exactly as intended. The only time I have a problem is when it comes to saving images.

 

I did try increasing the timeout in hopes that it would just take a second to come around, but this doesn't help, it still freezes.

 

Thank you for your help!

0 Kudos
Message 1 of 4
(239 Views)

We can't troubleshoot a picture of a code fragment. 

 

Please post your code or a simplified version of it that shows the problem

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 2 of 4
(223 Views)

@RTSLVU wrote:

We can't troubleshoot a picture of a code fragment. 

 

Please post your code or a simplified version of it that shows the problem


Well, we can still comment:

 

  • We see a home made (?) yellow subVI followed by an grey function.
  • There are overlapping and hidden wires all over
  • The case structure only executes when the cluster changes a value
  • The cluster goes into a shift register, which seem completely pointless because you don't tap into the previous value at all.
  • We cannot tell what's in the false case
  • We cannot tell what's outside the truncated image
  • We cannot tell where that blue wire comes from and where it goes
  • we cannot tell the program architecture
  • We cannot tell which part causes a timeout.
  • ...

I have the strong suspicion that once you put a bit more thought into your code, things will fix itself magically.

 

Message 3 of 4
(184 Views)

The first thing I noticed was you said you were using IMAQ with a Flir camera, and my immediate reaction was "wrong driver, you need IMAQdx".  Then (later) I saw you reference IMAQdx, so the first entry was a typo, a missing "dx".

 

What are the parameters of your images, including Image size (length, width in pixels, and bits/pixel (8, 16, 24, or 32), and frame rate (frames/sec, as I assume you are saving a Video)?  What format are you using for the video (.avi, .mov, something else)?  What is the buffer size you configured for your video?

 

I notice you are using LabVIEW 2026 Q1, so it is likely that only a small fraction of experienced IMAXdx users who follow the LabVIEW Forum will be able to read your LabVIEW code.  We really need to see complete code (it could be a simple scaled-down routine to simply acquire 10 seconds of video in a file called "Example.avi", and "Save for Previous Version" specifying LabVIEW 2021).  

 

Bob Schor

0 Kudos
Message 4 of 4
(134 Views)