LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Flat sequence problem

I have a problem in a flat sequence structure located on a program i'm doing.

 

The program is based on 4 while loops that are communicated using ocurrences.

 

The problem is in the loop labeled "Calculo parametros salida" in the transition between the 2nd frame and the 3rd frame. The value that might be assigned to the string variable

"string" it's never assigned, and, also, the control that it would be enabled, it's never turned visible.I've tried to use highlighting function while checking in run mode, and, effectively, the "flux" stops its movement when before arriving to the 3rd frame (the 3rd frame appears grayed).

 

My objective is show this message and to set visible the control "go control" in order to wait for the ocurrence that will be produced by the activation of the "go control" button, that will produce the first iteration on the "Calculo parametros salida" loop and the "uninhibition" of the 2nd loop named "control".

 

I don't understand why occurs this situation. I've probed substituting the 3rd frame: i've deleted the 3rd frame and i used an event structure, so that event structure would be associated to a static event (value change on some of the indicators that are located on the 2nd frame) but the sequence also doesn't work.

If you have any question about my explanation (i'm not an english speaker, sorry but my bad english), please: tell me.

 

If you're asked for some libraries, ignore the prompts, these files are not necessary to solve my problem.

 

 

Thanks.

 

 

Óscar R.

 

 

 

 

0 Kudos
Message 1 of 7
(3,803 Views)

Let me begin by encouraging you to rewrite this as a State Machine, perhaps a Producer/Consumer architecture with a State Machine in the consumer loop. Your program seems to be relying on things happening in a defined sequence, and that what a State Machine was designed to do. (My favorite is the JKI State Machine. It would be worth your time to learn how to use it.)

 

Now, briefly:

  • Your entire Block Diagram should fit on one screen (or scroll in only one direction, but you can usually avoid that)
  • Sequence Structures are bad aren't necessary, EVER 😄
  • Local Variables are bad aren't necessary (unless you're setting a control's value), there are good alternatives.

Perhaps other folks had the same trouble I had, perhaps you'll get a better answer from someone else...
Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 2 of 7
(3,784 Views)

Because you have an infinite while loop in your 2nd frame.  There is a small loop where you do an Interpolate 1-D array.  You have a False constant wired to the stop terminal.  That loop never ends.  Since the loop never ends, the 2nd frame never finishes.  Which means the 3rd frame never starts.  Highlight execution should show that code is executing in that while loop.

 

I'd recommend running the code cleanup tool on your VI so that the wires lose their extra kinks and the various loops become more consolidated.

In your one loop where you have a single sequence frame, you have a lot of unnecessary code.  You read from a control and write to a local variable of it.  Or read from a local variable and and write to an indicator.  Why?   These bits of code don't do anything.
Message Edited by Ravens Fan on 07-17-2009 09:55 PM
Message 3 of 7
(3,777 Views)

Ravens already touched most crucial points. Still, I was wondering what the idea is behind the following code fragment 😮

 

Message Edited by altenbach on 07-18-2009 12:46 AM
0 Kudos
Message 4 of 7
(3,763 Views)
rube goldberg much lol :))
Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
0 Kudos
Message 5 of 7
(3,754 Views)

jcarmody wrote:

...what a State Machine was designed to do. (My favorite is the JKI State Machine. It would be worth your time to learn how to use it.)


I think that state machine has a major disadvantage Smiley Sad

You have to type the full state name all the time Smiley Surprised

So a typo can easily disturb the whole sequence.

 

I think using a type def with all state names is a much be better way to keep all the state names.

So you only have to select an existing state name without typing it.

 

For the rest Open G tools are perfect, I use them all the time Smiley Happy

I won't use this state machine but keep mine Smiley Tongue

0 Kudos
Message 6 of 7
(3,746 Views)

Alain S wrote: 

So a typo can easily disturb the whole sequence.


Maybe for you, but I don't use typos in my code.  I can't see why anyone would...

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 7 of 7
(3,702 Views)