How to Work with Global Events
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. It does not enable operator/device interaction (it is executed without operator interference) so, you cannot add screens and/or controls to it, only processes that do NOT call for controls. Ex: Processes from the Display Controls group cannot be added to a global event, except the "Message Box" process (with an associated time out).
Global events that have been created within an MCL-Designer project are reusable in other MCL-Designer projects. The global event is exported into the Library (an MCL-Designer folder that stores exportable elements such as data files, programs, global events, screens, etc.) and, when required, is imported (from Library) into another project or projects.
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 Suspend Process
Global Event Usage
When using global events within a project, consider the following:
•The application can ONLY run 1 global event at a time (tasks are queued, if multiple global event timers are triggered).
Ex: If "global event A" is still running when the timer of "global event B" ends, "global event B" will only execute after "global event A" is completed, regardless of its defined timer.
•A global event will only start if the MCL-Client is not busy with another active task (such as the import of a data file into a local database), regardless of its timer.
•When a global event starts, its timer will only reset once the event is completed.
•In an application that includes several global events, when a global event is running, the timers of the other global events will continue counting.
•It is not possible to pause (suspend) or reset the timer of a global event that already started. In other words, executing a "Global Event Suspend" or a "Global Event Reset" process, for instance, will not affect a global event whose own processes are already running when the pause or the reset is executed.
Right-Click Menus
The "Procedures" 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.
•Right-click an empty area to access these general options:
Add Global Procedure |
Use it to add a global procedure. See Global Procedures. |
|
Add Background Procedure |
Click it to add a background procedure. See Adding a Background Procedure. |
|
Add Global Event |
Adds a global event. See Adding a Global Event. |
|
Library Import |
Click "Library Import" to open the "Library Manager" window so you can import the intended element into your current project. If you intend to import a global event, see To Import a Global Event. |
•Right-clicking "Global Events" (the name of the section that displays the existing global events) provides the following related options:
Adds a global event. See Adding a Global Event. |
|
Use the "Library Import" option to open the "Library Manager" window so you can import the intended global event into your current project. |
•If you right-click an existing global event, you access the following options:
Edit |
Click this option to edit the selected global event's properties. See Editing a Global Event.
If the selected element is a locked global event (imported from Library and identified with a ), most options of the corresponding properties window will be inactive/unavailable. (Ex: The "Event" tab cannot be accessed.)
|
|
Duplicate Global Event |
Use this option to duplicate the selected global event. See Duplicating a Global Event. If the selected global event is a locked global event (not editable and identified with a ), this option is NOT applicable. |
|
Delete |
This option deletes the selected global event. |
|
Event |
Use this option to gain direct access to the selected global event's "Event" tab. This option is inactive if the selected global event is a locked global event (marked with a ). |
|
Library |
Use this option to export the selected global event. See To Export a Global Event.
If the selected global event is a locked global event (identified with a ), this option is NOT applicable. Locked elements CANNOT be exported. |
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:
Topics
This chapter covers the following topics:
Topic |
---|