LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Event Structures?

Solved!
Go to solution
Solution
Accepted by topic author Aalenox


Even your own version works if you switch properly to user events and register and unregister properly.

 

Stop dissing LV because you don't grasp it.  We can't teach anyone who won't listen.

 

Shane.

0 Kudos
Message 11 of 18
(913 Views)

Woah. Sorry to seem to have come across as dissing LabVIEW and/or being hostile. I was frustrated because I'd been working on this problem for some time, and that came through - but I do appreciate the help. The "sorta" was because I had already looked at using a single event structure, and it wasn't really an option.

 

Intaris: that was exactly what I needed. Thank you 🙂

0 Kudos
Message 12 of 18
(905 Views)

Having said all that, the main criticism levelled by others still apply.  I simply showed you how your earlier statement that User Events didn't solve trhe problem is technically incorrect.  The way you used them didn't solve the problem but whoever gave you the advice that it COULD was correct.

 

I would still go with a single Event structure and refactor the code but we all  write bad code when we started.

 

If you get time, try to implement a better solution and if you post it I'll give you kudos for the learning experience, OK?

 

Shane.

0 Kudos
Message 13 of 18
(897 Views)

@Aalenox wrote:

Woah. Sorry to seem to have come across as dissing LabVIEW and/or being hostile. I was frustrated because I'd been working on this problem for some time, and that came through - but I do appreciate the help. The "sorta" was because I had already looked at using a single event structure, and it wasn't really an option.

 

Intaris: that was exactly what I needed. Thank you 🙂


Then you are doing something wrong. It is a common architecture that I have used in applications orders of magnatudes more complex than what you are doing. It isn't working for you because you are doing something wrong. At the moment I can't open your VI since I do not have LV2012 installed at work. But trust what others have been telling you. The folks offering their advice are some of the top LabVIEW programmers and know what they are talking about.

 



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 14 of 18
(888 Views)

This thread, (and perhaps some others in the past), have me wondering if there should be another king of event structure, or perhaps an option to the existing event structure.

 

We've all seen some instances of code, including this one, where the programmer built an architecture thinking that the event structure was only capturing events when the structure was in the current line of execution.  Should there be an event type that only waits on events once the line of execution has reached the event structure?  Think of it like a notifier setup where the Wait on Notification is placed where the "Ignore Previous" is set to True.  Basically have an event structure where it is set that previous events are not captured or just ignored.  It would probably be a bit easier to setup than using dynamic events and enabling and disabling those events.

 

Just throwing it out there for a bit of discussion.  If there seems to be a little bit of positive feedback, then I'll write something up for the Idea Exchange.

0 Kudos
Message 15 of 18
(880 Views)

@OriolesFan wrote:

This thread, (and perhaps some others in the past), have me wondering if there should be another king of event structure, or perhaps an option to the existing event structure.

 

We've all seen some instances of code, including this one, where the programmer built an architecture thinking that the event structure was only capturing events when the structure was in the current line of execution.  Should there be an event type that only waits on events once the line of execution has reached the event structure?  Think of it like a notifier setup where the Wait on Notification is placed where the "Ignore Previous" is set to True.  Basically have an event structure where it is set that previous events are not captured or just ignored.  It would probably be a bit easier to setup than using dynamic events and enabling and disabling those events.

 

Just throwing it out there for a bit of discussion.  If there seems to be a little bit of positive feedback, then I'll write something up for the Idea Exchange.


I would avoid this type of structure simply because there are already better alternatives to use such as queues and notifiers. Creating this type of single shot event structure in my opinion would lead to some really ugly code and poor designs. Centralizing event processing makes one think about the overall design of the application and forces some architecture on the application. One off event structures could very easily lead to event processing scattered through the application making it very difficult to debug and maintain. Just when exactly is that single shot event structure active?

 



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
Message 16 of 18
(874 Views)

Well then pop over and vote for THIS or THIS.  Or both.

 

Shane.

0 Kudos
Message 17 of 18
(872 Views)

I think Mark said everything that needs to be said.

 

Lynn

0 Kudos
Message 18 of 18
(858 Views)