GSR Posted January 16, 2009 Report Share Posted January 16, 2009 Communicating between case structures using data flow is possible or not? Quote Link to comment
mross Posted January 16, 2009 Report Share Posted January 16, 2009 QUOTE (zmarcoz @ Jan 15 2009, 11:32 AM) Communicating between case structures using data flow is possible or not? Yes. You connect the case structures with a wire and data flow is the means by which the vi is sequenced. Sort of like gravity - you have no choice at all - data flow happens. I have to ask, what do you think the definition of data flow is? Mike Quote Link to comment
mross Posted January 16, 2009 Report Share Posted January 16, 2009 QUOTE (zmarcoz @ Jan 15 2009, 11:32 AM) Communicating between case structures using data flow is possible or not? Yes. You connect the case structures with a wire and data flow is the means by which the vi is sequenced. Sort of like gravity - you have no choice at all - data flow happens. I have to ask, what do you think the definition of data flow is? Mike Quote Link to comment
jcarmody Posted January 16, 2009 Report Share Posted January 16, 2009 QUOTE (mross @ Jan 15 2009, 11:46 AM) I have to ask, what do you think the definition of data flow is? This looks like a follow-up to http://forums.lavag.org/-t12864.html&view=findpost&p=56729' target="_blank">this post. zmarcoz, you were asked to post a picture of what you were asking. That'll get you your answer. It looks to me like you mistakenly wrote "case structures" instead of "while loops" here. QUOTE B you cannot use wires to pass data between case structures. <=== My choice, but not sure is correct I recall a question that had a wire from the stop button in one while loop going to the conditional terminal in a second while loop. The problem with this architecture is that the second loop won't start until the first loop is stopped (with the button), then it will only loop one time because the stop button sent a True. Of course, I'm only guessing BECAUSE YOU DIDN'T POST YOUR CODE/PICTURE. You're running out of time! Good luck tomorrow. :thumbup: </jim> PS - Hi, mross. I'm in Wilson, NC, too! Quote Link to comment
jcarmody Posted January 16, 2009 Report Share Posted January 16, 2009 QUOTE (mross @ Jan 15 2009, 11:46 AM) I have to ask, what do you think the definition of data flow is? This looks like a follow-up to http://forums.lavag.org/-t12864.html&view=findpost&p=56729' target="_blank">this post. zmarcoz, you were asked to post a picture of what you were asking. That'll get you your answer. It looks to me like you mistakenly wrote "case structures" instead of "while loops" here. QUOTE B you cannot use wires to pass data between case structures. <=== My choice, but not sure is correct I recall a question that had a wire from the stop button in one while loop going to the conditional terminal in a second while loop. The problem with this architecture is that the second loop won't start until the first loop is stopped (with the button), then it will only loop one time because the stop button sent a True. Of course, I'm only guessing BECAUSE YOU DIDN'T POST YOUR CODE/PICTURE. You're running out of time! Good luck tomorrow. :thumbup: </jim> PS - Hi, mross. I'm in Wilson, NC, too! Quote Link to comment
GSR Posted January 16, 2009 Author Report Share Posted January 16, 2009 QUOTE (jcarmody @ Jan 15 2009, 05:44 PM) This looks like a follow-up to this post. zmarcoz, you were asked to post a picture of what you were asking. That'll get you your answer. It looks to me like you mistakenly wrote "case structures" instead of "while loops" here. I recall a question that had a wire from the stop button in one while loop going to the conditional terminal in a second while loop. The problem with this architecture is that the second loop won't start until the first loop is stopped (with the button), then it will only loop one time because the stop button sent a True. Of course, I'm only guessing BECAUSE YOU DIDN'T POST YOUR CODE/PICTURE. You're running out of time! Good luck tomorrow. :thumbup: </jim> PS - Hi, mross. I'm in Wilson, NC, too! What is data flow? As I know Communicating between while loop using data flow is NOT possible But Why the VI in the pic is OK? What is the meaning of communicating between while loop(case structure) please help QUOTE (zmarcoz @ Jan 15 2009, 08:51 PM) What is data flow? As I know Communicating between while loop using data flow is NOT possible But Why the VI in the pic is OK? What is the meaning of communicating between while loop(case structure) please help Quote Link to comment
GSR Posted January 16, 2009 Author Report Share Posted January 16, 2009 QUOTE (jcarmody @ Jan 15 2009, 05:44 PM) This looks like a follow-up to this post. zmarcoz, you were asked to post a picture of what you were asking. That'll get you your answer. It looks to me like you mistakenly wrote "case structures" instead of "while loops" here. I recall a question that had a wire from the stop button in one while loop going to the conditional terminal in a second while loop. The problem with this architecture is that the second loop won't start until the first loop is stopped (with the button), then it will only loop one time because the stop button sent a True. Of course, I'm only guessing BECAUSE YOU DIDN'T POST YOUR CODE/PICTURE. You're running out of time! Good luck tomorrow. :thumbup: </jim> PS - Hi, mross. I'm in Wilson, NC, too! What is data flow? As I know Communicating between while loop using data flow is NOT possible But Why the VI in the pic is OK? What is the meaning of communicating between while loop(case structure) please help QUOTE (zmarcoz @ Jan 15 2009, 08:51 PM) What is data flow? As I know Communicating between while loop using data flow is NOT possible But Why the VI in the pic is OK? What is the meaning of communicating between while loop(case structure) please help Quote Link to comment
jcarmody Posted January 16, 2009 Report Share Posted January 16, 2009 QUOTE (zmarcoz @ Jan 15 2009, 03:52 PM) But Why the VI in the pic is OK? What is the meaning of communicating between while loop(case structure) The pictured VI is fine because the two loops aren't trying to run in parallel. The first loop is building an array of random numbers and the second loop simply indexes through that array, increments each element and displays it on the Front Panel (although, it'll be too fast to see). This wouldn't work if you wanted to display the incremented value in the second loop while the first loop was still running. (BTW, you'd be better off using a For Loop instead of the second While Loop; it'll auto-index the array and you don't need to worry about the loop conditional terminal.) http://zone.ni.com/reference/en-XX/help/371361E-01/lvconcepts/block_diagram_data_flow/' target="_blank">This is data flow. I don't know QUOTE the meaning of communicating between while loop(case structure) </jim> Quote Link to comment
jcarmody Posted January 16, 2009 Report Share Posted January 16, 2009 QUOTE (zmarcoz @ Jan 15 2009, 03:52 PM) But Why the VI in the pic is OK? What is the meaning of communicating between while loop(case structure) The pictured VI is fine because the two loops aren't trying to run in parallel. The first loop is building an array of random numbers and the second loop simply indexes through that array, increments each element and displays it on the Front Panel (although, it'll be too fast to see). This wouldn't work if you wanted to display the incremented value in the second loop while the first loop was still running. (BTW, you'd be better off using a For Loop instead of the second While Loop; it'll auto-index the array and you don't need to worry about the loop conditional terminal.) http://zone.ni.com/reference/en-XX/help/371361E-01/lvconcepts/block_diagram_data_flow/' target="_blank">This is data flow. I don't know QUOTE the meaning of communicating between while loop(case structure) </jim> Quote Link to comment
Maca Posted January 16, 2009 Report Share Posted January 16, 2009 QUOTE (zmarcoz @ Jan 16 2009, 06:52 AM) What is data flow?As I know Communicating between while loop using data flow is NOT possible But Why the VI in the pic is OK? What is the meaning of communicating between while loop(case structure) please help The first loop will execute a number of times and build an array (auto indexing tunnels). When this loop exists this array is then read via the second loop and will very quickly display all the values in the array +1 in the indicator. Quote Link to comment
Maca Posted January 16, 2009 Report Share Posted January 16, 2009 Thanks jcarmody, while was writing a piss poor explanation you posted that very elegant explanation. You said exactly what I was trying to say but 10* better. Quote Link to comment
mross Posted January 17, 2009 Report Share Posted January 17, 2009 QUOTE (zmarcoz @ Jan 15 2009, 11:32 AM) Communicating between case structures using data flow is possible or not? You should consider not writing any more LabVIEW code until you understand data flow. If you do not understand this, you will waste great amounts of time, our time and your own until you do. Data flow is the manner by which LabVIEW sequences activities. Data flow is not sequential. Sequential progress is typical for text based programming languages. Test based: Line by Line using conditionals to branch in different ways (IF THEN ELSE) jump to a different section (GO TO) and so on. Generally, a sequential logic will execute in the same order every time the same inputs are applied. Parallel activities can be very complex to execute in sequential code. Data flow: Stated simply, a node executes at the time all its inputs are filled. "Node" means a sub-VI, a loop, a case structure, a primitive function, a library call, etc. - all the things you attach wires to are nodes. A node will NOT execute if its inputs are not ALL filled. A node produces outputs when all the outputs are filled internal to the node. A node will not produce outputs until ALL the internal data flow activities have filled the output terminals. (However, some output terminals may have a default value that is not dependent on data flow - this is particularly pertinent to case structures.) Because of data flow LabVIEW is inherently parallel in its execution. You can create parallel activities with out any effort at all. The best thing for you to do is turn on the highlighting tool and observe how data flows through the VI. (This tool is the incandescent light bulb symbol on the block diagram menu.) Many people understand data flow as it applies to subvi's and functions, but fail to understand that the same principle applies to loops and other structures. A while loop does not end looping immediately when the stop terminal gets its value, it waits until ALL the output terminals have values, then it does not perform any further iterations and the data flows away from the whille loop. If the output terminals do not get values the loop will "hang" or wait indefinitely until the data arrives. So the answer to your question is: Yes, data flow is not only possible, it is mandatory. Data flow is how LabVIEW works, nothing less. Mike Quote Link to comment
mross Posted January 17, 2009 Report Share Posted January 17, 2009 QUOTE (zmarcoz @ Jan 15 2009, 11:32 AM) Communicating between case structures using data flow is possible or not? You should consider not writing any more LabVIEW code until you understand data flow. If you do not understand this, you will waste great amounts of time, our time and your own until you do. Data flow is the manner by which LabVIEW sequences activities. Data flow is not sequential. Sequential progress is typical for text based programming languages. Test based: Line by Line using conditionals to branch in different ways (IF THEN ELSE) jump to a different section (GO TO) and so on. Generally, a sequential logic will execute in the same order every time the same inputs are applied. Parallel activities can be very complex to execute in sequential code. Data flow: Stated simply, a node executes at the time all its inputs are filled. "Node" means a sub-VI, a loop, a case structure, a primitive function, a library call, etc. - all the things you attach wires to are nodes. A node will NOT execute if its inputs are not ALL filled. A node produces outputs when all the outputs are filled internal to the node. A node will not produce outputs until ALL the internal data flow activities have filled the output terminals. (However, some output terminals may have a default value that is not dependent on data flow - this is particularly pertinent to case structures.) Because of data flow LabVIEW is inherently parallel in its execution. You can create parallel activities with out any effort at all. The best thing for you to do is turn on the highlighting tool and observe how data flows through the VI. (This tool is the incandescent light bulb symbol on the block diagram menu.) Many people understand data flow as it applies to subvi's and functions, but fail to understand that the same principle applies to loops and other structures. A while loop does not end looping immediately when the stop terminal gets its value, it waits until ALL the output terminals have values, then it does not perform any further iterations and the data flows away from the whille loop. If the output terminals do not get values the loop will "hang" or wait indefinitely until the data arrives. So the answer to your question is: Yes, data flow is not only possible, it is mandatory. Data flow is how LabVIEW works, nothing less. Mike 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.