You are on page 1of 44

Distributed Control Systems

Lecture 3
PVSS in Practice

P.C.Burkimsher
IT Division, Controls Group
CERN

P.C. Burkimsh er CERN Sch ool of Computin g 2001

1
Introduction

• Aim of this lecture:


– Introduce you to the SCADA system chosen by
the LHC experiments.
– Teach you enough concepts to enable you to
perform the tutorial practical exercises
successfully.
– Give you enough background so that you can
be confident to get started with PVSS yourself.

P.C. Burkims her CERN School of Computing 2001 2

2
Assumptions
• I’m assuming we want to learn how to use a
SCADA product
• I’m assuming you want some hands-on
experience
• Otherwise, re-read the notes from Lec. 2!
– SCADA is going to be used by ALL the LHC
experiment controls groups.
– It will be used across CERN in the other
divisions too (Accelerators, Site services).
– If you are in HEP Controls, you will meet
SCADA.
P.C. Burkims her CERN School of Computing 2001 3

3
Recap

• The SCADA tool


chosen for LHC
experiments is from
Austrian Company
ETM

• Name of the
product is PVSS II

P.C. Burkims her CERN School of Computing 2001 4

4
Basic Functionality
• We’ll cover:
– Human Machine Interface (HMI)
– Data Point (DP) structure definition
– Scripting (Programming)
– Archiving (Data values)
– Trending (Plots of values over time)
– Alarm Handling and Display
• [Access control]

• How does PVSS present this functionality?


P.C. Burkims her CERN School of Computing 2001 5

The key components of a SCADA system as outlined in the lecture of


W.Salter.

5
The PVSS Console
• PVSS runs on WNT,
W2000 and Linux.
• Even both!
• In the lab here we
have WNT set up for
the tutorial practicals.
• When you start under
WNT, you see the
“Console”.

P.C. Burkims her CERN School of Computing 2001 6

6
Functions of the Console

P.C. Burkims her CERN School of Computing 2001 7

Allows you to choose which PVSS project you wish to run


Lists the tasks/processes of your PVSS project. User definable.
Allows you to stop/start them
Altogether as a system
Individually
Allows you to specify parameters to the tasks
For example,
“Valarch” is a data archiving task. It takes -num n as parameter.
You are allowed to run several Valarch (or other) tasks simultaneously if
you wish. -num is used to differentiate them.
The Console allows you to
-Add new tasks into your system (New)
- Use “Settings” to set startup options, e.g. automatic
restart if a task fails.
The Console displays the running/stopped status of tasks
Allows you to view the ”Console Log”. Tick the box to see the
stdoutput/stderrr messages in a new window.

So, what happens when you press Start ?

7
PVSS S/W Architecture

UIM UIM UIM User Interface Layer

Ctrl API Processing Layer

DM EV Communication and
Memory Layer

D D D Driver Layer

P.C. Burkims her CERN School of Computing 2001 8

The Data Manager (DM) and the Event manager (EV or EM) start to
run.
Any other tasks you have declared in the console start too.
Your (empty) PrivateProject comes up with a user interface task running
the Graphical Editor called GEDI.
Two versions of GEDI, one on Linux, one on NT. The NT version is
known as Native GEDI (NG).

8
Graphics Editor GEDI/NG

• Used for creating control panels.

• Used for animating panels


– Making chosen areas on the screen “live”.
– Value displays that change when the value
changes
– Buttons you can push

P.C. Burkims her CERN School of Computing 2001 9

9
The Native GEDI (NG)

P.C. Burkims her CERN School of Computing 2001 10

This is the panel you will build during Practical 1.

10
Panel Animation
• Associated with any graphic element, we
can have scripts.
• Mouse click on a button -> Event -> Script
EventClick runs.
• Script is a little ‘C’ program (more or less).
• Extensions to C, but it is not C++.
• Remember, PVSS not Object Oriented (OO).
– It’s Device Oriented.
• Market, including PVSS, is evolving rapidly.
• Language is called “Ctrl” (say “Control”).
P.C. Burkims her CERN School of Computing 2001 11

Not quite C, but is an extended subset. Uses C syntax.

11
Panel Script Example
main()
{ // Set a data point element to a value
dpSetWait(“sys1:cryoTemperature.requested.
isOn:_original.._value”, 0);
}
Wizard to generate scripts.
Can edit the script yourself.
Sophisticated library of routines for more complex
processing.
But what is a DP really?
P.C. Burkims her CERN School of Computing 2001 12

12
Basic Functionality
• We’ll cover:
– Human Machine Interface (HMI)
– Data Point (DP) structure definition
– Scripting (Programming)
– Archiving (Data values)
– Trending (Plots of values over time)
– Alarm Handling and Display
• [Access control]

