Skip to content

Commit 7699bb5

Browse files
committed
Updated documentation and the VIPM Package definition to reflect the PP work. VIPM Package built
* The Readme.md quick start section was updated to reflect the implementation of the Project Provider to create the Async Methods Actor. The quick start is now way more friendly with screenshots. * The VIPM Package definition was updated to installe the Project Porvider Message Creator * The v1.1.0 of the VIPM package was built and tested
1 parent 83448e2 commit 7699bb5

17 files changed

+84
-29
lines changed

Async Methods Actor.vipb

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
<VI_Package_Builder_Settings Version="2020.1" Created_Date="2023-10-03 17:40:35" Modified_Date="2025-10-23 23:39:52" Creator="AndreaVaccaro(LSInst" Comments="" ID="84346f8c58b072600f4fd06a051a1f38">
1+
<VI_Package_Builder_Settings Version="2020.1" Created_Date="2023-10-03 17:40:35" Modified_Date="2025-11-08 17:34:38" Creator="AndreaVaccaro(LSInst" Comments="" ID="d965dae473f5dd294194fb589d4d8f34">
22
<Library_General_Settings>
33
<Package_File_Name>LS_Instruments_AG_lib_Async_Methods_Actor</Package_File_Name>
4-
<Library_Version>1.0.0.6</Library_Version>
4+
<Library_Version>1.1.0.3</Library_Version>
55
<Auto_Increment_Version>false</Auto_Increment_Version>
66
<Library_Source_Folder>2020</Library_Source_Folder>
77
<Library_Output_Folder>vipm packages</Library_Output_Folder>
@@ -34,11 +34,7 @@
3434
<Copyright/>
3535
<Packager>Andrea Vaccaro</Packager>
3636
<URL>https://github.com/LS-Instruments/Async-Methods-Actor</URL>
37-
<Release_Notes>- Removed unused Async Message property write methods
38-
- Added a "Async Message Settings" to be used by the LS AF Message Maker to create send methods for the concrete Async Messages
39-
- Removed dependency on OpenG error and variant libraries
40-
- Minimum LabVIEW version requirement moves from 2023 to 2020
41-
- All the Async Message within the example were regenerated by means of the LSI AF Message Maker. The calling example code was updated accordingly</Release_Notes>
37+
<Release_Notes>- Added a Project Provider used to to allow the user to create a new Async Method Actor from within his LabVIEW project</Release_Notes>
4238
</Description>
4339
<Destinations>
4440
<Toolkit_VIs>
@@ -119,6 +115,18 @@
119115
<Additional_Destination>false</Additional_Destination>
120116
<Additional_Destination_Index>0</Additional_Destination_Index>
121117
</Destination_Overrides>
118+
<Destination_Overrides>
119+
<Path>Providers/AddAsyncMethodsActor</Path>
120+
<Destination>10</Destination>
121+
<Additional_Destination>false</Additional_Destination>
122+
<Additional_Destination_Index>0</Additional_Destination_Index>
123+
</Destination_Overrides>
124+
<Destination_Overrides>
125+
<Path>Providers/GProviders</Path>
126+
<Destination>10</Destination>
127+
<Additional_Destination>false</Additional_Destination>
128+
<Additional_Destination_Index>0</Additional_Destination_Index>
129+
</Destination_Overrides>
122130
<Password_Overrides>
123131
<Path>.</Path>
124132
<Password/>
@@ -129,6 +137,9 @@
129137
<Namespace_Type>Prefix</Namespace_Type>
130138
<Namespace/>
131139
</Namespace_Overrides>
140+
<Exclusions>
141+
<Path>Providers/Install Support</Path>
142+
</Exclusions>
132143
<Place_Folder_Contents>
133144
<Path/>
134145
</Place_Folder_Contents>
@@ -186,7 +197,7 @@
186197
</Install_Requirements>
187198
<LabVIEW>
188199
<close_labview_before_install>false</close_labview_before_install>
189-
<restart_labview_after_install>false</restart_labview_after_install>
200+
<restart_labview_after_install>true</restart_labview_after_install>
190201
<skip_mass_compile_after_install>false</skip_mass_compile_after_install>
191202
<install_into_global_environment>false</install_into_global_environment>
192203
</LabVIEW>
@@ -316,7 +327,7 @@
316327
<Path>2020\Examples</Path>
317328
<VI_Title/>
318329
</Items_Data>
319-
<GUID>4B6A7839E6D906867986155FAC8BBAB3</GUID>
330+
<GUID>E71946B425E8BA6EA4F449812AEC376D</GUID>
320331
</Functions_Palette_Data>
321332
<Functions_Palette_Data>
322333
<Parent_Palette_Index>0</Parent_Palette_Index>
@@ -351,7 +362,7 @@
351362
<Path>2020\Async Methods Actor\Async Methods Actor Palette\Open Example.vi</Path>
352363
<VI_Title/>
353364
</Items_Data>
354-
<GUID>8F17E1C49021DC999D7B2692D6641740</GUID>
365+
<GUID>A5F6ADE4C1B52A535506C950A9D9FE71</GUID>
355366
</Functions_Palette_Data>
356367
<Controls_Palette_Data>
357368
<Parent_Palette_Index>-1</Parent_Palette_Index>
@@ -470,7 +481,7 @@
470481
<Path>2020\Async Methods Actor\Async Methods Actor\Async Call Method.ctl</Path>
471482
<VI_Title/>
472483
</Items_Data>
473-
<GUID>9B21284D5FD77C6ACC7A54CFF98FC797</GUID>
484+
<GUID>22343B99B9F8A68457BB31698007B43A</GUID>
474485
</Controls_Palette_Data>
475486
</Library_Palette_Definition>
476487
</VI_Package_Builder_Settings>
-204 Bytes
Binary file not shown.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:ca3fa40d9374fc2c601194f49711104e13e574987437ff43ff1f6c2d8673e5a7
3+
size 504392

