LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to run a particular case continuously in event based state machine architecture.

moderator 1983

 

i tried that enqueue element at opposite end also but as dkfire explained may be because of that i am not able to execute any other event after that because it is not going back to event staructure.

 

dkfire and mike porter

 

i tried with producer/consumer also the template example that is provided in examples, but not able to run continuously,

 

as dkfire said

In the Producer you will have the event structure, that alway is ready to handle events.

The producer will be your current state mashine, without the event structure. 

 

can you elaborate more because i am not able to interpret what you are trying to explain.

0 Kudos
Message 11 of 17
(1,302 Views)

I tried the code with producer consumer also withour using event structure as dkfire said but still facing the same problem, may be i have not implemented it correctly but not able to run 2 or more cases simultaneously, any other suggestion or approach that i can use to implement the desired functionality.

 

Below i am attaching the vi in which i am using producer consumer.

0 Kudos
Message 12 of 17
(1,278 Views)

changing the mechanical action of the buttons to "switch when pressed" (or replacing the switch with a pushbutton, which better conveys the expected action) will probably help.

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 13 of 17
(1,270 Views)

Thnaks bilko fos the reply,

 

i tried that also but that is working only for one button that i am pressing first if i will press rise time first than it is updating continuously but other case structure in this case fall time is not executing, similarly if i press fall time first than it will uodate continously but again no output for rise time.

 

aand there is one bug in the program that producer consumer that i am not passing initialize state in the producer loop in rise and fall time case structure,

below i am attaching the program again after correcting the error.

0 Kudos
Message 14 of 17
(1,266 Views)

why don't you just have one button that executes a rise times and fall times until "unpressed?"  (i was under the impression that you wanted one to happen or the other; not both at once)

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 15 of 17
(1,262 Views)

i cannot have one button because it is not always compulsory that user will press both the buttons , it depends on user weather he want to see both simultaneously or one by one. i want to know as in all architecture weather it is producer/consumer, master/slave or state machine, we are using case structure to execute diferent cases so is there any method that we can run 2 or more case structure simultaneously or i need to change the coding style or need to apply some logic to run 2 or more cases simultaneously.

0 Kudos
Message 16 of 17
(1,257 Views)

Only one case of a case structure will execute each time the structure is called. 

 

If you want to measure Rise Time, Fall Time, Rise Time, Fall Time... you need to enqueue both cases. 

 

Lynn

0 Kudos
Message 17 of 17
(1,251 Views)