LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Something is blocking my loop and I can't update the buttons

Hi, programing in Labview is like jumping from one to another problem...:mansad:

 

This time I can't get why the main while loop isn't updated at all?!

 

Ok, there are events and also a case structure, but why isn't the program running at all?

 

The button (Abspielen) only works when I remove the event structure and the main program (inside of the case).

 

0 Kudos
Message 1 of 13
(900 Views)

Hi Steffen,

 

quite a problem with the LabVIEWForum down nowadays?

 

- Without being able to open your VI right now I guess your event structure blocks your UI. In each event configuration you have the (quick&dirty) option to unblock the UI while the event is processed…

- Don't hide event structures inside cases.

- Process events as fast as possible.

Mind to attach your VI in LV2011?

Best regards,
GerdW
CLAD expired, using 2009SP1 + LV2011SP1 + LV2017 (+LV2018 sometimes) on Win7+cRIO
Kudos are welcome Smiley Wink

Message 2 of 13
(897 Views)

Steffen,

 

please go for a proper producer/consumer pattern and PLEASE make the diagram way smaller....

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 3 of 13
(890 Views)

Hi Gerd,

Nice to meet you here. It seems that the down time is quite a while...

 

I put a event structure inside a case. It might be a mistake, but doesn't solve the problem.

 

So, I attached you the 2011 version.

 

btw: I  solved the problem I had with saving the data...

0 Kudos
Message 4 of 13
(886 Views)

Hi Steffen,

 

as Norbert said: clean up, make the BD (way) smaller!

 

- In case of a VISA error your innermost VISARead-loop will spin forever, burning the CPU (and blocking your VI)…

- Do you really need a VISA-timeout of 4000s (or ~66min)?

- Please don't hide event structures inside case structures. They will prone to block your UI…

- Don't create several event structures within one VI. It may work, but it is not considered "good style"…

- Don't delete the label of controls or indicators. In text-based programming you wouldn't do this too. In case the label isn't needed on the FP you can always hide it!

- Don't use local variables, when the terminals aren't used so far…

Best regards,
GerdW
CLAD expired, using 2009SP1 + LV2011SP1 + LV2017 (+LV2018 sometimes) on Win7+cRIO
Kudos are welcome Smiley Wink

Message 5 of 13
(878 Views)

@SteffenS wrote:

Hi, programing in Labview is like jumping from one to another problem...:mansad:

 

This time I can't get why the main while loop isn't updated at all?!

 

Ok, there are events and also a case structure, but why isn't the program running at all?

 

The button (Abspielen) only works when I remove the event structure and the main program (inside of the case).

 


I have to say this, but unfortunately for us developers... a computer will do exactly what you tell it to.  Smiley Very Happy

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 6 of 13
(861 Views)

your loop is not running at all because you have put one event structure inside while loop with no timeout case.

so only when you have an event fired that is registered with event structure then your loop will run once and again going to wait for an event to occur.

Learning LabVIEW or any other language is fun. You face some problem when you just start it doesn't mean language is trouble.

You get better by practice and experience. 

Message 7 of 13
(849 Views)

Along with some of the other problems pointed out above

look at this loop:

Capture.PNG

If the value of "Abspielen" is true this loop will start.  and never end.............................Blocking the outer loop from ever iterating again. (at least while "False" is not equal to "True"--  And that is always the case in every instance where I have tested it)

Always maintain an accurate count of deployed mousetraps.
Message 8 of 13
(839 Views)

Oh my.........

Jeff , i did not scroll down to see that . My fault 

Thats a huge while loopSmiley Surprised

Message 9 of 13
(829 Views)

SteffenS wrote:

I put a event structure inside a case. It might be a mistake, but doesn't solve the problem.


The entire code architecture is very problematic.

 

  • The events for "kanal 2..4" and "schreibe protokoll" lock the front panel until the event completes. Since some the event structures are inside a case structure, it is possible that the event strcuture can never be reached by dataflow, locking the VI up forever. Remember, event structures queue up events even if they are not ready to execute due to dataflow constraints. Since this loop never stops, the outer loop can never iterate. All code parts need to complete before the loop can go to the next iteration.
  • Each event structure belongs in it's own independent while loop which has no data dfependency to other code (i.e. in cannot be in another loop or case structure. etc).
  • In the lower corner you have loops inside loops and the innermost loop can potentially never stop if a certain character is never received.
  • What's the point of all these decoration frames?
  • You need to recode this entire thing in one of the extablished desing patterns. Use a loop to handle UI interactions and parallel loops to handle independent other parts.

LabVIEW Champion Do more with less code and in less time
Message 10 of 13
(825 Views)