Skip to content
Menu
Menu

Knowledge Base

KB050008 | EVENT-DRIVEN PAGE SWITCHING

KB050008 | EVENT-DRIVEN PAGE SWITCHING

Product: Elvis
Version: all
Booth: 2001-11-19

Summary

Request: When the value of one or more data points is changed, a specific screen page should be displayed on the operator station.

Solution: Project event processing (Database/Project/Properties/Project/Events) responds to the value change (DatapointChanged) of the desired data points by opening an image. In the example below, the Alarm Status data point property is responded to. All alarm data points have this property. This procedure is elegant, as the page change always takes place when any alarm data point switches to the alarm state. The data point name or any other special data point property does not have to be mentioned in the calculation.
However, the page change can also be triggered by changing another data point property. Custom data point properties could also be used.

Note: The calculation is executed in the operator station and does not burden the Elvis server in distributed systems.

Download file ( 145 KB) with a sample project (db and iep).

Details

The sample project contains two data points (switch, value). Both data points are alarm data points. The limit values for the switch: on -> alarm; for the value: lower limit: 40, upper limit 75. The data points are visualized in the start page and the alarm page by control elements.
The project event processing is used to open the alarm page. The project event handler is opened by:
– select the database folder
– Open the project’s property page (double-click or right-click and select Properties)
– Select the Project page in the properties dialog
– click on the button “Events…” click.

In the now open editor, you can select various events to respond to:
– Load – the starting (loading) of the operator station
– Unload – the termination of the operator station
– DatapointChanged (or Form_DatapointChanged) – the change of one (every!) Data point value

We use Form_DatapointChanged and can use it to react to the change in the value of data points.
We only want to react when the data point property (prop = property) alarm state (=AlarmState) changes. In addition, the new alarm state should be “Alarm” (=”A”).
Note: The assignment of the alarm states to ASCII characters is arbitrary. The possible alarm states are:
“A” = alarm (ASCII numerical value: 65)
“N” = Non-alarm (ASCII numerical value: 78)
“Q” = acknowledged alarm (ASCII numerical value: 81)

This results in the following calculation:

//CODE:vb:Sub Form_DatapointChanged(ByVal DP As Object, ByVal prop As String)
	'DP = Datenpunkt
	'prop = property = Eigenschaft
	If prop = "AlarmState" Then
		'nur wenn sich die Eigenschaft Alarmstatus geändert hat kommt man hierher
		If DP.AlarmState = Asc("A") Then
			'nur wenn der Alarmstatus Alarm (=A) ist kommt man hierher
			'zum Testen kann man auch eine Message-Box öffnen:
			'MsgBox "Alarm!"
			'jetzt wird die Seite "alarmseite" geöffnet
			ProjectDoc.Open "\Dokumente\alarmseite" 'ab Version 1.3 "\Bedienstation\alarmseite"
		End If
	End If
End Sub//CODE

On the alarm page, please also note the values of the three states of the control element, which indicates the alarm status of the heater (65 = alarm, 78 = no alarm, 81 = acknowledged).

If you do not want to open a fixed alarm page, you can also store the desired page in a new property of the data point. To do this, we need to make three changes:

1. Add the new property: In the data point properties, the new persistent property Name = “AlarmPage”, Type = String (text does not matter).

2. Insert the jump target into the new property: The new data point property can be changed in the properties of the data point.

3. Jump to the respective page in case of alarm: Replace the line “ProjectDoc.Open …” by “ProjectDoc.Open” “\Operator Station\” & DP. Value(“AlarmPage”)”

Support Area

KB050008 | EVENT-DRIVEN PAGE SWITCHING

Knowledge Base

Here you will find answers, solutions to problems and examples of our products.
KB050008 | EVENT-DRIVEN PAGE SWITCHING

Case Studies

Successful in use: practical examples of our products and individual developments.
KB050008 | EVENT-DRIVEN PAGE SWITCHING

Support

Describe your concern using our support form.
KB050008 | EVENT-DRIVEN PAGE SWITCHING

License registration

Register your Elvis license!

IT GmbH · An der Kaufleite 12 · D-90562 Kalchreuth

© Copyright 2024. IT GmbH | Webdesign by Appear Online