LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

While loop containing event loop and a regular loop result in system unresponsiveness


@gilmaor1 wrote:

What did, Is to remove all inner loop. and create case structure, where I control the their indexes.. and thus I creating "Loops" and loops within loops.


It is very difficult to imagine what all this even means... 😮

 

(What's the difference between a loop and a "loop"? Case structures don't have "indexes"..., etc.)

0 Kudos
Message 11 of 21
(1,011 Views)

Similar to my feelings about semaphores, if you need to unlock the front panel for your code to work, you probably need to consider re-architecting your code.

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.
0 Kudos
Message 12 of 21
(991 Views)

Hello All,

 

What I failed to mention is that the code outside the event structure has loops which call for events.

Surley this is the issue....

 

I have solved this by creataing a "psuedo loop" 

 

I run my code in the main loop, and manage the itterations manually using case structure, So after each event I will return to the correct place of the code.

 

 

 

 

0 Kudos
Message 13 of 21
(963 Views)

@gilmaor1 wrote:

I have solved this by creataing a "psuedo loop" 

 

I run my code in the main loop, and manage the itterations manually using case structure, So after each event I will return to the correct place of the code.

 


Nobody here will be able to make sense of your description. Once you show us your VI, we can comment and offer suggestions.

 

0 Kudos
Message 14 of 21
(949 Views)

@altenbach wrote:

@gilmaor1 wrote:

I have solved this by creataing a "psuedo loop" 

 

I run my code in the main loop, and manage the itterations manually using case structure, So after each event I will return to the correct place of the code.

 


Nobody here will be able to make sense of your description. Once you show us your VI, we can comment and offer suggestions.

 



Aztec programmers probably think it's beautiful 😍


"Should be" isn't "Is" -Jay
0 Kudos
Message 15 of 21
(945 Views)

@JÞB wrote:

@altenbach wrote:

@gilmaor1 wrote:

I have solved this by creataing a "psuedo loop" 

 

I run my code in the main loop, and manage the itterations manually using case structure, So after each event I will return to the correct place of the code.

 


Nobody here will be able to make sense of your description. Once you show us your VI, we can comment and offer suggestions.

 



Aztec programmers probably think it's beautiful 😍


😄

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.
0 Kudos
Message 16 of 21
(937 Views)

Hello,

 

This is my code.

 

0 Kudos
Message 17 of 21
(927 Views)

@gilmaor1 wrote:

This is my code.


Well I never had to test an algorythm 😋, but I would clean up quite a bit.

 

Even if you get that to work without cleaning up, you're not doing yourself any favors. Asynchronous processes call for asynchronous loops.

 

0 Kudos
Message 18 of 21
(917 Views)

@gilmaor1 wrote:

This is my code.


By only rearranging things for 5 minutes, it looks like this:

wiebeCARYA_0-1649083052417.png

 

For reference:

wiebeCARYA_2-1649083459223.png

 

 

0 Kudos
Message 19 of 21
(912 Views)

@gilmaor1 wrote:

This is my code.


Ah, what a mess.

 

  • Why a combobox instead of enum? Do you really want the user to type random, unhandled strings?
  • Why value properties instead of local variables?
  • Why are there duplicate names (e.g. there is a t1 control and a t1 indicator, so the signaling event for t1 can cause endless confusion!). If you want then named the same on the front panel, use the caption.
  • Why is the front panel in such disarray?
  • Why is the diagram such a mess? Are you paid by the number of wire bends?
  • "Numeric", "array", "Combo box" are not reasonable labels.
  • Why is case 999 mentioned? A plain "default" is sufficient. (see also)
  • I still don't see why you need an event structure at all. You are polling things at ms intervals anyway.

 

I will refrain from more comments, because it is not even clear what the VI is supposed to do. Whatever it is, I am sure it can be done with 20% of the current code.

0 Kudos
Message 20 of 21
(901 Views)