Edit the Events Reactions Scripts and Set Their Execution Credentials
- Select Applications > Logics > Scripts > … > Events Reactions.
- The Script Editor tab displays.
- In the Editor expander, depending on the required scenario, set the script in one of the following ways:
NOTE: You can only link macros. For each set of macros you can link multiple macros separated by commas (,). - Enter var scenario = 1, and drag the relevant macros to setofMacros_A and setofMacros_C.
Use case: When at least one event occurs for the system objects included in the scope, the instructions of setofMacros_A are executed, and the emergency light starts flashing. When one of the events is acknowledged, the instructions of setofMacros_C are executed, and the emergency light turns off. - Enter var scenario = 2, and drag the relevant macros to setofMacros_A, setofMacros_B, and setofMacros_C.
Use case: When at least one event occurs for the system objects included in the scope, the instructions of setofMacros_A are executed, and the emergency light starts flashing. When one of the events is acknowledged, the instructions of setofMacros_B are executed, and the emergency light becomes steady. When all the events are cleared from Event List, the instructions of setofMacros_C are executed, and the emergency light turns off. - Enter var scenario = 3, and drag the relevant macros to setofMacros_A, setofMacros_B, and setofMacros_C.
Use case: When at least one event occurs for the system objects included in the scope, the instructions of setofMacros_A are executed, and the emergency light starts flashing. When all the events are acknowledged, the instructions of setofMacros_B are executed, and the emergency light becomes steady. When all the events are cleared from Event List, the instructions of setofMacros_C are executed, and the emergency light turns off. - Click Save As
.
- In the Save Object As dialog box, select the main Scripts folder or any subfolder under it as the destination where you want to save the new script:
a. Enter a name and description.
b. Click OK. - The new script object is added to System Browser and is enabled by default.
- To enable the automatic execution of the script when the Desigo CC project starts up, and to specify with what user credentials the script should run, click Set Execution Credentials
.
- In the Script Editor dialog box, enter a user name and password of the user that will execute the script under credentials.
NOTE: You must choose a user with the appropriate privileges. - Click OK.
- If the credentials provided are valid and the user is enabled, the username will be set for the script execution.
- In the Operation tab, alongside Execution Mode:
a. Select Automatic.
b. Click Change. - The script will be executed automatically using the credentials that you specified.
If the execution credentials are cleared later from this script, or if that user is removed from the project, the Execution Mode of the script will be set back to Manual.
- Repeat steps 2 to 8 above for all the scripts you want to create and set for the execution.