README.md

Lines changed: 56 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,65 @@
44

55
A library that extends the Actor Framework to allow for async method execution.
66

7-
The "**Async Methods Actor**" is an actor-based library that implements an infrastructure for launching async methods. By making actors inherit from the "Async Methods Actor", it is possible to launch any method without waiting for its conclusion, by sending messages child of the abstract message "**Async Message.lvclass**". This framework is especially useful for tasks that take a long time to execute which implemented as Actor methods would lock the actor until completion. The official way to implement those tasks in the Actor Framework is to code them as helper loops within the "Actor Core.vi". This however brings along the overhead of setting up a communication mechanism between Actor methods and the helper loop, thus voiding the advantage of OOP encapsulation. By means of this framework, you continue to benefit from OOP encapsulation of the Actor Framework also for long execution tasks without having to implement ad-hoc data transfer methods between methods and helper loops.
7+
The **Async Methods Actor** is an actor-based library that implements an infrastructure for launching async methods. By making actors inherit from the **Async Methods Actor**, it is possible to launch any method without waiting for its conclusion, by sending messages child of the abstract message "**Async Message.lvclass**". This framework is especially useful for tasks that take a long time to execute which implemented as Actor methods would lock the actor until completion. The official way to implement those tasks in the Actor Framework is to code them as helper loops within the "Actor Core.vi". This however brings along the overhead of setting up a communication mechanism between Actor methods and the helper loop, thus voiding the advantage of OOP encapsulation. By means of this framework, you continue to benefit from OOP encapsulation of the Actor Framework also for long execution tasks without needing to implement boilerplate code.
88

9-
## Steps required to use this library with the LSI Actor Framework Message Maker (Recommended)
9+
## Steps required to use this library
1010

11-
1. Install the VIPM Package by means of the VI Package Manager. The VIPM package can be found <a href="https://www.vipm.io/package/ls_instruments_ag_lib_async_methods_actor/" target="_blank">here</a>
11+
1. Install the **Async Methods Actor** VIPM Package by means of the VI Package Manager. The VIPM package can be found <a href="https://www.vipm.io/package/ls_instruments_ag_lib_async_methods_actor/" target="_blank">here</a>
1212
2. Install the **LSI Actor Framework Message Maker** by means of the VI Package Manager. You can find details about the package <a href="https://www.vipm.io/package/ls_instruments_ag_lib_lsi_actor_framework_message_maker/" target="_blank">here</a>
13-
2. Create an actor, make it inherit from the "**Async Methods Actor.lvclass**" class and add some methods. You can now use your actor as you would normally do with normal LabVIEW actors
14-
2. Choose a method of the actor that you want to execute asynchronously
15-
3. Open **LSI Actor Framework Message Maker** from the "Tools" menu and create a message for the method you have chosen
16-
5. Send this message through the **send VI** of your message as you would normally do within the AF
1713