• How does PVSS present this functionality?


P.C. Burkims her CERN School of Computing 2001 13

The key components of a SCADA system as outlined in the lecture of


W.Salter.

13
Data Points (DPs)
• A DP is a data structure
– Define hierarchies
• Used to hold all info about
a device being controlled.
• PVSS is Device oriented
• No methods (yet). Not OO.
• Structure allows you to
define new instances very
easily. (“One more, just
like that previous one.”)

Data Point
P.C. Burkims her CERN School of Computing 2001 14

Not all SCADA products have this grouping facility.


With the control of odd valves and water pumps in industry you can
often manage without the grouping facility.
In High Energy Physics (HEP) we have
Groups of settings for an HT channel
Groups of channels on a board
Groups of boards in a power supply crate

Instantiate a new power supply with the same structure

14
Parameterization
• Must declare T ype first,
then make an Instance.
• Use the PARA module
(user interface
program).
• Start it from a button in
the Native GEDI (or by
declaring a new task in
the Console.)

PARA s creen
P.C. Burkims her CERN School of Computing 2001 15

DPTs are listed


Expand DPT to see all DPs declared of that type
Expand DP to see its structure (elements)
Expand Data Point Elements (DPEs) to see “configs”.
Most important config is the original config.

15
Original config
• Can see and change current value of the DPE
here.
– Useful for testing and debugging your system offline.

PARA original
config screen
here

• But I want to react when a DPE value changes...


P.C. Burkims her CERN School of Computing 2001 16

16
Basic Functionality
• We’ll cover:
– Human Machine Interface (HMI)
– Data Point (DP) structure definition
– Scripting (Programming)
– Archiving (Data values)
– Trending (Plots of values over time)
– Alarm Handling and Display
• [Access control]

• How does PVSS present this functionality?


P.C. Burkims her CERN School of Computing 2001 17

The key components of a SCADA system as outlined in the lecture of


W.Salter.

17
Scripts
• Do something when a DPE changes
• T wo cases:
– When “something” is on a panel, e.g. update
the displayed value, or change a colour.
• Very similar to the C-code script behind a button
press.
– When no panels are involved.

P.C. Burkims her CERN School of Computing 2001 18

