Example. Create a Run a Message Program Custom Button

This examples shows how to configure a custom button to display an alarm message in a message box.

  1. Open the Basic Control Engine Program

  2. Enter the following script in the CIMPLICITY Program Editor.

Sub Main()

    MsgBox Command$

End Sub

  1. Create the script as a program in the project's scripts directory.

Example

C:\Projects\ECimp\Scripts\GetMessage.exe.

  1. Open a Button Caption dialog box for a Custom Button in either of the Alarm Viewers.

  2. 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.

  1. Check Run program.

  2. Click OK.

A Message button is added to the Button bar.

  1. 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 Message.

C

A Basic Script message box displays the message specified for the alarm in the Alarm Message field.

More information

Step 2.4. Create custom buttons.