Abstract:
This document describes and shows a basic example of using the ShowModal function.
Products:
CR Series HMI / G3 Series HMI / G3 Kadet HMI / Graphite® HMI / Modular Controller (excludes LE) / DA Series Data Station (excludes DA10) / Data Station Plus (excludes LE) / ProducTVity Station
Use Case:
The ShowModal function can be used in many ways, in this case as a confirmation.
Required Software:
Crimson 3.0 or Crimson 3.1
Procedure:
Data Tags
1. Referring to Figure 1, create a new Flag tag.
Figure 1.
Display Pages
1. Navigate to the Display Pages section.
2. Add Tag1 and two bevel buttons to Page1.
3. Referring to Figure 2, change the text on the two buttons to ON and OFF.
Figure 2.
4. Create a new display page.
5. Rename Page2 to Confirm.
6. Add a Text Box and two Bevel Buttons to the Confirm page.
7. Change the text to Are you sure?
8. Referring to Figure 3, change the text of the buttons to Yes and No.
Figure 3.
9. Open the YES button's properties and click on the Action tab.
10. Set the Operation to User Defined.
11. In the On Pressed field type EndModal(1), as shown in Figure 4, then click OK.
Figure 4.
12. Repeat steps 10 and 11 for the NO button, using EndModal(0) in the On Pressed Field.
13. Navigate back to Page1.
14. Open the ON button's properties and click on the Action tab.
15. Set the Operation to User Defined.
16. Change the On Pressed action to Complex Code, enter the following code, as shown in Figure 5, then click OK twice.
if(ShowModal(Confirm))
Tag1 = 1;
Figure 5.
17. Repeat steps 15 and 16 for the OFF button, using this code:
if(ShowModal(Confirm))
Tag1 = 0;
Usage
1. Download the database to the unit.
2. Press the ON button.
3. Observe that the Confirm page is shown as a popup.
4. Press the NO button.
5. Observe that Tag1 is still OFF.
6. Press the ON button.
7. Observe that the Confirm page is shown as a popup.
8. Press the YES button.
9. Observe that Tag1 is now ON.
Disclaimer
It is the customer's responsibility to review the advice provided herein and its applicability to the system. Red Lion makes no representation about specific knowledge of the customer's system or the specific performance of the system. Red Lion is not responsible for any damage to equipment or connected systems. The use of this document is at your own risk. Red Lion standard product warranty applies.
Red Lion Technical Support
If you have any questions or trouble contact Red Lion Technical Support by clicking here or calling 1-877-432-9908.
For more information: http://www.redlion.net/support/policies-statements/warranty-statement