Jump to content

Communicating between case structures using data flow is possible


Recommended Posts

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

Link to comment

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

Link to comment

QUOTE (mross @ Jan 15 2009, 11:46 AM)

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. :unsure: You're running out of time! Good luck tomorrow. :thumbup:

</jim>

PS - Hi, mross. I'm in Wilson, NC, too!

Link to comment

QUOTE (mross @ Jan 15 2009, 11:46 AM)

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. :unsure: You're running out of time! Good luck tomorrow. :thumbup:

</jim>

PS - Hi, mross. I'm in Wilson, NC, too!

Link to comment

QUOTE (jcarmody @ Jan 15 2009, 05:44 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 (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

Link to comment

QUOTE (jcarmody @ Jan 15 2009, 05:44 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 (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

Link to comment

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.

Link to comment

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

Link to comment

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

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.