LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

do occurences accumulate?

i'm using occurrences in my application. ideally i don't want to lose any occurrences, so i set 'ignore previous' to be False. does that guarantee that no occurrence will be lost? does an occurrence have to be caught by 'wait on occurrence' before another one is set? if not, say if 10 occurrences are set before the first call to 'wait on occurrence', do i need to call 'wait on occurrence' 10 times and catch each individual occurrence one by one, or one call clears all 10 occurrences?
0 Kudos
Message 1 of 6
(3,187 Views)
Occurrences do not include a queue to store the last amount of occurrences that happened before the first �Wait on Occurrence� function. Disabling �ignore previous�, only means that �Wait on Occurrence� will execute if an occurrence happened prior to the function. However the �memory� is only one element deep.

If you want the type of functionality that can store multiple occurrences, you should look into using the Queue functions instead. You can define the size of the queue and even pass data through the queue. Look for shipping examples by searching for �queues�.


I hope this answered your question.

Best regards,
Philip C.
Applications Engineer
National Instruments
www.ni.com/ask
- Philip Courtois, Thinkbot Solutions

Thinkbot Solutions
0 Kudos
Message 2 of 6
(3,187 Views)

Hi!

I also have a question concerning the occurence-accumulation issue:

In my main application i start three different subvis, which i want to stop by an occurence. This technique works, but sometimes, after an error occured or i stop the subvis manually first and then the main, something strange happens: When i start the main the next time, one of the three subvis stops immediatley! When I highlight the execution of this subvi, i can see clearly, that the occurence takes effect! This behaviour is not really reproducable or deterministic. May this be a bug of Labview?

It looks like, there is a stack or a queue of occurences, which is not empty at the start of the main vi.

Can anybody help?

Greetings,

robertow

0 Kudos
Message 3 of 6
(2,961 Views)
Roberto,

i am not sure if this is intended behaviour. But i am sure that this behaviour should not occur if you unload the project completly before loading and executing it the next time.
This has to do with LV keeping many things in memory until all VIs are unloaded which have access to this memory.

And remember the famous words of Darren:
Stopping your VI with the Abort Button is like stopping your car with a tree..... it works, but it may have consequences...

hope this helps,
Norbert
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 4 of 6
(2,954 Views)
Hi Norbert!
 
Thanks for your help first!
 
I already figured out, that a reload of Labview resolves the problem, but I don't want to call that a solution 🙂 If it's a bug in Labview, I'm not able to do something against that. But, is there any way of clearing the memory (or something similiar) at the beginning of my program?
Currently I'm searching for an other problem in my project, and this occurence behavour is really slowing down my debugging sessions 😞
 
Greetings, robertow
0 Kudos
Message 5 of 6
(2,942 Views)
Roberto,

occurrences cannot be "stopped" or "canceled". So if you want to have such a feature, you should switch to notifier.

hope this helps,
Norbert
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 6 of 6
(2,938 Views)