LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

While Loop and case structures in parallel

Highlighted

Here...I attached one simple program that i am using in my application as flow..While loop code  runs inside and executing results...Here I am passing while loop value in case structure...But it is not being executing...Why this is happening...!! How can pass to value in case structures...

0 Kudos
Message 1 of 20
(516 Views)
Highlighted

You need to start with simple tutorials and learn about the principles of dataflow.

 

You have three independent code segments that all start at the same time. Only the loop will continue to spin while the other two will complete in an instant and will never execute again during that same run.


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
0 Kudos
Message 2 of 20
(504 Views)
Highlighted

Well..!! I am accepting challenge...I want to put whole code in either in event structure or sequence structure..Is it correct way..??

0 Kudos
Message 3 of 20
(474 Views)
Highlighted

@Tusharvp4 wrote:

Well..!! I am accepting challenge...I want to put whole code in either in event structure or sequence structure..Is it correct way..??


No.


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
0 Kudos
Message 4 of 20
(462 Views)
Highlighted

I tried this logic..

0 Kudos
Message 5 of 20
(453 Views)
Highlighted

Please stop posting meaningless garbage code that makes no sense. You NEED to start with tutorials and learn the basic principles of dataflow!.

 

Again you have three code fragments that all start immediately, the two on top will complete in nanoseconds while the event structure will wait forever because a timeout never happens (unwired timeout is infinite!) Changing any controls at this point does nothing because the terminals have already been  read.

 

What is the program supposed to do?


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
0 Kudos
Message 6 of 20
(438 Views)
Highlighted

Capture.PNG

I am reading data from measurement in while loop..Process 1 for storing data in Database..Process 2 is for PDF Report Code..

0 Kudos
Message 7 of 20
(406 Views)
Highlighted

Hi Tusharvp,

 

please do the basics tutorials to learn about THINK DATAFLOW!

 

Why do you need a FOR loop iterating just once?

Why do you need a sequence structure?

Why do you need local variables?

 

Your code may look like this:

Best regards,
GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO
0 Kudos
Message 8 of 20
(393 Views)
Highlighted

@GerdW wrote:

Why do you need a sequence structure?


Your code (as written) will not care about booleans operated during the run. Not sure what the OP wants. ALso the stop contion should typically be "stop if true" unless the button has a weird default and mechanical action or the while loop does not even need to be there..


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
0 Kudos
Message 9 of 20
(381 Views)
Highlighted

Hi Christian,

 


@altenbach wrote:
Your code (as written) will not care about booleans operated during the run. Not sure what the OP wants.

I agree on this one. Still no sequence needed when the "process" buttons are placed inside the loop…

 


@altenbach wrote:
ALso the stop contion should typically be "stop if true" unless the button has a weird default and mechanical action or the while loop does not even need to be there..

I just took what Tusharvp created: I always assume there is a conscious intention of the code creator…

Best regards,
GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO
Message 10 of 20
(361 Views)