11-24-2009 09:39 AM
Hello,
i have probleme existing an queued state machine vi :
I can't see how to do to make my vi stop before the wainting time here example is 3s (splitted in 25ms) .
I thinkthere is a probleme flush queued or course competition something like that but i a little new to this kind of codind that i'm a little bit lost.
here zip file of a minimized programme to isolate part that make me crazy
For the moment to make it run in a trash mode i put the 25ms wait out of case structure , it works but it means that every case take 25ms
and is not good job , because i have something like 20 cases in reality
Thank you for help
Best regards
Tinnitus
11-24-2009 10:01 AM
Sorry for not understanding you correctly,
From your question, your vi takes total 3 seconds to stop after you actually stopped it. Am I right?
Why dont you put the timer inside the cases which runs continuously? You need not place it outside the case structure.
Sorry I could not look into you code. Could you post it in 8.5?
PS- You can post your problem in french also. There are many who speaks french and can help you faster.
11-24-2009 10:17 AM
hello,
yes it depends of moment you ask to stop so it may take from 0 to 3s to stop
yes it couls be easier if you can see my code, what is the way to dowgrade vi with other vi and control attached ?
Yes it just a habit because there is often much more people connect at this time
Regards
Tinnitus
11-24-2009 10:26 AM
Just select File>>Save for Previous in your top level vi (Main vi). It takes care of rest of the hierarchy. Send your vis here.
But placing the timer inside specific cases wouldnt solve your peoblem?
11-24-2009 10:46 AM - edited 11-24-2009 10:50 AM
11-24-2009 11:32 AM
Well..
I was not able to get events you have registered with event structures. And also couldnot understand properly because of french texts.
Anyway, you are facing this problem due to the STTM Q MGR_new.vi in the consumer loop. You are queing more elements in each iteration. This causes your loop to hault untill this vi finishes execution although you have dequed exit case in the end.
So is it really necessary to have this vi outside the case structure? cant you use this vi to que elements in the producer loop? (loop above?)
. Or you can queue required elements inside the case structure of consumer loop.(Place this vi in whichever cases necessary)
As shown in the figure, move that vi either inside the case, or you can just que those when the user action takes place in the producer loop.
I hope i am clear in what i am trying to say. Your lower loop will never stop untill the STTM Q MGR_new.vi stops its execution, so it is necessary to meve as mentioned in the figures
11-24-2009 11:49 AM
Or another simple solution would be, put a case structure around the vi STTM Q MGR_new.vi, and donot execute this vi when output of the deque element is Exit.
11-24-2009 11:58 AM
hello, thans you for your suggestions i will have a look tomorrow
Best regards
Tinnitus
11-24-2009 12:04 PM
To add on,
1.Clean up your block diagram.
2. Donot use default tunnels in case structure borders. (right click, uncheck use default if unwired)
3. wires must flow left to right or top-bottom-top.
4. You can just destroy the queue when the producer loop ends, and use the error out of deque function to terminate the consumer loop.
11-24-2009 12:12 PM
tinnitus wrote:hello, thans you for your suggestions i will have a look tomorrow
Tomorrow???? no finish it today. Its 9pm here but still im trying to help you. Why cant you check it now? Never say tomorrow, what if tomorrow never comes?? huh.