Phillip Brooks Posted August 21, 2008 Report Share Posted August 21, 2008 QUOTE (normandinf @ Aug 19 2008, 04:27 PM) For any inappropriate questions one might want to ask, you can get the answers without asking. All you really need is check out Google, Facebook or MySpace. Or in the case of LabVIEW prospects, the NI Forums or most importantly, LAVA! (As Michael already indicated). I hope I'm not in trouble. Maybe I should stay away from the lounge and BreakPoint from now on... Quote Link to comment
crelf Posted August 21, 2008 Report Share Posted August 21, 2008 QUOTE (Pollux @ Aug 20 2008, 03:23 AM) I know it has nothing to do with the subject, but may I ask why did you ban sequence-structures? ...and we have another topic schism! I know there's been a lot of discussion over the years about how sequence structures aren't inherent to the dataflow paradigm, and I've met a lot of people that have completely sworn-off them, but I think they're like everything else in LabVIEW - as long as they're used appropriately, they're OK. :!: I strongly suggest that this topic go to a new thread. Quote Link to comment
Kevin Payne Posted August 21, 2008 Report Share Posted August 21, 2008 QUOTE (jbrohan @ Aug 19 2008, 02:16 AM) "Next week we have a conference exhibit and we need an elephant for our stand. Where do you think we could get an elephant from?" I think I could put you in touch with http://forum.419eater.com/forum/viewtopic.php?t=139274' rel='nofollow' target="_blank">someone who could help. Quote Link to comment
Jim Kring Posted August 21, 2008 Report Share Posted August 21, 2008 QUOTE (Pollux @ Aug 20 2008, 12:23 AM) I know it has nothing to do with the subject, but may I ask why did you ban sequence-structures? And since you have banned them how can them be avoided? (any article if possible)(I am asking since I sometimes use them in my code when I find no other solution.) There's a great Info-LabVIEW thread on the topic called http://sthmac.magnet.fsu.edu/cgi-bin/ILVsearch/search.pl?Match=1&Realm=ILV2003&Terms=%22Three+Button+Dialog.vi%22' rel='nofollow' target="_blank">Three Button Dialog.vi. Quote Link to comment
John Lokanis Posted August 21, 2008 Author Report Share Posted August 21, 2008 QUOTE (Pollux @ Aug 20 2008, 12:23 AM) I know it has nothing to do with the subject, but may I ask why did you ban sequence-structures? And since you have banned them how can them be avoided? (any article if possible)(I am asking since I sometimes use them in my code when I find no other solution.) At risk of being off topic, I will answer your question: Sequence structures (IMHO) exist to allow text based programmers who do not 'get' the idea of dataflow to explicitly control the sequence of execution. They are like the 'GOTO' statement of G programing! I have yet to find a situation where they are required. We use the error wire to control execution where needed. We also modularize our code as much as possbile (lots of sub-VIs). And we limit our diagrams to one screen (99% of the time). The key things I do not like about sequence strucutures are: 1. Violates dataflow within a single diagram. 2. Stacked strucutures hide code and force the code to have wires that flow backwards to pass data between cases. 3. Flat structures make for large diagrams that are messy. Don't get me started on Globals either... (that horse has been beat to death anyways on LAVA and InfoLabVIEW) -John Quote Link to comment
NimbleThink Posted August 22, 2008 Report Share Posted August 22, 2008 Here are some questions: Can you convert a sequence structure to a state machine? [assuming that they answer "yes"] Please explain all the advantages and disadvantages of a state machine versus a sequence structure. How might you implement a state machine where the next state not only depends on the current state but also the prior state? -Leif Kirschenbaum QUOTE (jlokanis @ Aug 20 2008, 09:32 AM) At risk of being off topic, I will answer your question:Sequence structures (IMHO) exist to allow text based programmers who do not 'get' the idea of dataflow to explicitly control the sequence of execution. They are like the 'GOTO' statement of G programing! I have yet to find a situation where they are required. We use the error wire to control execution where needed. We also modularize our code as much as possbile (lots of sub-VIs). And we limit our diagrams to one screen (99% of the time). The key things I do not like about sequence strucutures are: 1. Violates dataflow within a single diagram. 2. Stacked strucutures hide code and force the code to have wires that flow backwards to pass data between cases. 3. Flat structures make for large diagrams that are messy. Don't get me started on Globals either... (that horse has been beat to death anyways on LAVA and InfoLabVIEW) -John Quote Link to comment
LAVA 1.0 Content Posted August 22, 2008 Report Share Posted August 22, 2008 QUOTE (NimbleThink @ Aug 20 2008, 07:19 PM) Can you convert a sequence structure to a state machine?Please explain all the advantages and disadvantages of a state machine versus a sequence structure. Yes, but sometimes a State Machine is just more than the job requires. Sequence structures have their place for very simple VIs. State machine are more suitable to more complex sequencing tasks, especially where the order of tasks will vary depending on the data. For example state machine are very good at handling execeptions and errors that may occur during program execution. A sequence structure has a static sequence of operations and it is cumbersome to execlude operations due to errors, etc. State machine are more flexible and manageable as the application changes and you need to add, edit, remove, and reorder states (operationss). QUOTE (NimbleThink @ Aug 20 2008, 07:19 PM) How might you implement a state machine where the next state not only depends on the current state but also the prior state? Use state variables, in LV terms typically a cluster containing all the state variables, passed through the state machine using a shift register. Quote Link to comment
JDave Posted August 22, 2008 Report Share Posted August 22, 2008 QUOTE (LV_FPGA_SE @ Aug 20 2008, 06:25 PM) Yes ... Use state variables, in LV terms typically a cluster containing all the state variables, passed through the state machine using a shift register. Good answers!! I would hire you if I could. This being that you also pass the test of having many good posts here on LAVA. Quote Link to comment
BobHamburger Posted August 22, 2008 Report Share Posted August 22, 2008 QUOTE (LV_FPGA_SE @ Aug 20 2008, 09:25 PM) Yes, but sometimes a State Machine is just more than the job requires. Sequence structures have their place for very simple VIs. I have a template for a simple single-loop, queue-based enumerated state machine, and I use it as the starting point for just about every VI that I begin writing. Once I can see more clearly what's needed, I may or may not remove the loop, case structure, and queue primitives to simplify the layout. Over the years, I've found it much easier to start with a more complex framework and pare down what I don't need than to try to add state functionality after I've already started coding. Which leads me to another of my favorite interview questions: do you have a particular application framework that you like to use when you begin a new programming challenge? Nice, open-ended question that really shows you how a candidate thinks in LabVIEW. As far as I'm concerned, I wouldn't miss it if the sequence structure were completely removed from LabVIEW. IMHO, it simply has no place in the dataflow-dependency paradigm. Quote Link to comment
jgcode Posted August 22, 2008 Report Share Posted August 22, 2008 QUOTE (BobHamburger @ Aug 21 2008, 12:30 PM) .....I've found it much easier to start with a more complex framework and pare down what I don't need than to try to add state functionality after I've already started coding. Amen to that. QUOTE (BobHamburger @ Aug 21 2008, 12:30 PM) As far as I'm concerned, I wouldn't miss it if the sequence structure were completely removed from LabVIEW. IMHO, it simply has no place in the dataflow-dependency paradigm. No! Sequence Structure - I see your point RE: data flow. But this structure seems to have been quite a standard in LV5-6 code (along with globals ) before everyone picked up the design pattern ball and ran with it. I personally would hate to see this be unsupported if I had to bring up LV5/6/7 into LV8+. Flat Sequence - definately not. a ) There are enough NI VIs that are not sequence with the error cluster (timers etc...) to warrent this (I know Open G have fixed this) b) QUOTE (BobHamburger @ Aug 21 2008, 12:30 PM) .....I've found it much easier to start with a more complex framework and pare down what I don't need than to try to add state functionality after I've already started coding. Amen to that. QUOTE (BobHamburger @ Aug 21 2008, 12:30 PM) As far as I'm concerned, I wouldn't miss it if the sequence structure were completely removed from LabVIEW. IMHO, it simply has no place in the dataflow-dependency paradigm. No! Sequence Structure - I see your point RE: data flow. But this structure seems to have been quite a standard in LV5-6 code (along with globals ) before everyone picked up the design pattern ball and ran with it. I personally would hate to see this be unsupported if I had to bring up LV5/6/7 into LV8+. Flat Sequence - definately not. a ) There are enough NI VIs that are not sequence with the error cluster (timers etc...) to warrent this (I know Open G have fixed this) b) QUOTE (BobHamburger @ Aug 21 2008, 12:30 PM) .....I've found it much easier to start with a more complex framework and pare down what I don't need than to try to add state functionality after I've already started coding. Amen to that. QUOTE (BobHamburger @ Aug 21 2008, 12:30 PM) As far as I'm concerned, I wouldn't miss it if the sequence structure were completely removed from LabVIEW. IMHO, it simply has no place in the dataflow-dependency paradigm. No! Sequence Structure - I see your point RE: data flow. But this structure seems to have been quite a standard in LV5-6 code (along with globals ) before everyone picked up the design pattern ball and ran with it. I personally would hate to see this be unsupported if I had to bring up LV5/6/7 into LV8+. Flat Sequence - definately not. a ) There are enough NI VIs that are not sequence with the error cluster (timers etc...) to warrent this (I know Open G have fixed this) b) QUOTE (BobHamburger @ Aug 21 2008, 12:30 PM) .....I've found it much easier to start with a more complex framework and pare down what I don't need than to try to add state functionality after I've already started coding. Amen to that. QUOTE (BobHamburger @ Aug 21 2008, 12:30 PM) As far as I'm concerned, I wouldn't miss it if the sequence structure were completely removed from LabVIEW. IMHO, it simply has no place in the dataflow-dependency paradigm. No! Sequence Structure - I see your point RE: data flow. But this structure seems to have been quite a standard in LV5-6 code (along with globals ) before everyone picked up the design pattern ball and ran with it. I personally would hate to see this be unsupported if I had to bring up LV5/6/7 into LV8+. Flat Sequence - definately not. a ) There are enough NI VIs that are not sequence with the error cluster (timers etc...) to warrent this (I know Open G have fixed this) b) QUOTE (BobHamburger @ Aug 21 2008, 12:30 PM) .....I've found it much easier to start with a more complex framework and pare down what I don't need than to try to add state functionality after I've already started coding. Amen to that. QUOTE (BobHamburger @ Aug 21 2008, 12:30 PM) As far as I'm concerned, I wouldn't miss it if the sequence structure were completely removed from LabVIEW. IMHO, it simply has no place in the dataflow-dependency paradigm. No! Sequence Structure - I see your point RE: data flow. But this structure seems to have been quite a standard in LV5-6 code (along with globals ) before everyone picked up the design pattern ball and ran with it. I personally would hate to see this be unsupported if I had to bring up LV5/6/7 into LV8+. Flat Sequence - definately not. a ) There are enough NI VIs that are not sequence with the error cluster (timers etc...) to warrent this (I know Open G have fixed this) b) QUOTE (BobHamburger @ Aug 21 2008, 12:30 PM) .....I've found it much easier to start with a more complex framework and pare down what I don't need than to try to add state functionality after I've already started coding. Amen to that. QUOTE (BobHamburger @ Aug 21 2008, 12:30 PM) As far as I'm concerned, I wouldn't miss it if the sequence structure were completely removed from LabVIEW. IMHO, it simply has no place in the dataflow-dependency paradigm. No! Sequence Structure - I see your point RE: data flow. But this structure seems to have been quite a standard in LV5-6 code (along with globals ) before everyone picked up the design pattern ball and ran with it. I personally would hate to see this be unsupported if I had to bring up LV5/6/7 into LV8+. Flat Sequence - definately not. a ) There are enough NI VIs that are not sequence with the error cluster (timers etc...) to warrent this (I know Open G have fixed this) b) I QUOTE (BobHamburger @ Aug 21 2008, 12:30 PM) .....I've found it much easier to start with a more complex framework and pare down what I don't need than to try to add state functionality after I've already started coding. Amen to that. QUOTE (BobHamburger @ Aug 21 2008, 12:30 PM) As far as I'm concerned, I wouldn't miss it if the sequence structure were completely removed from LabVIEW. IMHO, it simply has no place in the dataflow-dependency paradigm. No! Sequence Structure - I see your point RE: data flow. But this structure seems to have been quite a standard in LV5-6 code (along with globals ) before everyone picked up the design pattern ball and ran with it. I personally would hate to see this be unsupported if I had to bring up LV5/6/7 into LV8+. Flat Sequence - definately not. a ) There are enough NI VIs that are not sequence with the error cluster (timers etc...) to warrent this (I know Open G have fixed this) b) I like to use a QUOTE (BobHamburger @ Aug 21 2008, 12:30 PM) .....I've found it much easier to start with a more complex framework and pare down what I don't need than to try to add state functionality after I've already started coding. Amen to that. QUOTE (BobHamburger @ Aug 21 2008, 12:30 PM) As far as I'm concerned, I wouldn't miss it if the sequence structure were completely removed from LabVIEW. IMHO, it simply has no place in the dataflow-dependency paradigm. No! Sequence Structure - I see your point RE: data flow. But this structure seems to have been quite a standard in LV5-6 code (along with globals ) before everyone picked up the design pattern ball and ran with it. I personally would hate to see this be unsupported if I had to bring up LV5/6/7 into LV8+. Flat Sequence - definately not. a ) There are enough NI VIs that are not sequence with the error cluster (timers etc...) to warrent this (I know Open G have fixed this) b) I like to use a single QUOTE (BobHamburger @ Aug 21 2008, 12:30 PM) .....I've found it much easier to start with a more complex framework and pare down what I don't need than to try to add state functionality after I've already started coding. Amen to that. QUOTE (BobHamburger @ Aug 21 2008, 12:30 PM) As far as I'm concerned, I wouldn't miss it if the sequence structure were completely removed from LabVIEW. IMHO, it simply has no place in the dataflow-dependency paradigm. No! Sequence Structure - I see your point RE: data flow. But this structure seems to have been quite a standard in LV5-6 code (along with globals ) before everyone picked up the design pattern ball and ran with it. I personally would hate to see this be unsupported if I had to bring up LV5/6/7 into LV8+. Flat Sequence - definately not. a ) There are enough NI VIs that are not sequence with the error cluster (timers etc...) to warrent this (I know Open G have fixed this) b) I like to use a single frame QUOTE (BobHamburger @ Aug 21 2008, 12:30 PM) .....I've found it much easier to start with a more complex framework and pare down what I don't need than to try to add state functionality after I've already started coding. Amen to that. QUOTE (BobHamburger @ Aug 21 2008, 12:30 PM) As far as I'm concerned, I wouldn't miss it if the sequence structure were completely removed from LabVIEW. IMHO, it simply has no place in the dataflow-dependency paradigm. No! Sequence Structure - I see your point RE: data flow. But this structure seems to have been quite a standard in LV5-6 code (along with globals ) before everyone picked up the design pattern ball and ran with it. I personally would hate to see this be unsupported if I had to bring up LV5/6/7 into LV8+. Flat Sequence - definately not. a ) There are enough NI VIs that are not sequence with the error cluster (timers etc...) to warrent this (I know Open G have fixed this) b) I like to use a single frame for Quote Link to comment
jgcode Posted August 22, 2008 Report Share Posted August 22, 2008 QUOTE (BobHamburger @ Aug 21 2008, 12:30 PM) .....I've found it much easier to start with a more complex framework and pare down what I don't need than to try to add state functionality after I've already started coding. Amen to that. QUOTE (BobHamburger @ Aug 21 2008, 12:30 PM) As far as I'm concerned, I wouldn't miss it if the sequence structure were completely removed from LabVIEW. IMHO, it simply has no place in the dataflow-dependency paradigm. No! Sequence Structure - I see your point RE: data flow. But this structure seems to have been quite a standard in LV5-6 code (along with globals ) before everyone picked up the design pattern ball and ran with it. I personally would hate to see this be unsupported if I had to bring up LV5/6/7 into LV8+. Flat Sequence - definately not. a ) There are enough NI VIs that are not sequence with the error cluster (timers etc...) to warrent this (I know Open G have fixed this) Quote Link to comment
shoneill Posted August 22, 2008 Report Share Posted August 22, 2008 QUOTE (jgcode @ Aug 21 2008, 07:46 AM) a) There are enough NI nodes that are not sequenced with the error cluster (timers, locals, global etc...) to warrent this (I know Open G have done a fix for the timers)e) Followup to a) If you want to use the "wait until ms" timer correctly e.g. RealTime - then it needs to sit in its own frame in a loop - the frame after you code has executed. Otherwise it will run at an unknown time (due to parallelism) and your code will be off time. Or use the OpenG versions with error inputs and outputs. You DO wire the erros terminaly, right? It's a better solution than sequence structure and needs less space on the diagram..... Shane. Quote Link to comment
Tom Bress Posted August 22, 2008 Report Share Posted August 22, 2008 I agree that sequence structures should be avoided if possible. But here's what I want to know. If sequence structures are so bad, why do they figure so prominently in the LabVIEW logo? The logo is an Add superposed on a sine wave sitting in a big fat sequence structure frame! Quote Link to comment
LAVA 1.0 Content Posted August 22, 2008 Report Share Posted August 22, 2008 QUOTE (Tom Bress @ Aug 21 2008, 10:07 AM) I agree that sequence structures should be avoided if possible. But here's what I want to know. If sequence structures are so bad, why do they figure so prominently in the LabVIEW logo? The logo is an Add superposed on a sine wave sitting in a big fat sequence structure frame! Trademarks time to establish and are very slow to change. We could ask a similar question about "Coke". Ben Quote Link to comment
John Lokanis Posted August 22, 2008 Author Report Share Posted August 22, 2008 QUOTE (BobHamburger @ Aug 20 2008, 09:30 PM) As far as I'm concerned, I wouldn't miss it if the sequence structure were completely removed from LabVIEW. IMHO, it simply has no place in the dataflow-dependency paradigm. Like I said in my post above, there is still a GOTO statement in C, but nobody uses it anymore! So, removing them may not be a good idea, but LV training classes should definitely show new DEVs how to avoid them. Actually, they are a good indicator of LV exp when reviewing someone's code who applies for a position. I am afraid the new diagram cleanup feature may help hide some applicants lack of experience. But, on the other hand, it might help teach them good style... Quote Link to comment
jgcode Posted August 23, 2008 Report Share Posted August 23, 2008 QUOTE (jgcode @ Aug 21 2008, 01:46 PM) a) There are enough NI nodes that are not sequenced with the error cluster (timers, locals, global etc...) to warrent this (I know Open G have done a fix for the timers) QUOTE (shoneill @ Aug 21 2008, 03:50 PM) Or use the OpenG versions with error inputs and outputs. You DO wire the erros terminaly, right? It's a better solution than sequence structure and needs less space on the diagram..... Shane. I know this topic has been moved but... Dude - I know Open G is available as I mentioned it. Its not a better solution - its a different solution. And no, if you are already using the flat sequence then it doesn't have to take up more space Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.