18-
If you want to get more control over the asynchronous call you can wire a suitably configured copy of the "**Async Message Settings**" cluster to the message Send VI as shown in the following picture.
14+
### Create Async Methods Actors
15+
Right-click on a target within a LabVIEW project, in most cases it will be "My Computer" and click on the "Async Methods Actor" sub-menu:
16+
17+
![in target creation before](media/quick-start/in-target-creation-before.png)
18+
19+
The **Async Methods Actor** Creator window will appear:
20+
21+
![in target creation](media/quick-start/in-target-creation.png)
22+
23+
Therein you will be able to choose the **Async Methods Actor** name, from which **Async Methods Actor** to inherit from, and where to store the **Async Methods Actor** on disk. Then click "OK". A new library will be created containing the **Async Methods Actor** within your project under the chosen target:
24+
25+
![in target creation after](media/quick-start/in-target-creation-after.png)
26+
27+
If you want to add an **Async Methods Actor** to the newly created library and inherit from the just created actor, right click on the library and launch again the **Async Methods Actor** creator:
28+
29+
![in library creation before](media/quick-start/in-library-creation-before.png)
30+
31+
The **Async Methods Actor** creator window will appear. Here choose a new name and choose to inherit from the previously created Async Actor. Click "OK":
32+
33+
![in library creation](media/quick-start/in-library-creation.png)
34+
35+
The new **Async Methods Actor** will be created within the previous library, without creating a new one.
36+
37+
![in library creation after](media/quick-start/in-library-creation-after.png)
38+
39+
### Create Async Messages
40+
41+
In order to use the **Async Methods Actor** in your code you have to implement methods and the corresponding messages. As an example add two methods to the **Async Methods Actors** just created:
42+
43+
![new methods](media/quick-start/new-methods.png)
44+
45+
Launch the **LSI Actor Framework Message Maker**:
46+
47+
![launch LAFMM](media/quick-start/launch-LAFMM.png)
48+
49+
The Message Maker window will appear, select the two methods for which you want to create an **Async Message** (select the "Async Message" child of the Async Methods Actor's method to create an Async messages instead of a standard Actor messages) an then click the "Build/Update Selected Message(s)" button:
50+
51+
![update messages](media/quick-start/create-messages.png)
52+
53+
This will create the two messages. Exit the Message Maker window and you will see the new messages appearing in the project:
54+
55+
![create messages after](media/quick-start/create-messages-after.png)
56+
57+
If you change either the VI Icon, the VI Description, or the VI connector pane of the **Async Methods Actor** methods you can relaunch the **LSI Actor Framework Message Maker** and rebuild the messages to reflect the changes:
58+
59+
![update messages](media/quick-start/update-messages.png)
60+
61+
### Send the Async Messages to the Async Methods Actor
62+
63+
Send each Async message through the corresponding **Send** method as you would normally do within the AF.
64+
65+
If you want to get more control over the asynchronous call you can wire a suitably configured copy of the "**Async Message Settings**" cluster to the message's **Send** methods as shown in the following picture:
1966

2067
![LSI AF Message Maker Send VI](media/LSI%20AF%20Message%20Maker%20Send%20VI.png)
2168

@@ -27,15 +74,6 @@ Through the "**Async Message Settings**" cluster you can set:
2774
4. a "**Report Errors (T)**" Boolean. If TRUE the standard error output of the Async Method will be reported to the calling actor.
2875
5. a previously created concrete subclass of the "**Completion Notification Msg**" and a **Caller Enqueuer**. If both fields are set, upon completion of the "Call and Collect" Async Message method the Async Method Actor will send the aforementioned concrete "**Completion Notification Msg**" message to the caller which will enable the caller to obtain a copy of the **Async Message** and the current number of running "Call and Collect" messages of this kind. The copy of the message will allow the caller to access the GUID and FQN of the conclude Async Message by means of the corresponding Async Message properties
2976

30-
## Steps required to use this library with the LSI Actor Framework Message Maker (Not Recommended)
31-
1. Subclass the "**Async Methods Actor.lvclass**" class. You can now use your actor as you would normally do with normal LabVIEW actors
32-
2. Choose a method of the actor that you want to execute asynchronously
33-
3. Create a message corresponding to such method as you would normally within the AF
34-
4. Let this message inherit from "**Async Message.lvclass**"
35-
5. Send this message through the send VI of your message as you would normally do within the AF
36-
37-
If you want to get more control over the asynchronous call you can use the "**Send Async Message.vi**" method of the "**Async Message.lvclass**" class. To this method you wire the message object you have created (possibly configured to match the input of your actor method by means of suitable property nodes) and optionally an "**Async Call Method**" enum that can take values "Call and Collect" or "Call and forget" and an "**VI Refnum Lifetime**" enum that can take values "Destroy on Exit", "Destroy on Actor Exit", or "Leak". The message can be also configured by setting a previously created concrete subclass of the "**Completion Notification Msg**" and a **caller enqueuer** by means of the **Async Message** properties "**Completion Notification Msg**" and "Caller Enqueuer". If both properties are set, upon completion of the "Call and Collect" Async Message method the Async Method Actor will send the aforementioned concrete "Completion Notification Msg" message to the caller which will enable the caller to obtain a copy of the **Async Message** and the current number of running "Call and Collect" messages of this kind. The copy of the message will allow the caller to access the GUID and FQN of the conclude Async Message by means of the corresponding Async Message properties
38-
3977
## Example Code
4078
The library comes with an example that illustrates the full API. Within the source tree the examples can be found at the path `./Async Methods Actor Example`. When installing the VIPM package you will find the example at the path `(LabVIEW Root Path)/examples/LS Instruments AG/Async Methods Actor/Async Methods Actor Example`
4179

@@ -65,7 +103,7 @@ Wire a properly configured (see message documentation for discovering configurat
65103

66104
an "**Async Call Method**" enumeration. This can take values "Call and Collect" and "Call and Forget". In the former case the "Async Methods Actor" will track the execution of the methods by waiting for their completion, in the latter case instead the actor will not wait for their completion but will just count their launch.
67105

68-
a "**VI Refnum Lifetime**" enumeration. This can take values "Destroy on Exit", " Destroy on Actor Exit", and “Destroy on Application Exit”. This enumeration dictates the lifetime strategy adopted for the VI Refnum of the Async Method. In the first case the "Async Methods Actor" destroys the reference as soon as the Async Method Exits, in the second case the VI Refnums will be destroyed once the “Async Method Actor” exits, while in the last case, VI Refnums are never destroyed. “Destroy on Exit” is the default option when unwired. The motivation for this setting is related to the required lifetimes of the Refnums (e.g. notifier’s references) created within the Async Method. This lifetime is the same as the VI Refnum lifetime, hence if we want they outlive the execution of the Async Method we have to set it to either “Destroy on Actor Exit” or “Destroy on Application Exit”. This option applies only to Async Methods called with the “Call and Collect” option.
106+
a "**VI Refnum Lifetime**" enumeration. This can take values "Destroy on Exit", " Destroy on Actor Exit", and “Destroy on Application Exit”. This enumeration dictates the lifetime strategy adopted for the VI Refnum of the Async Method. In the first case the **Async Methods Actor** destroys the reference as soon as the Async Method exits. In the second case the VI Refnums will be destroyed once the “Async Method Actor” exits, while in the last case, VI Refnums are never destroyed. “Destroy on Exit” is the default option when unwired. The motivation for this setting is related to the required lifetimes of the Refnums (e.g. notifier’s references) created within the Async Method. This lifetime is the same as the VI Refnum lifetime, hence if we want they outlive the execution of the Async Method we have to set it to either “Destroy on Actor Exit” or “Destroy on Application Exit”. This option applies only to Async Methods called with the “Call and Collect” option.
69107

70108
a "**Report Errors (T)**" Boolean. If True the standard error output of the Async Method will be reported to the calling actor.
71109

35.1 KB
Loading
45 KB
Loading
23.5 KB
Loading
27.2 KB
Loading
29.8 KB
Loading
19.7 KB
Loading

0 commit comments

Comments
 (0)