Upload
chris-roebuck
View
476
Download
1
Embed Size (px)
DESCRIPTION
NI Days 2013 User Events Tips Tricks & Sundry Presentation By Chris Roebuck
Citation preview
NI Days 2013
User Events: tips, tricks and sundry
Chris Roebuck
Hello & Welcome
• Chris Roebuck (aka croebuck)
As a courtesy to others…….
Leave your smartphone switched ON
Please Tweet your friendsPlease Update your LinkedIn statusPlease Post on your Facebook wall
Make your friends jealous you’re here learning cool new stuff and they’re not !!!
Lets give some credit….• “User events, tips, tricks and sundry “
– Presented by Jack Dunaway at the 2013 European CLA Summit held in Paris
• “Everything You wanted to know about events (but were afraid to ask)”– Presented by Norm Kirchner at NI Week 2013
Show of hands…….
I don’t need no stinkin’ events !
History Lesson
Before 6i the only real option was to “poll” the control values
Remember doing this ?
History Lesson 6.1
LabVIEW 6.1 quietly introduced the Event Structure and gaveus some limited access to static VI Server events
History Lesson 7 Express
Brought us “dynamic” event registration
History Lesson 8.0History Lesson 8.2
Brought us .net events & event callbacks
and now 2013
…and now we’ve got some new primitives and features likePriority events and the ability to flush the event queue
Syntax – Static Events (VI Server)
Statically bind an event “handler” structure to a VI Server event at edit time using the event configuration dialog
Syntax – Dynamic Events (VI Server)
Dynamically bind an event “handler” structure to a VI Server event at run time
Syntax – Dynamic / User / Custom Events“The Palette”
Publisher
Subscriber
Semantics
Demo’s & Myth Busting
Myth #1: Events are slow
Myth #2 : Events Can’t Handle Big Data
Myth #3 : Events Are Dangerous
Events For Messaging
Message 1
Message 2
Message 3
MSG Producer
MSG Consume
r
Publisher SubscriberSubscriber Producer Consumer
Events For Messaging
How do we do that ?
…..but what about objects?
Private & Public Events API
And fire it !!!
Obtain a reference to
the event
Summary
• Scalable (Actor Oriented Design ?)• Loosely Coupled (Reusable) Components • Testability• Easy to create an API (Private & Public Events)
Take Home Point
User Events are a lightweight, easy-to-use native feature with some really cool functionality.
SSBV use them a a primary way of performing intra-process communications.
They just got a whole lot better in LabVIEW 2013 so if you’ve dismissed them, take another look