[Example] Automatically Setting an Organization Mode as the Output of a Reaction
Scenario: You want to create a reaction that automatically sets the value of the Open and Close organization mode.
- System Manager is in Engineering mode.
- In System Browser, select Application View.
- Select Applications > Logics > Reactions.
- The Reaction Editor tab displays.
- Open the Triggers expander.
- Select AND from the drop-down list.
- Open the Values and States expander.
- In System Browser, select the Manual navigation check box.
- Select Management View.
- Select Project > Field Networks > […] > AnalogInput1.
- Drag AnalogOutput1 into the empty area of the Target column in the Values and States expander.
- A new row is created with the Target field set to
AnalogOuput1
.
- Click in the Property field and, from the drop-down list, select Present Value.
- In the Value Range field, select the relational operator = from the drop-down list and enter the value 5.0.
- The row now specifies a condition that is true if the Present Value of AnalogInput1 is equal to 5. This is the condition that will trigger the reaction that sets the organization mode.
- In the Output expander, open the Action expander.
- In System Browser, select Project > System Settings > Organization Modes.
- From the Organization Modes folder, drag Open and Close into the Scope/Target field of the Action expander.
- Click in the Command field and, from the drop-down lists select the command Set with the value Open.
- Open the Else Action expander.
- From the Organization Modes folder, drag Open and Close into the Scope/Target field of the Else Action expander.
- Click in the Command field and, from the drop-down lists select the command Set with the value Closed.
- Click Save As .
- In the Save Object As dialog box, select the main Reactions folder or any subfolder under it as the destination where you want to save this reaction:
a. In the Name field, enter Organization Mode Open and Close = Open when AnalogInput1=5.
b. Click OK.
- The new reaction is added to System Browser, and is enabled by default. The reaction will set the Open and Close organization mode to mode to Open when the Present Value of Analog Input 1 is equal to 5, and to Closed when the Present Value of Analog Input 1 is different from 5.