Overview
A Global Event is a set of processes that includes a timer so you can define a repetition cycle for that set of processes. In other words, the global event is executed in a loop.
The repetition cycle does not consider the time the device spends in "sleep" mode.
A Global Event is associated to the project and not to a single program, meaning, it can start at the same time as the application or be called from any of the project's programs.
There are specific processes that deal with global events (to call for the global event, to reset its repetition cycle and/or to pause it). They are included in the "Other" group of processes. To access the processes related to global events, click on the "Process" tab. All the processes included in the "Other" group are displayed below, in the "Process Display Section".
For more information on each process, see:
Working with Global Event Start/Resume Process
Working with Global Event Reset Process
Working with Global Event Pause Process
The "Global Events" module displays the global events being used in your current project and provides options to manage them. To access these options, use the right click menu.
Within the "Global Events" module, right-click an empty area to access this option:
Use it to add a global event. See To Add a Global Event. |
|
Click this option to import a global event into your current project. See To Import a Global Event. |
If you right-click an existing global event, you access the following options:
Duplicate Global Event |
Use this option to duplicate the selected global event. See To Duplicate a Global Event. |
|
Add Global Event |
Click this option to add a global event. See To Add a Global Event. |
|
Delete |
This option deletes the selected global event. See To Delete a Global Event. |
|
Export Global Event |
Use this option to export a global event into the Library Manager. See To Export a Global Event. If the selected global event is a "locked" global event (identified with a |
|
Import Global Event |
Use this option to import a global event into your current project. See To Import a Global Event. |
|
Properties |
Click this option to edit the selected global event's properties. See To Edit a Global Event.
|
|
Search |
Use this option to search for the occurrences of the selected global event within the current project. See Detail of Search. |
Some of the right-click menu options are not applicable if the global event in question is a previously imported global event that is "locked" (an Export option - see To Export a Global Event to Library). A "locked" global event is not editable so, certain operations (related to a global event's duplication, export or settings/content edition) are NOT executable.
If you right-click a "locked" global event (identified with a ) and select options that relate to its edition, you get the following message:
The adding of a global event requires two major operations - the creation of the global event's structure and the adding of processes to that structure.
These processes will depend on the global event's purpose.
As an alternative, you can import a global event you have created in another project and exported into the "Library Manager". To do so, click "Import Global Event" in its right-click menu.
Create short Global Events so they do not take long to execute and run the risk of interfering with the application flow.
Step-by-step
1. Go to the "Global Events" module.
2. Right-click the module's empty area (or an existing global event) to open the corresponding menu and, then, click "Add Global Event".
3. In the resulting window, enter a name for the new global event.
4. Define the repetition cycle (in seconds). Enter a value or use the arrows.
5. If required, check the "Auto Start" option. This means that the global event starts at the same time as the application.
6. If required, enter any necessary notes concerning the new global event.
7. Click to conclude the creation of a global event's structure. The new global event is displayed in the "Global Events" module.
8. In the resulting "process" window, add the required processes. Use the drag-and-drop mechanism, the window's editing bar (the button) OR the selected row's right-click menu ("Add/Insert..." option).
See Adding Processes to Routines, "Routine In", Local Procedures or Global Events.
9. Click to apply OR
to abort the operation.
Step-by-step
1. In the "Global Events" module, right-click the global event you want to duplicate.
2. Click "Duplicate Global Event".
The selected event is duplicated. It is displayed in the "Global Events" module, with the same name as the original plus an incremental number. You can rename it (see To Edit a Global Event below).
This option is NOT applicable to a "locked" global event.
During project development, you can edit the properties of a global event (A) but also add, edit or delete the processes included in it (B).
A. To Edit the Global Event's Properties
Step-by-step
1. In the "Global Events" module, use one of the following to open the global event's process window:
a. In the "Global Events" module, double-click the global event you want to edit.
OR
b.Right-click the global event you want to edit.
2. In the resulting menu, click "Properties".
3. Enter the necessary changes:
Timer Info |
|
Name |
Maintain or edit the global event's name. |
Period(s) |
Maintain or define another time period (in seconds) for the global event's repetition cycle. |
Auto Start |
Check/uncheck this option to activate/deactivate the global event's automatic start (the global event starts at the same time as the application). |
Notes |
Maintain or edit the information you entered concerning the global event. |
4. Click to apply.
B. To Edit the Global Event's Set of Processes
Step-by-step
1. In the "Global Events" module, double-click the global event you want to edit.
2. Use the Editing Bar OR the Right-Click Menu to add, delete, copy, comment, etc. the processes of the selected global event. See Editing Processes.
You can also use the Drag-and-Drop mechanism to add processes from the "Process" tab.
3. If you are done, continue to step 6.
If you want to edit the properties of an existing process, proceed to step 4.
4. To open the intended process's properties window, double-click the process you want to edit OR right-click it and select the "Edit..." option in the resulting menu.
5. In the corresponding properties window, make the necessary changes and, then,click to apply and return to the process window.
6. Once you are done editing, click to apply your changes in the global event's process window.
Step-by step
1. Open the "Global Events" module.
2. Right-click the global event you want to export.
3. In the resulting menu, select "Export Global Event" to open the corresponding "Export to Library" window.
If required, select a different source library or rename it by clicking . See To define a Library.
4. Fill in the following options:
Global Event Information |
|
Global Event Name |
Maintain or enter a new name. |
Text Box |
If required, add notes regarding the global event being exported. |
Export Options |
|
MCL-Designer Source Code |
Check this option if you want the settings/content of the global event being exported to be available for editing once it is imported into another MCL-Designer V4 project. |
MCL-Script (executable) |
Check this option if you want to lock the settings/content of the global event being exported. This means that when the global event is imported into another project, it will not be editable. This affects its display in the destination project - only the name will be visible, the original components (routines, screens, local procedures) will not be available in the tree view and the corresponding properties window will not be editable. |
Add Global Event Resources(x) |
If the global event contains resources, check this option to ensure they are included in the export. These resources can refer to image files, sound files, text files, etc. |
It is possible to append project resources to the global event's export, even though they are not included in the global event.
a. To view all project resources, click .
b. Check the project resources you want to include in the export. (If you have checked the "Add Global Event Resources" option, the corresponding resources will be selected when you expand the project's resource list.)
c. If you want, click to hide the resource list.
5. Click to conclude the export.
The exported global event is available in the Library ("Global Events" section) and ready to be imported into another project.
As an alternative, you can use a drag-and-drop to initiate an export:
a. Open Library Manager (shortcut key - F4).
b. Drag the global event you want to export and drop it on the Library Manager's window. This opens the corresponding "Export to Library" window.
c. Proceed as described in steps 4 and 5 ("To Export a Global Event to Library").
Example of Export Errors
•If the Library already contains a global event with the same name, the following message box appears:
a. Click to overwrite.
OR
b. Click to return to the " Export to Library" window, change the global event's name in the corresponding box and click
to conclude.
•If you intend to export a previously imported global event that is locked, the following message box appears:
a. Click to cancel the action and close the window. It is NOT possible to export a locked element that was included into the project through a previous import.
Global Events that have been created within other MCL-Designer projects are reusable. You can import previously exported global events from the "Library Manager" into your current project.
Step-by-step
1. Use one of the following to access the "Library Manager" window:
A. Go to the "Menu Bar", click "Tools" and, in the resulting menu, select "Library Manager".
B. Click <F4>.
C. Right click the empty space in the "Global Events" module and select "Import Global Event" from the drop-down list.
D. Right-click a previously created global event and select "Import Global Event"
2. Once the "Library Manager" window is open, select the "Global Events" element to display the available global events for import.
If you accessed the "Library Manager" window with option C or D, this is unnecessary. The "Global Events" group is already selected.
3. Use one of the following to access the "Import into Project" window and continue the import operation:
A. Double-click the desired global event.
B. Drag and drop it into the "Global Events" module area.
C. Select the intended global event and click .
D. Right-click the selected global event and click the "Import to Project" option.
The corresponding "Import into Project" window opens.
This window displays information that cannot be edited (regarding the global event being imported) and information you can edit (the "Destination" section).
If the destination project contains a global event with the same name as the global event being imported, the name of the imported global event will automatically change to "..._X" ("X "refers to an incremental number).
If the global event being imported is "locked" (Export option that turned the selected element into a non-editable element - see To Export a Global Event), you will not be able to edit its name. The option "Global Event Name" will be inactive (displayed in gray).
You can either opt to change the name of the global event that already exists in the destination project (if it is not locked) and keep both global events OR proceed with the import, in which case, the newly imported global event will overwrite the one that already exists in the destination project.
4. View, maintain or enter new information, as required by the project.
Import Global Event |
Displays the global event's name. NOT editable. |
Displays the global event's author and when it was added to the library. It can also include notes entered during the export into Library operation. NOT editable. |
|
Destination |
|
Global Event Name |
Option only available if the element being imported was NOT previously "locked" during export. Maintain the suggestion or enter a new name for the imported global event. Make sure the target project does not have a global event with the same name or the imported global event will overwrite the one that already exists in the destination project. |
Import Global Event Resources (x) |
If the global event contains resources, check this option to ensure they are included in the import. Their destination is the target project's "Resources" module. |
It is possible to append project resources (appended during an element's export into the "Library" - see To Export a Program to Library) to the global event's import, even though they are not included in the global event.
a. To view all project resources, click .
b. Check the project resources you want to include in the import.
c. If you want, click to hide the resource list.
5. Click to conclude the global event import.
The newly imported global event is displayed in the "Global Events" module and available to the current project.
When the import includes language files (containing the imported element's localization tags), check the enabled languages of the destination project. If the imported language files relate to a language that is NOT enabled in the destination project, you have to define it as a project language in the project's Localization (a project properties tab). See Localization.
Ex: The import of a global event that includes a language file in "Dutch" into a project that only has "French" as an enabled language, will require that you add "Dutch" to the list of project enabled languages (in the Localization tab). If you skip this step, the imported "Dutch" language file will NOT be available for use.
Example of an Import Error
•If the name of the global event to import already exists in the current project, the following message box opens:
a. Click and replace the existing global event for the newly imported one.
OR
b. Click to return to the " Import into Project" window, change the global event's name in the corresponding box and click
to conclude.
Step-by-step
1. In the "Global Events" module, right-click the global event you want to delete.
2. Select “Delete” in the resulting menu.
3. Confirm the deletion by clicking .