LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

code simplification & improvment

Hello,

i wrote a vi that works well but i'm not sure about  principles used, especialy concerning :

1) stop fonction with glabal var management

2) initialisation

3) ordering sequence/ loop using false variable

4) other i don't suspect ...

thank you for any suggestion

Cordialy

Tinnitus









Message Edité par tinnitus le 04-06-2008 12:18 PM
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 1 of 19
(4,255 Views)

May be something like this...

Interesting what are the weak places in this VI...

_________________________________________________________________________________________________
LV 8.2 at Windows & Linux


0 Kudos
Message 2 of 19
(4,224 Views)

Hi tinnitus,

i think to use an Event Structure more than one time in a VI is not a good a solution. And if you shrink it to only one Event you don´t need the global to stop the vi.

Mike

0 Kudos
Message 3 of 19
(4,213 Views)
wooh,
thanks all,

nice performance mishklyar for mind abstact.

I knew i i would have not replace my loop, In fact i post a simplified vi without the timed loop for lisibility thinking modifications weren't so importants.

in fact i really need a 1st stage where almost all panel accessible and restricted during sequence loop "acquisition of measures".

End of sequence simulate a final choice of user so there is not really two stop button in VI

hoping that information don't change vi too much...

Thank you for all

for moment my eyes can't stand more front of srcreen (22h50 here) i will work on this vi tomorrow

thanks a lot

Tinnitus

Message Edité par tinnitus le 04-06-2008 03:46 PM
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 4 of 19
(4,192 Views)
"hoping that information don't change vi too much..."

i can't sleep without clarifying my thought

I wanted to say the one that you proposed me


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 5 of 19
(4,174 Views)
tinnitus wrote:
1) stop fonction with glabal var management
You don't need any globals.
2) initialisation
You can do initialization in the first iteration of the UI loop.

3) ordering sequence/ loop using false variable
Sorry, I don't know what you mean.
4) other i don't suspect ...
Never place event structures inside event structures and never place while or timed loops inside the main UI event structure.
Instead of 14 property nodes, all you need is four of those!
 
Attached is a quick draft how you could do things. The lower loop handles immediate UI events and the disabling and enabling of controls. The upper loop does the sequencing.
 
See if it makes sense to you.
Message 6 of 19
(4,150 Views)
Hello altenbach,

Thank you for time spent

Effectively the functioning is perfect, I cannot say yet if it agrees because this style of code is a little bit difficult to read for a beginner as I
But I work above and I shall return, when I would have digested the conception...

one more question, how events structures can be used in parallele ?

Best regards

Tinnitus




Message Edité par tinnitus le 04-07-2008 07:54 AM
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 7 of 19
(4,113 Views)
Hello,

after few tries i have better understanding,

it keeps few questions, seq btn and stop loop are commons to both event  how to decide in wich you place the command btn if there is any influence...

i don't see clearly how stop vi works,  command btn can be intervrted without bad effects, command in one , and other trigged on new val ...

i made those tries it seems not to disturb fonctionality but perhaps i just don't see them  

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 8 of 19
(4,094 Views)


tinnitus wrote:

it keeps few questions, seq btn and stop loop are commons to both event  how to decide in wich you place the command btn if there is any influence...

I does not really matter. If one event case shares several events, it is often easier to place it there so you have direct access to the new value. If the event case is not shared, you can use the "new value" event terminal for the new value. Otherwise, place the terminal in the event case that completes faster.


tinnitus wrote:
i don't see clearly how stop vi works,  command btn can be intervrted without bad effects, command in one , and other trigged on new val ...

i made those tries it seems not to disturb fonctionality but perhaps i just don't see them  

Sorry, I have problems understanding what you mean. Could you repeat that in a few more sentences or even make an example? Are you talking about "stop VI" or "stop loop"? Which button is the "command btn"? What kind of tries? What functionality? What bad effects? What "other"?
0 Kudos
Message 9 of 19
(4,078 Views)
Hello,

yes i got it , i had not understood all subtility :  stop loop is not really a stop but rather a timeout disabling

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  :

A panel of menu that propose to use applications based on event structure see pict
have i had to replace sub vi caller with state machine (polling)

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

Thank you

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 10 of 19
(4,064 Views)