18
Script on a Panel
• Connect a call-back routine to the DPE.
• Whenever DPE value changes, your routine gets
called to update the displayed value.
• In the practicals you will use a wizard to generate
such a script.
Routine
void main() {... DPE
status =
dpConnect("displayValue","sys1:cryoTemperature.ac
tual.value:_online.._value");
...}
void displayValue(string dpName,
float changedValue)
{ this.text = changedValue;} // Update display.
P.C. Burkims her CERN School of Computing 2001 19

19
Scripts without a Panel
• You can react on an external event (not an
operator event) i.e. when action script has
nothing to do with a Panel.
– e.g. Call a routine if value reaches a limit

• The CTRL manager task runs scripts in the


background. Scripts look the same.

P.C. Burkims her CERN School of Computing 2001 20

20
Reference Panels
• Practical 2 introduces Reference panels.
• A Ref erence Panel = a parameterized panel.
• All of the scripts behind the panel are
written with $parameters which are then
substituted with Actual parameters
• Substitution can occur
– At development time, when you paste the panel
into your picture or
– At run-time; e.g. Call a function to open a
window that displays a reference panel.
Provide the actual parameters at run-time.
P.C. Burkims her CERN School of Computing 2001 21

21
Basic Functionality
• We’ll cover:
– Human Machine Interface (HMI)
– Data Point (DP) structure definition
– Scripting (Programming)
– Archiving (Data values)
– Trending (Plots of values over time)
– Alarm Handling and Display
• [Access control]

• How does PVSS present this functionality?


P.C. Burkims her CERN School of Computing 2001 22

The key components of a SCADA system as outlined in the lecture of


W.Salter.

22
Apropos of nothing

• PVSS written by an Austrian company.


• Documentation was all in German. (Some
still is!)
• First translations contained some howlers.
• Concept of dead-band. Changes in a value
read f rom hardware are considered
insignif icant within the range of the dead-
band, e.g. 0.5%, and ignored.
• Documentation referred to dead-tapes.
P.C. Burkims her CERN School of Computing 2001 23

23
Basic Functionality
• We’ll cover:
– Human Machine Interface (HMI)
– Data Point (DP) structure definition
– Scripting (Programming)
– Archiving (Data values)
– Trending (Plots of values over time)
– Alarm Handling and Display
• [Access control]

• How does PVSS present this functionality?


P.C. Burkims her CERN School of Computing 2001 24

The key components of a SCADA system as outlined in the lecture of


W.Salter.

24
Archiving
• PVSS values can be archived (recorded to
disk) for later inspection.
• Add an Archive config to a DPE. Allows
you to specify
– What to record
– When to switch files (e.g. every 24 hours)
• Six pre-def ined Valarch tasks in a new
PVSS project; most common needs.
• Can be suppressed.

P.C. Burkims her CERN School of Computing 2001 25

25
Basic Functionality
• We’ll cover:
– Human Machine Interface (HMI)
– Data Point (DP) structure definition
– Scripting (Programming)
– Archiving (Data values)
– Trending (Plots of values over time)
– Alarm Handling and Display
• [Access control]

• How does PVSS present this functionality?


P.C. Burkims her CERN School of Computing 2001 26

The key components of a SCADA system as outlined in the lecture of


W.Salter.

26
Trending - I
• Most common reason values are archived.
• A trend is a Value / T ime plot of a DPEs
value.
• T rends can plot “recent” data that isn’t
recorded on disk. (Lost when you stop the
task.)
• PVSS supplies a trend widget, ready made.
– Multiple curves. Configurable.
– Hairline cursor.
• Value / value plots are also possible.
P.C. Burkims her CERN School of Computing 2001 27

27
Trending - II

P.C. Burkims her CERN School of Computing 2001 28

While updating the line in real-time you may only look.


If you freeze the update, several function buttons become active:
Pan:
Left-right on the X (time) axis with the scroll bar
Zoom:
Boundaries of X-axis (left and right)
Limits on Y (value) axis (top and bottom)

28
Basic Functionality
• We’ll cover:
– Human Machine Interface (HMI)
– Data Point (DP) structure definition
– Scripting (Programming)
– Archiving (Data values)
– Trending (Plots of values over time)
– Alarm Handling and Display
• [Access control]

• How does PVSS present this functionality?


P.C. Burkims her CERN School of Computing 2001 29

The key components of a SCADA system as outlined in the lecture of


W.Salter.

29
Alert Definitions
• PVSS name f or an alarm is an “Alert”.
• Alert definition is a “config” on a DPE.
• N.B. Alert is defined on the instance, not on
the type.
• Alert definition is in 2 parts:
– The conditions under which the alert should be
raised (made active). This is kept in the
“alert_hdl” config.
– Related information in “alert_class” config.
• Priority; Colour; Acknowledgement rules;
• Automatic script execution.
P.C. Burkims her CERN School of Computing 2001 30

To acknowledge an alert means to click on it. This signifies that the


operator has seen (and hopefully read the message and become aware
of) the alert condition.
Rules include: Should a “Went” alert be acknowledged separately from
the corresponding “Came” alert.

alert_hdl is needed on each DPE to define its alert.

alert_class is defined once and shared. For the kind of information that
is the same for many alerts.

30
Alert Display
• PVSS provided Alert Display panel.
• Originally a standard panel
– Now been optimised with C++ inserts.
• If you really wish to implement your own
panel, you can, but this is not
recommended for perf ormance reasons.

P.C. Burkims her CERN School of Computing 2001 31

31
PVSS Alert Display Panel

P.C. Burkims her CERN School of Computing 2001 32

Has columns showing:


Short sign of the alert; (Int’l standard.) ) include coloured background
Priority of the alert ) if specified.
Time of alert
DPE name concerned
Alert text
Came/Went direction
DPE value at time of alert
Acknowledge status
“…” for lots more info, e.g. Who acknowledged it

Before the Alert screen appears, there is always a Properties Sub-


screen pops up.

32
Properties Subscreen

P.C. Burkims her CERN School of Computing 2001 33

Sophisticated filtering of messages on


Time Range
Alert state
Sorting of Alerts
The default settings are usually quite acceptable!
Your personalised settings can be remembered in a “configuration” for
ease of recall.

33
Group Alerts
• Group alert is an additional alert raised at
same time as any alert in a group.
• Usef ul f or summarising situations.

P.C. Burkims her CERN School of Computing 2001 34

Allows you to define an additional alert in terms of the existence of one


or more other alerts, e.g. ‘Problem with HV” might be a high priority alert
based on one or more low priority HV channel alerts.
The low-priority detailed alerts may be filtered out on the main control
room screen, leaving only the “Problem with HV” displayed.
The low priority alerts would be viewed in full on the sub-detector
expert’s alert screen.

[Group alerts are not covered in the practicals. See the online
documentation for more information.]

There is no magic formula for dealing with alarm avalanches!

34
Basic Functionality
• We’ll cover:
– Human Machine Interface (HMI)
– Data Point (DP) structure definition
– Scripting (Programming)
– Archiving (Data values)
– Trending (Plots of values over time)
– Alarm Handling and Display
• [Access control]

