Description:
You can assign the functions of the toolbar buttons of WinCC Alarm Logging OCX to external buttons as follows:
Using the new Alarm Control as from WinCC V7:
If you do not want to operate WinCC Alarm Control in Runtime via the toolbar buttons, you have the option of using the "SetPropDouble" or "SetPropWord" C function to assign the functionality of a toolbar button to an external button. This function can also be implemented via a VB script. Details can be found in the WinCC Online Help in these paths:
Example:
Switch to the short-term archive using the "SetPropDouble" C function
| No. |
Procedure |
| 1 |
Note the object ID of the desired button (in the example, the button for calling the short-term archive). The object ID of the button is in the Configuration dialog in the "Toolbar" tab. The importance of the "ID" can also be found in the WinCC Online Help under the path "Working with WinCC > Setting up a Message System > Display of Messages during Runtime > Operation during Runtime > Operation of the Alarm Control in Runtime".

Fig. 01
|
| 2 |
In the desired picture, you create a button that is to be assigned the function of the toolbar button. |
| 3 |
Select the "Event" tab in the "Object Properties" of the button. |
| 4 |
Under "Mouse > Mouse Click > C action" configure the following action. |
| 5 |
Select the function in the following path: "Internal Functions > graphics > set > property > SetPropDouble".

Fig. 02
|
| 6 |
Parameterize this function with the relevant values as shown in the screenshot:
- lpszPictureName: name of the picture if, unlike the example, the button has been created in the same picture as the control.
- lpszObjectName: name of your control (in the example: "Control1").
- lpszPropertyName: name of the property that you want to change (in this case "ToolbarButtonClick" of the control).
- dValue: Object ID of the button (here you enter the object ID noted in Step 1, which has the value 4 in the example).

Fig. 03
|
Using the old Alarm Control as from WinCC V6 (designated as Alarm Control (Classic) in the Graphics Designer as from WinCC V7)
If you do not want to operate WinCC Alarm Control in Runtime via the toolbar buttons, you have the option of using the "SetPropDouble" function to assign the functionality of a toolbar button to an external button.
Example:
Switch to the short-term archive
| No. |
Procedure |
| 1 |
Note the object ID of the desired button (in the example, the button for calling the short-term archive). The object ID of the button is in the Help under "Button Command - Property".
  Fig. 04
|
| 2 |
In the desired picture, you create a button that is to be assigned the function of the toolbar button. |
| 3 |
Select the "Event" tab in the "Object Properties" of the button. |
| 4 |
Under "Mouse > Mouse Click > C action" configure the following action. |
| 5 |
Select the function in the following path: "Internal Functions > graphics > set > property > SetPropDouble".

Fig. 05
|
| 6 |
Parameterize this function with the relevant values as shown in the screenshot:
- lpszPictureName: name of the picture if, unlike the example, the button has been created in the same picture as the control.
- lpszObjectName: name of your control (in the example: "Control1").
- lpszPropertyName: name of the property that you want to change (in this case "ButtonCommand" of the control).
- dValue: Object ID of the button (here you enter the object ID noted in Step 1, which has the value 2 in the example).

Fig. 06
|
Classic procedure for up to and including WinCC V6
If you do not want to operate WinCC Alarm Control in Runtime via the toolbar buttons, you have a number of functions available in the Global Script Editor under "Standard functions > Alarm".
More information is available in the WinCC Online Help in this path:
Example:
Switch to the short-term archive
| No. |
Procedure |
| 1 |
Create a button in the desired picture. |
| 2 |
Select the "Event" tab in the "Object Properties" of the button. |
| 3 |
Under "Mouse > Mouse Click > C action" configure the following action. |
| 4 |
From "Standard functions > Alarm" select the "AXC_OnBtnArcShort" function with a double-click. |
| 5 |
Parameterization of the function selected above:
lpszPictureName: this specifies the name of the picture in which the Alarm Control is located. This is only necessary if the Alarm Control is located in a picture window, i.e. in a different picture to the one the button is in.
lpszObjectName: the name of the Alarm Control is selected from the menu here. The object name of the control is also in the Properties of the Alarm Control.

Fig. 07

Fig. 08

Fig. 09
|
| 6 |
Compile to complete parameterization of the function.

Fig. 10
Now, when you click this button, the short-term archive is displayed in the Alarm Control. |
|