LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

exit of queued state machine

I have run into timing problems in the past using the approach you are using where you flush the queue and then queue the exit command. What I have found to be more reliable is to leave whatever is in the queue there and insert the Exit or Stop commands at the front of the queue using "Enqueue Element At Opposite End". I have found this to be the most reliable. This may not solve your delay. I did not look through your code to see if you have some arbitrary delay occuring that will slow your processing of the exit command. I do know that unless you lock your queue completely during the flush and enqueue operations you cannot guarantee that other events aren't queued before your exit command.


Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 11 of 22
(1,473 Views)

Hello,

 

thank vsh and Mark for your suggestion

 

Mark a question do you succeed to open 2009 release ?

 

I tried yet queued 'exit' in front of queue but with no change , for the moment i will put a 10ms wait in while loop

even if is not state of art it works...

 

In a next approach i will try to write kind of code like example we see in Theatre light code but it is not enough similar to be used

in a quick time 

 

Thank you 

 

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 22
(1,449 Views)
Did you try out this possibility?
0 Kudos
Message 13 of 22
(1,446 Views)

Hello vsh,

 

Yes, but the probleme is that i need to producer loop to be responding in a correct time so 

 

i will a to apply this method any time i want to change of  scenario , that means for exit, for launch calibration , for change of probe

 

so i can't see very well where is the interest of using queued if it needs to add little tips ( this its just my opinion )

 

I think i 'm not enough 'easy' with queued management 

 

if some one can advise me 'real' existing code, literature or books about kind of codind i will appreciate

 

 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 14 of 22
(1,442 Views)

Best place to get help on producer consumer architecture is from LabVIEW bookshelf.

 

Select File>New. You will find the template for producer consumer. (See the attachment)

 

 

You can also find helps here, and here 

 

I still cannot understand what is the problem in not executing the STTM Q MGR_new.vi when the exit case is executed/dequed. You just have to do what I have shown in the image. It will solve your problem. You need to have one case for Exit which will do nothing, and other case as a default, which shall execute for all other e-num values of etat courant. 

 

Message Edited by Vsh on 11-25-2009 06:54 AM
0 Kudos
Message 15 of 22
(1,437 Views)

I have attached copies of both my duel loop (producer/consumer) and single loop (UI and none mission critical timing) QSM structures.

It is a bit of a learning curve, but if nothing else, should point you in the correct  direction.  it allows for messaging between loops and handles exits pretty well, as long as the producer loop is not holding up execution.

Because it is a .lvlib file, you may have some issues with recreating the directory structure, but you should be able to get through it.

 

This is one of many similiar type of implementations.

 


Paul
Download All
0 Kudos
Message 16 of 22
(1,422 Views)

hello Vsh,

 

i really apreciate your help and links, 

  

but example done are very basics and don't show example with user interaction and interaction of consumer on it self ...  

 

i don't understand ppt doc it's just a theoric presentation or i don't have a good ppt reader

 

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 17 of 22
(1,419 Views)

Hello PJS,

 

user Events and consummer are in the same loop !!

 

Tell me if i missunderstood but it's look like JKI state machine , no ?

 

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 18 of 22
(1,406 Views)

Can't speak for the JKI statemachine, but most QSM templates look VERY similiar. There are subtle differences usually in the way the Exit, initializatoin, error handling, queue creation and debug features that seperate one from another. 

 

Consumer and user events are handled in the same loop.  However, using the design of the duel loop, it is easy to create a third if desired, although in the last decade and a half of doing this, I have never found a need for that personally.


Paul
Message 19 of 22
(1,404 Views)

Sorry, my screen it 's a small one i didn't see the top one

 

A question in multipe loop are loop slave of other or both are dependent and can naturally share Global fonctionnal for example

 

If it's not abused have you a little example ( not professional ) that could demonstrate fonctionnality of base loop and multiple loop

 

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 20 of 22
(1,387 Views)