P.C. Burkims her CERN School of Computing 2001 35

The key components of a SCADA system as outlined in the lecture of


W.Salter.

The practicals do not cover Access Control.


PVSS does allow you to define your own sophisticated levels of
Who can view which screens
Who can press which buttons
etc.

35
The Lab Practicals

• 40 machines in the lab; 80 students


• => work in pairs

• 6 practicals

• 3 hours scheduled.

P.C. Burkims her CERN School of Computing 2001 36

Ex. 1 is the longest.

36
Lab Practicals 1,2,3
• Practical 1: To def ine a simple PVSS
control panel and its associated data point
types and data points.
• Practical 2: To instantiate similar control
panels using a predefined reference panel.
• Practical 3: To demonstrate that a
commonly f ound, but nevertheless
complex, device (a CAEN power supply)
has already been implemented generically.
T o illustrate the ease of use of the JCOP
tools to create new complex instances.
P.C. Burkims her CERN School of Computing 2001 37

The control panel in Practical 1 is the one we looked at earlier.

Ex.2 is quick and easy. The GEDI refers to a generic panel as a


reference panel.

Ex. 3: The JCOP software is free to the LHC experiments.


What you will see is a graphical way of defining a power supply:
Declare a CAEN crate type
Populate it with CAEN Boards
Declare and name HT channels on your boards
Of course, you don’t HAVE to use the graphical interface to define
CAEN.
You can import definitions from an ASCII file.
If you have 100s of CAENs, this is what you would do.

37
Lab Practical 4
• Practical 4: To
build a scattered
system with 5 UI

CPUs. DM

UI PC 1 .. PC 4
• Only perform one EM

of Practical 4 or PC 0
UI

Practical 5.
• We use System Example of a sing le PVSS Scatte red
System, b uilt out of tw o or more pro jects,

Practicals 4 & 5 Project / Machi ne

Manage r
each proj ect o n its o wn mach ine bu t with a
total of one Event Ma nag er/Data Man ager
pair in the en ti re syste m.
in Practical 6.
P.C. Burkims her CERN School of Computing 2001 38

Wayne Salter described distributing the work of a single control system


across many processors. We call this a Scattered System
A PVSS System is an EV/DM pair + other tasks.
A scattered system is where the other tasks run on other machines.
For efficiency’s sake, it is best to keep the EV/DM pair on a single
machine.

The diagram above only shows 3 machines.

What we do not do: Connect to any real hardware!

38
Lab Practical 5
• Practical 5 is identical to Practical 4.

• Practical 5: To build a scattered system


with 5 CPUs.

• Only perform one of Practical 4 or Practical


5.

• We use Practicals 4 & 5 in Practical 6.

P.C. Burkims her CERN School of Computing 2001 39

39
Lab Practical 6
• Practical 6: To
join the two Distri buted System

System / Project / Machi ne


Scattered Manage r UI

Systems DM
produced by EM

Practicals 4 UI

and 5 into one DM


EM
Distributed
System.
Example of one distri buted PVSS
system (i.e. two PVSS simp le
systems). The re are two pro jects,
two machine s a nd two EM / DM
pairs.

P.C. Burkims her CERN School of Computing 2001 40

Apologies for the naming here!


ETM call one EV/DM pair a system.
They call multiple communicating systems, a distributed system.
A distributed system has several communicating pairs of EV/DM.

40
Final remarks
• How to access the online help:
– In NG, click “?”
– Also in German. Some useful phrases at the
end of the practical handout!

• IT -CO offer support for LHC experiments


working with the PVSS product:
– pvss.support@cern.ch
– http://itcowww.cern.ch/pvss2/index.htm

P.C. Burkims her CERN School of Computing 2001 41

41
Summary

• PVSS is a powerf ul SCADA tool


• Gives us an enormous head-start in
building our control systems.
• JCOP Framework is an HEP-specific layer
that helps us (you) even more.
• T he practicals will let you try out PVSS f irst
hand.

P.C. Burkims her CERN School of Computing 2001 42

The practicals show:

PVSS systems are SCALABLE.

Independent subsystems can be developed and then integrated.

UIs can join and leave the system.


Remote access over the net (but not the web, yet).

Subsystems can join and leave, while rest of system runs. (Partitioning,
AWG recommendations)

EM is a single point of failure in a system. Can have a redundant


system, but in the detectors at least, no-one has asked for one yet.

42
PVSS in Practice

• Any questions?

P.C. Burkims her CERN School of Computing 2001 43

43
P.C. Burkims her CERN School of Computing 2001 44

44

You might also like