LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Vision Assistant VI Timeout

Solved!
Go to solution

Hello NI Community,

 

Recently during development, I had a Vision Assistant Express VI take forever. This VA Express VI has run without issues many times, but it posed the question, is it possible to set a timeout on a VA Express VI such that in situation like this one the program can abort the vision algorithm and throw an error or so? I did some Googling and looked around different settings, but nothing stood out.

 

Some more details to questions I'm anticipating:

- Operations involved in this VA included geometry (rotation), pattern matching, and edge detection. Typically, as provided in the VA analysis, this operation has a duration in the range of tens of ms.

- My program did not freeze. LabVIEW did not behave as frozen/halted. Using QMH design, my code was simply executing the VA Express VI case. I had to abort the program.

- The parameters supplied to the VA were valid i.e. pattern path & image.

- After aborting the program and rerunning the code, the case executed fine for the image taken. Something simply happened where tha VA was stuck executing for a really long time. Frankly, I did not have the time to wait it out, but it was at least a minute for which it held up. That is too long, especially given the typical execution time not exceeding 100ms.

 

Have you ever had this happen? What could have caused this? Are VA timeout parameters possible to integrate?

 

Thank you

 

0 Kudos
Message 1 of 7
(1,423 Views)

LabVIEW "hanging" is not an unusual finding.  What version (Year, Quarter, and bit size) of LabVIEW are you running?  The Vision module is especially complex, and Express VIs (like the Vision Assistant) that utilize LabVIEW Scripting are even more susceptible.  I recommend you exit LabVIEW, saving the Project, reopen, and test -- if you have to abort it and restart, you won't have to take a chance on "Recovery".

 

I don't know if you can embed an "Abort LabVIEW" inside a timed Loop that you "disable after 3 seconds" to do the Abort for you if things hang ...

 

Bob Schor

0 Kudos
Message 2 of 7
(1,372 Views)

Hi Bob,

 

LabVIEW 2018 SP1 18.0.1 32-bit. Vision Development Module version 18.5.0.

 

Perhaps LabVIEW did just hang. It just didn't look frozen like it typically does when it hangs up. It looked as if it was genuinely just executing the VA VI forever. I suppose that means it was hanging. Of course, if it indeed hung, there's no point introducing a timeout.

0 Kudos
Message 3 of 7
(1,333 Views)

About to board a plane to fly home.  Will try to reply tomorrow.

 

Bob Schor

0 Kudos
Message 4 of 7
(1,311 Views)
Solution
Accepted by thej178

Hmm, sorry, it took a little longer to get my "plate cleared" on returning to work.

 

The Vision Assistant is something of a Bear -- it runs a script to build a fairly complex VI for you that "tries to do whatever you told it to do", and wraps this all up in what is essentially a "Do Not Open" sub-VI.  The Good News/Bad News is that when this works, you can have a pretty complex set of routines "hiding" in a small compact space, leaving you lots of Block Diagram space to do the rest of your code, but when it goes awry (either because of a "data-induced glitch" (such as inadvertently causing a "divide-by-zero" error while processing your data or a subtle bug (no, there are no bugs!) in the scripting routines)), there's no "easy exit".

 

So you might need to "get your hands dirty" and add your own "Abort" routine.  Express VIs can be changed to "regular LabVIEW code", but this is a "one-way trip", after which you will not be able to run the Vision Assistant in "Assistant Mode", where you configure it and develop scripts for it to run and do its processing.  This turns the Express VI into an "ordinary" VI.

 

I learned LabVIEW Vision years before the Vision Assistant was developed, so I'm used to using the functions on the Vision Palettes, and build my processing loops with ordinary LabVIEW code, allowing me to put in "Emergency Stop" inputs (such as a Global called "Emergency Stop" that is Or-wired to the Stop terminal of While loops, and that I can set from my Top Level VI if I want the Vision Processing to quit prematurely).  I'll confess that I've never "blown up and examined" a full-fledged Vision Assistant Express VI, and don't know how practical it would be to embed an Abort signal inside it.

 

I would, however, be willing to "take a look" at whether this might be possible and practical, but you would need to attach enough of your code that utilizes the Vision Assistant.  The optimal way to do this is to compress your entire LabVIEW Project (right-click the Project folder, choose "Send To:", "Compressed (zipped) folder") and attach the resulting .zip file.  If there are hundreds of VIs in your Project, you can try building another "Test Project" with the VI that uses the Vision Assistant and "just enough stuff" so that there are no "Broken Arrows" when you open the VI that contains the Assistant.

 

Bob Schor

Message 5 of 7
(1,270 Views)

Hi Bob,

 

No worries, I hope you had a great Memorial Day weekend.

 

I really appreciate your answer. I have been using VA Express VIs quite liberally and reliably, and so I completely forgot about the option of turning said Express VI into an "ordinary" VI. I think I randomly discovered that it is possible about two years ago and then never ended up utilizing it or needing it. This knowledge was completely removed from my consciousness until your comment, so thank you. I'll monitor how my code's behavior is, specifically this Express VI. I have a stress testing period coming up in a few weeks. If this becomes a reoccurring issue, I will take this route and build in my own timeout routine into the "ordinary" version.

 

I will be able to upload my code here in a few weeks. (I'll simplify it enough and put in a project of course.) One problem here is that I won't be able to share my pattern image nor valid test images as these are confidential to the company I work for. Would you still like me to upload this given that I can't supply the data/pattern needed?

 

Theresa

0 Kudos
Message 6 of 7
(1,239 Views)

Anything you can provide would be useful to attempt to duplicate (and hopefully to find) the problem area.  While you shouldn't submit "confidential" images, it would be useful if you submitted some form of "data" (= image) that is roughly the same size as the image(s) you will use and the same format (i.e. .bmp, .jpg, .png, etc.).  If your images are videos, are you trying to process individual frames?  If so, what format is the Video and what is the size of the frame?

 

There are other participants on the Forum who are probably much better at LabVIEW Vision than I, and who will probably also be able to help, once you are able to help us to "see" the problem.

 

Bob Schor

0 Kudos
Message 7 of 7
(1,230 Views)