From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Event is there and i got no response

Hi all, I have a question when I was writing my program. The structure is like this, there is a flat sequence, the first part is an event structure, and when i receive an exit from the first part, it will jump to the second part for some coding. Then it will be the last part where i have a while loop waiting for the user to press exit button.

Everything is working, but when i am in the last part which is in the while loop, and when i pressed some controls that had event in the first part of the sequence, it hangs. I just wondering if there is a way to help. i tried to search threads here and i got the 'ProducerConsumerEvents 2' example, but it just didn't work.

I have attached the modified 'ProducerConsumerEvents 2' here asking for help.

Thank you.

0 Kudos
Message 1 of 16
(4,274 Views)

Read Caveats and Recommendations when Using Events in LabVIEW - LabVIEW 2015 Help

 

A couple of your events are set to lock the front panel until that event is complete.

0 Kudos
Message 2 of 16
(4,267 Views)

Hi RavensFan, i know that it is locked, but i would like to know if it can be solved by only a small change. I read the thread you posted but I appreciate your help.

0 Kudos
Message 3 of 16
(4,250 Views)

Go int and editt those event cases that lock the front panel, and uncheck the box that locks it.  Just like you did in the other event cases.

0 Kudos
Message 4 of 16
(4,244 Views)
Hi yITSE
I am not able to view your code as I am replying via mobile but based on your explanation if you are using a sequence structure and loops inside sequence structure the event on the first part won't have any impact on the loop which is in last part.
As per as I understand it's better not to implement any time consuming logic inside a event structure and only event capturing needs to be handled inside event structure from there you can route your case to another state to do a time consuming logic.(which can be done easily using state machine architecture)
----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 5 of 16
(4,243 Views)

You need to change the architecture. you cannot leave an event structure behind with no way for it to react to events. Just use a state machine, no sequence needed, ever! You need to get away from the linear thinking!

 

(As a quick and dirty bandaid fix, you could disable all the controls that no longer have any use once the first equence frame has completed. This way they can no longer trigger the event structure. This is not a satisfactory long-term solution, you should fix the desing problem at this stage, it will be much harder later.)

0 Kudos
Message 6 of 16
(4,241 Views)

I am not sure what do you mean by unchecking the box, is there any example? Thank you.

0 Kudos
Message 7 of 16
(4,237 Views)

Hi PalanivelIT

It did actually affect even the event structure is not in the last sequence, i had tried. I think i have to look for the state machine architecture, thanks for the reply.

0 Kudos
Message 8 of 16
(4,234 Views)

Hi altenbach,

I am not quite familiar with the state machine achitecture but definately i will look into it.

i had the same thinking as you just dis-visible the control but it is not going to be a long term solution.

Thanks for the reply

0 Kudos
Message 9 of 16
(4,231 Views)
I can tell you the place where to uncheck the box but the thing is you may need to 're construct your code as suggested by others. Which will help the code 're usuable and maintainable

Back to your question.. in the event structure you can select any event state and right click and select edit event handled by this event . There you will find a check box for lock front panal activity (hope this is what raven is referring)
----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 10 of 16
(4,230 Views)