02-01-2017 05:22 PM
I'm trying to properly create a VI for going through a set of image files (16 bit 2D arrays) after they're captured and saved in my system. Currently I've built a VI (attached) for automatically navigating through each file in that folder and displaying the intensity graph, but there's not enough interactivity on the front panel.
I'd like to be able to include a control like a set of buttons that allow the users to go forward and backwards through the files in the folder at will, rather than with a time delay.
02-01-2017 10:53 PM - edited 02-01-2017 10:54 PM
Sooooo you just want to turn your program that currently works somewhat in to a better user experience. Simple enough, because usually the hard part is getting your application to work properly first.
I would suggest you look in to the State Machine architecture.
The Simple State Machine template that ships with LabVIEW is really the best way for new developers to get familiar with LabVIEW while utilizing a semi-scalable architecture.
Here's a broad example of how a state machine works:
In your case, you could make the DoThing cases something like Next_Image or Prev_Image.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
02-02-2017 10:49 AM
Once the SSM is saved and finished, it'll be a standalone application right? As in I can't plug it into existing VI's?
To clarify, part of my original goal was to plug this VI into an existing VI designed by my camera's developers. Though, seeing as the idea was supposed to be an post-capture process, it's not terribly bad that the image review becomes a secondary program to open.
This seems like a good route to go, nonetheless. Thanks, James!
02-02-2017 11:06 AM
The SSM architecture is a standalone code set that doesn't take inputs or outputs after it's been initialized. It can be launched in parallel with other loops if needed, though, and a parallel communication method must be developed to handle that.
If you want this VI as a subVI of your main VI, then you could add inputs like "previous" and "next" to sort through the pictures. You would then need to get rid of the For loop, figure out some sort of memory to know what image you are currently on (FGV or another input/output to your main VI), and add an initialization step somewhere so that you aren't prompting the user for that folder every time you run the subVI.
Some of this is hard to describe, but hopefully I am getting my point across. The way that VIs work together within/parallel/inline is a tricky concept at first, but makes LabVIEW development fast once you get the hang of it.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'