You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: www/en/modules/ROOT/pages/event-sources.adoc
+39-6Lines changed: 39 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -3,9 +3,13 @@
3
3
4
4
== User Interface
5
5
6
-
The first source of events, you come across when starting with {lv} are the events generated by the UI when a user of your application use the mouse or the keybard.
6
+
The first source of events you come across when starting with {lv} are the events generated by the UI when a user of your application use the mouse or the keybard.
7
7
8
-
Example code: 01a - Event Sources - User Interface.vi
8
+
The {es} is the way to detect the event and execute the appropriate caode.
9
+
10
+
NOTE: Before the introduction of the {es} (a long time ago), LabVIEW developpers had to periodically poll the controls to detect interactions with the {ui} 😓.
11
+
12
+
Example code: *01a - Event Sources - User Interface.vi*
Behind this name, you'll find the way to create and generate events programmatically.
23
26
24
27
NOTE: This source of events is the corner stones of many event driven architectures. The https://www.dqmh.org[DQMH framework] is probably one of the most popular framework based on the {lv} user event feature.
25
28
26
-
Example code: 01b - Event Sources - Custom Events.vi
29
+
Example code: *01b - Event Sources - Custom Events.vi*
27
30
28
31
.Front Panel
29
32
image::05-event-sources-user-event-fp.png[]
30
33
31
34
.Diagram
32
35
image::06-event-sources-user-event-dg.png[]
33
36
34
-
== Callback
37
+
== Event Callback
38
+
39
+
This source of event doesn't involve the use of an {ev}.
40
+
Once registred to an event the Callback VI is executed each time the event occurs.
41
+
42
+
NOTE: This kind of event breaks the usal data flow we are used to
43
+
44
+
// List examples of situation where event callback can be useful
45
+
46
+
Example code: *01c - Event Sources - Event Callback.vi*
47
+
48
+
.Front Panel
49
+
image::07-event-sources-callback-fp.png[]
50
+
51
+
.Diagram
52
+
image::08-event-sources-callback-dg.png[]
53
+
54
+
.Callback VI diagram
55
+
image::09-event-sources-callback-vi.png[]
35
56
36
57
== Daqmx
37
58
38
-
IMPORTANT: This example requieres the NI Daqmx driver to be executed.
59
+
This source of event is problably the less known.
60
+
With it, you can handle acquistion event in the {es}.
61
+
It makes straigtforward the use of the other sources of events in the loop that handle the acquistion.
62
+
63
+
IMPORTANT: This example requieres the NI Daqmx driver to be executed.
64
+
65
+
Example code: *01d - Event Sources - Daqmx Event.vi*
0 commit comments