10-09-2014 01:46 PM
The standards for making a large change, such as removal of a tool that has been around for years, are, and ought to be, much higher than the standards for leaving it be.
I've already said that I could do what I do with other means, but I have yet to see why I should have to. I've already said that I don't especially love the SSS.
I use the sequence because it's simple. Yes, it goes against dataflow, but dataflow is not a goal, it's a tool. I don't use the sequence locals much, but it's clear that they are just wires with terminals. Years ago, in flowcharting, there was a similar construct. Wire "A" here goes to wire "A" over there. It's not my favorite thing to do, but it sometimes does the job.
If people who hammer the screw into the board are shown a screwdriver, chances are most of them will start using the screwdriver. And you won't hire the others as carpenters.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
10-09-2014 02:44 PM
Oops, I did it again. I used a SEQUENCE.
It's early in development of this piece, so there might be a better way, but for right now, it seems the simplest.
The upper loop runs at 10 kHz or so. The lower loop runs on EVENTS from an outside source.
Frame 1 of the sequence sends an ABORT signal to the loop above.
When a QUIT event comes in, I want to ensure that the RUNNING flag is set FALSE- BEFORE I abort the inner loop above.
It would probably be OK without the sequence - the local will probably switch before the ABORT VI does its thing.
But I don't want to bet on "probably".
Could I use a Flat sequence here? I suppose. But that's more diagram space. (Flat sequences have their own violations of LabVIEW rules, but that's another story).
Could I use a state machine here? I suppose. It seems a bit absurd, though.
I could use a property node to set the local, and use the ERROR OUT to force the execution order.
I could use a flag in the upper loop directly, but I don't want to burden every loop with a checking of the flag (there will be 30+ of these loops).
There are probably other ways to do it. The sequence looks best to me, at this early date.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
10-09-2014 04:39 PM
I'd argue I have no idea why you needed to use a stacked sequence here. I can't see what is going on in the other frame. (The code-hiding problem of the SSS). The whole construct is so small that saying it takes up more space if you go to a flat sequence is ridiculous. Unless frame 2 has a huge amount of code in it, but that would be true only if you also turned off Auto-Grow and nodes are hiding beyond the boundaries of the hidden frame of the sequence structure. (Which would be doubly evil.)
10-09-2014 11:56 PM
Why exactly are we supposed to be impressed with your bad code and your inability to see other options?
10-10-2014 12:50 AM
I wouldn't call it bad code. In many ways it looks like a program I might have written. ![]()
But I would agree with Orioles here: I have no idea why a SSS would be needed here since I do not know what is in the second frame. The text explanation mentions something in the frame 1 about ABORT, but I'm not sure why the upper loop would need anything else but the Running boolean set to TRUE (and not FALSE) to abort.
It would seem unlikely that whatever is in there wouldn't also fit in a FSS but without seeing the VI in its whole it's not possible to say for sure.
10-10-2014 03:04 AM
Sometimes it seems the sophistication of a tool carries with it a lot of overheads. People use Li-cell power tools nowadays, where a simple screwdriver or saw would do a job much more efficiently. No batteries, no power charger, less complicated hence more dependable, more carbon freindly, etc, etc... This idea of distain might be misplaced in our attempts to improve matters whereby we overlook the value of the simpler aspects of our toolkit. Used logically and with consideration, the stacked sequence may seem simple but is effective.
10-10-2014 03:05 AM
Sometimes it seems the sophistication of a tool carries with it a lot of overheads. People use Li-cell power tools nowadays, where a simple screwdriver or saw would do a job much more efficiently. No batteries, no power charger, less complicated hence more dependable, more carbon freindly, etc, etc... This idea of distain might be misplaced in our attempts to improve matters whereby we overlook the value of the simpler aspects of our toolkit. Used logically and with consideration, the stacked sequence may seem simple but is effective.
10-10-2014 07:43 AM
I'm not sure why the upper loop would need anything else but the Running boolean set to TRUE (and not FALSE) to abort.
It's the inner timed loop that needs to ABORT. But the outer loop doesn't necessarily stop when that happens.
It would seem unlikely that whatever is in there wouldn't also fit in a FSS but without seeing the VI in its whole it's not possible to say for sure.
That's just it - I don't know what all is going to have to fit in there - it's early. If I have to add another frame, it probably doesn't take up any more real estate.
If you start from the position that "SSS = evil" then yes, my code is bad.
I don't start from that position.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
10-10-2014 07:48 AM
Why exactly are we supposed to be impressed with your bad code and your inability to see other options?
I listed several other options, and allowed how there might be more.
And I don't care whether you're impressed or not.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
10-10-2014 08:31 AM
@CoastalMaineBird wrote:
Why exactly are we supposed to be impressed with your bad code and your inability to see other options?
I listed several other options, and allowed how there might be more.
And I don't care whether you're impressed or not.
I've mostly skimmed through the thread with mild amusement. It's been a long time since I added a SSS to one of my diagrams. But, on reflection, sometimes my reasons were more about coding fundamentalism than rationality.
I'll continue to think twice about any multi-frame sequence structures, but that's better than thinking no times and rejecting it only for dogmatic reasons. My take away from the thread is to tell the SSS, "welcome back from banishment my little friend."
-Kevin P