01-16-2014 08:21 PM
Well heres an example of the use of Stacked sequencies that I use quite frequently for more complex programs. The whole program consists of a stacked sequence. The first frame in the SSS consists of program initialization
The next frame consists of the main program loop, with an event hanlder structure that waits for an event to occur (usually a button press), then executes the code in that block, then goes back to waiting for the next event
Now I used to write subVIs for every single one of the the even handlers. The problem becomes as the complexity of the program grows, it becomes a PITA to wire a reference for every single front panel object I am going to potentially maniuplate to the subVI
So usually, I just have another SS inside the event handler strucutre that. Sure, I use subVIS for many things like setting up acquisiton, grabbing data, data processing etc., but typically I am doing alot of manipulating the front panel stuff, so that stuff I just do inside the SSS. If I need more screen real estate, I just add another frame to the SSS.
So shoot me
01-16-2014 08:38 PM
01-16-2014 08:53 PM
Good LORD! I will not shoot you! and, I thank you for your example.
A Consumer-Producer (Events) design pattern could offer you some better benefits than a bottle of aspirin and that construct though.
Again, there is no shooting, but that example could easily be done without a SSS, AND, have improved performance for the user experience without sacrificing performance of the real program objectives. (without the uithread hit the local variables require)
Try again Patrick. I promise no shooting.
01-16-2014 08:58 PM
@altenbach wrote:
@PatrickR wrote:
Well heres an example ...
Ouch!
Hold Your Fire!- this is not a live fire excise! Safe your weapons!
Seriously, I've learned a lot from threads like these! This one seems promising for all.
01-17-2014 09:00 AM
The only time I have used SSS (two times) is when I am writing/reading configuration files where there are dozens of keys to write and read. Without SSS the BD can get pretty wide.
I guess I could break down the key sections into sub-vi's, but I'd rather see them up-front.
-AK2DM
01-17-2014 09:51 AM - edited 01-17-2014 09:52 AM
@AnalogKid2DigitalMan wrote:
The only time I have used SSS (two times) is when I am writing/reading configuration files where there are dozens of keys to write and read. Without SSS the BD can get pretty wide.
I guess I could break down the key sections into sub-vi's, but I'd rather see them up-front.
-AK2DM
What I do in that case is read the keys for each config file into 3D arrays, then just read the appropriate array elements into your program or replace them by index number. You can always make sure things went from/to the right place just by looking at the array. No SSS needed here.
Cameron
01-17-2014 10:14 AM
My thoughts about the the SSS. You can't get rid of it simply because it would destroy backwards compatibility. On the other hand, it may lead to more LabVIEW jobs, as a huge chunk of the LabVIEW programmers would be lost without it...
01-17-2014 11:46 AM
@AnalogKid2DigitalMan wrote:
The only time I have used SSS (two times) is when I am writing/reading configuration files where there are dozens of keys to write and read. Without SSS the BD can get pretty wide.
I guess I could break down the key sections into sub-vi's, but I'd rather see them up-front.
-AK2DM
The OpenG ini-cluster vi's work pretty well and scale a lot nicer than reading individual keys. Thats two SSS's you didn't need.
01-17-2014 02:56 PM - edited 01-17-2014 02:57 PM
@JÞB wrote:
The OpenG ini-cluster vi's work pretty well and scale a lot nicer than reading individual keys. Thats two SSS's you didn't need.
Which functions are those? Are you talking about the Config File VIS in the File I/O Pallete? Those don't seem to support clusters or arays, so you need to manually parse every single variable and bundle it into the cluster
I've been looking for something with the simplicity of Matlab's 'save' and 'load' commands, which handles data structures of arbitrary complexity, but have never been able to find something. The closest I came was GXML, but thats still a pain because it breaks when you update the type definition of the cluster.
01-17-2014 03:02 PM
Hello PatrickR,
OpenG is an open-source third party library/add-on. You can find it via the LabVIEW Tools Network app/VIPM or here:
OpenG Libraries - OpenG
http://sine.ni.com/nips/cds/view/p/lang/en/nid/209027
Regards,