• No results found

Managing Scenarios

In document Pacis (Page 52-55)

FROM.SCENARIOS 26

4. CONFIGURATION FILES AND WORKSPACES

5.4 Managing Scenarios

This section describes the scenario and scenario file properties, and how you can create, modify and delete scenario files and scenarios.

For the following topics it is assumed that you have a scenario window opened.

5.4.1 Scenario Files

Scenario files are used to group scenarios which belong together. For example you could create a scenario file for every type of brick with scenarios useful for the appropriate brick. It is up to you how you organize your scenarios, the Equipment Simulator does not impose any restrictions on how you organize them in scenario files.

Beside the name of the file, scenario files have additional properties which can be displayed by choosing Scenario File - Properties... from the scenario window control center. To display these properties you first have to select a scenario, which is stored in the desired file.

Below the folder, where the scenario file is stored, a note is displayed which gives you the information if it is a global or workspace specific scenario file.

Beside a description for the file, a list of named constants is part of the properties of a scenario file. Named constants are simple name-value pairs used to associate a constant integer, floating point or string value with a more readable name which can be used in the scenario code. For more details on how you can use named constants to make scenario code more readable see "Using Named Constants".

Using the Add..., Modify... and Remove buttons you can manage the list of named constants stored with the scenario file.

To manage scenario files you can:

Create new scenario files

Choose Scenario Files - New..., enter the name of the new file and decide if you want to create a global or workspace specific scenario file.

Rename existing scenario files

Choose Scenario Files - Rename..., select the scenario file you want to rename and enter the new scenario file name.

Delete existing scenario files

Choose Scenario Files - Delete... and select the scenario file you want to delete. If you delete a scenario file, all scenarios contained in the file are removed.

Change properties of scenario files

Select a scenario which is stored in the scenario file you want to modify and choose Scenario Files - Properties.... Modify the description of the scenario file or change the list of named constants.

Save all scenario files

Choose Scenario Files - Save All to save all modifications done to scenarios to disk.

Reload scenario files

Choose Scenario Files - Refresh All to reload all scenario files from the global and workspace specific scenario directories. Reloading of scenario files is useful if you manually copy scenario files from other users or computers to the global or workspace specific scenario directory and want to use those files immediately in the Equipment Simulator.

5.4.2 Scenarios

Beside the code a scenario consists of some additional properties can be managed for scenarios which are used during attachment of scenarios to the device structure and execution of scenarios during a simulation.

Scenario properties are displayed in the following dialog:

Scenario properties consist of the name of the scenario, the file where the scenario is stored, a short description of the scenario, settings for periodic execution of the scenario and a list of data objects and data leaves for which the scenario is designed. For the latter to be displayed you must select the Advanced >> button.

Using the settings for periodic execution of scenarios you can configure to start a scenario at a specific time or periodically by specifying an interval between starts. Periodic settings stored with scenarios are default values for the scenario which can be overridden when the scenario is attached to or started for a specific device object.

The following settings are used for periodic execution of scenarios:

Start time relative to

You can choose to either start the scenario at a specific time of day or relative to the start time of the simulation. For example if you choose to start the scenario at a specific time of day and enter 12:00:00 for the start time, the scenario is started at 12:00:00 midday no matter at which time the simulation has been started. If you choose to start the scenario relative to the simulation start and enter 01:00:00 for the start time, the scenario is started one hour after simulation start.

Start time

The start time is either a specific time of day or the period between simulation start and start of the scenario. The start time specifies the time the scenario is started the first time if executed periodically.

Number of starts

The number of starts are used for periodic execution and give the number of times the scenario will be executed. For a scenario which should be executed once at a specific time set the number of starts parameter to one.

Interval between starts

If a scenario is executed periodically, this setting controls the duration between two consecutive starts of the scenario.

The data objects and data leaves the scenario is designed for are used to automatically attach the scenario to multiple device objects. In the above example, where the scenario is designed for $ODLock$b1 data leaves, the Attach Scenario to Multiple Objects... function can be used to search the device structure for all $ODLock$b1 data leaves and automatically attach the scenario to those leaves. For a more detailed description on how to attach scenarios to device objects see "Attaching and Detaching Scenarios".

Use the Add... and Remove buttons in the above dialog to change the list of data objects and data leaves the scenario is designed for.

To manage scenarios you can:

Create new scenarios

Choose Scenario - New... to create a new scenario. In the following dialog enter the name of the scenario, choose the scenario file, where the scenario should be stored, and enter the desired properties for the scenario.

Rename existing scenarios

Choose Scenario - Rename..., select the scenario you want to rename and enter a new name for the scenario.

Delete existing scenarios

Select the scenario in the control center of the scenario window and choose Scenario - Delete....

Print scenarios

Select the scenario in the control center of the scenario window and choose Scenario - Print... or press <Ctrl>+P.

Check the syntax of scenarios

To check if the code of your scenario is syntactically correct, select the scenario in the control center and choose Scenario - Check Syntax or press F7. In the log section of the scenario window either syntax errors are displayed or a short message that no errors were found is given.

Change properties of scenarios

Select a scenario in the control center and choose Scenario - Properties....

In document Pacis (Page 52-55)