Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

VBAI Performance

Hi guys

When trying to desing a more complex state diagram in VBAI, I've come across a severe performance limit. I'm attaching a script to demonstrate it. The example script does nothing more that running 100 iterations of an empty loop. One complete inspection cycle, when run in the inspection mode, takes more than 2 seconds on my 3 GHz Pentium 4! Is there a way how to make things MUCH faster?
I know I can export the script to LabVIEW, which really speeds it up by several orders of magnitude. However, I cannot do that, because I need to keep the script easily configurable.

Vladimir

View my profile on LinkedIn
0 Kudos
Message 1 of 4
(3,439 Views)
Vladimir,

I ran your inspection on my computer, which is identical to yours, spec-wise.  I am seeing similar results, with processing times around 1ms.  Is 50 parts/s too slow for you?
Regards,
Brandon M.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 4
(3,407 Views)

Hi Brandon

My exact situation was as follows. I needed to grab as much images as possible during a 3 second time interval. The loop was waiting for a certain TCP input to end. I have a camera that does 60 FPS in freerun mode, so I was hoping I can get at least 20 FPS with VBAI. The processing of the images takes no more than approx. 20 ms, so that is not the bottleneck.

My loop consisted of transitions between 4 states. The first state was just grabbing the image and forking between 30 different states according to the product type inspected. The appropriate processing state ran on the grabbed image. After that, there was another step that collected the measured data and there was another fork depending on whether the image logging was turned on. The fourth state just checked the TCP communication and looped back or passed the control flow further.

With this setup, I could do no more than 20 images per 3 seconds. Something that was absolutely unusable. Then I realized that the bottleneck is in the ultraslow state switching in VBAI and put all the grabbing and processing into just one step that loops into itself. Now I can get almost 40 images per 3 seconds, which is a bit more usable, but still could be better.

My problem now is that I have to copy the whole grabbing and data collecting into each of the 30 states I was forking into. This is just a very bad example of not utilizing modular design. When I want to change something, I'll have to do it in each of the 30 states. Moreover, I no longer can do the fork into logging or not logging the image, because I cannot have the intermediate state to do it.

So the question is, why is a simple state machine simulation so slow? Is it going to be improved in the future versions of VBAI? This is quite ridiculous that the software needs 20 ms just to switch states.

Vladimir


View my profile on LinkedIn
0 Kudos
Message 3 of 4
(3,397 Views)
Vladimir,
 
We're currently working on the next version and will try to address this issue.
 
-Christophe
0 Kudos
Message 4 of 4
(3,386 Views)