LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

code simplification & improvment



tinnitus wrote:
I thought about what you tell me with event structure : never to use event in event.
But how to do when you use a vi containing event structure  ex  :

You don't give enough information and you image does not tell me anything. I cannot tell what you mean.
 
For example if you call a dialog style subVIs containing their own event structure, that's probably fine becaue the main VI will wait anyway.
 
A better rule is to make sure that all event structures are always ready to trigger within a very short time frame and they should not hold up the dataflow, i.e. complete quickly. If you place events inside events, the outer event is deadlocked because it cannot fire until the inner ever fires. If you place loops inside events, the event does not complete in a short time, also not good.


tinnitus wrote:
Last question : is there a limit to number of parallele event structure

Everything in a computer is limited in some way, because you don't have an infinite address space, but I doubt you'll ever run into any practical limits. 😉

0 Kudos
Message 11 of 19
(1,504 Views)
Hello,

The code behaves that i expected, but one thing i don't know how to solve:

the code in seq, timeout event can takes from 200 to 400 ms, so my 1s (theoric ) sampling rate  is  not constant ,
i can use a mean timeout  to minimize error (700 ms) but  it isn't  very fair.

How can i proceed ?

Best regards

Tinnitus

 
CLAD / Labview 2011, Win Xp
------------------------------------------------------
Mission d'une semaine- à plusieurs mois laissez moi un MP...
RP et Midi-pyrénées .Km+++ si possibilité de télétravail

Kudos always accepted / Les petits clicks jaunes sont toujours appréciés
Don't forget to valid a good answer / pensez à valider une réponse correcte
0 Kudos
Message 12 of 19
(1,474 Views)
You could just meaure the actual code timing and adjust the timeout for the remaining time balance. See attached.
0 Kudos
Message 13 of 19
(1,461 Views)
thanks my lord you are killing meSmiley Wink,  an the coerse function what a refinement


cordialy

Tinnitus


CLAD / Labview 2011, Win Xp
------------------------------------------------------
Mission d'une semaine- à plusieurs mois laissez moi un MP...
RP et Midi-pyrénées .Km+++ si possibilité de télétravail

Kudos always accepted / Les petits clicks jaunes sont toujours appréciés
Don't forget to valid a good answer / pensez à valider une réponse correcte
0 Kudos
Message 14 of 19
(1,451 Views)
me again ...

During sequence loop (1000ms) i would like to have a parallele loop  triggered and acting every 250ms

For  the moment she triggs on seq button, perhaps it sould be better if activated by 1000ms loop ?

The parellele loop is launched but running by itself and i don't now how to synchronise my with 1000ms loop

I         I        I
1234 1234 1234

I tried wait until but without result...


Best regards

Tinnitus






CLAD / Labview 2011, Win Xp
------------------------------------------------------
Mission d'une semaine- à plusieurs mois laissez moi un MP...
RP et Midi-pyrénées .Km+++ si possibilité de télétravail

Kudos always accepted / Les petits clicks jaunes sont toujours appréciés
Don't forget to valid a good answer / pensez à valider une réponse correcte
0 Kudos
Message 15 of 19
(1,439 Views)
Look into Timed Loops.  They should give you the ability to synchronize.
 
Also look at either notifiers or Rendezvous,  they give the ability to send signals from one loop to another.
Message 16 of 19
(1,421 Views)

Here's one simple possibility:

 

0 Kudos
Message 17 of 19
(1,409 Views)
Note: Of course the tone of the inner loop can be a single constant. I left it as an array to allow for four different tones for 1, 2, 3, and 4.
Message 18 of 19
(1,405 Views)
Thank you

it works great

Best regards

Tinnitus



 
CLAD / Labview 2011, Win Xp
------------------------------------------------------
Mission d'une semaine- à plusieurs mois laissez moi un MP...
RP et Midi-pyrénées .Km+++ si possibilité de télétravail

Kudos always accepted / Les petits clicks jaunes sont toujours appréciés
Don't forget to valid a good answer / pensez à valider une réponse correcte
0 Kudos
Message 19 of 19
(1,391 Views)