This examples shows how to configure a custom button to display an alarm message in a message box.
Open the Basic Control Engine Program
Enter the following script in the CIMPLICITY Program Editor.
Sub Main()
MsgBox Command$
End Sub
Create the script as a program in the project's scripts directory.
Example
C:\Projects\ECimp\Scripts\GetMessage.exe.
Open a Button Caption dialog box for a Custom Button in either of the Alarm Viewers.
Enter the following.
Field |
Enter |
Button caption |
Message. |
Description |
Alarm message |
Command string |
...\<project path>\<project name>\Scripts\GetMessage.exe %Message Where <project path> is the full path to the project. <project name> is the project's name %Message is the Alarm Viewer Message parameter. |
Check Run program.
Click
.A
button is added to the Button bar.
Test the button in runtime.
Result: The message associated with the selected alarm displays in a message box.
A |
Select an alarm ID. |
B |
Click . |
C |
A Basic Script message box displays the message specified for the alarm in the Alarm Message field. |
Step 2.4. Create custom buttons. |