Presentation is loading. Please wait.

Presentation is loading. Please wait.

(fw)SPY: a tool to add dpe “statistics” to your PVSS application* Giulio Morpurgo, CERN/EN/ICE * Based on requirements from Benjamin and Quique.

Similar presentations


Presentation on theme: "(fw)SPY: a tool to add dpe “statistics” to your PVSS application* Giulio Morpurgo, CERN/EN/ICE * Based on requirements from Benjamin and Quique."— Presentation transcript:

1 (fw)SPY: a tool to add dpe “statistics” to your PVSS application* Giulio Morpurgo, CERN/EN/ICE * Based on requirements from Benjamin and Quique

2 The problem

3 Within an existing application, perform statistics operations on selected data point elements == signals (typically they correspond to the values of sensors read from the field) Analogue sensors: integral over time, average Boolean sensors: number of transitions (in time interval), time spent at TRUE Special case: number of UNICOS “Operator requests” ( not discussed here to keep it shorter )

4 Two basic modes of operations “Sliding window” – Duration – Repetition rate “Forever” – Start/Stop on User request – Start/Stop on threshold crossing

5 Sliding windows Several sums carried on simultaneously Handling of start and stop of each window Archive every result

6 Forever Threshold trigger -Only one sum at a time -Acquisition started manually by User, or by threshold crossing -New points archived at regular frequency, or on User’s request

7 Additional requirements -Implement this monitoring without radically changing the application. - Typically the number of dpes to be monitored could be around one hundred. ( i.e. the approach I used is probably not scalable )

8 Implementation

9 A few concepts Primary dpe: the “application” dpe to be monitored. Spying device: an auxiliary datapoint, created by the SPY tool, containing all the infrastructure needed to spy a Primary dpe. There will be two types of Spying devices: the “Sliding Window” and the “Forever” SPY_SLW : a ctrl manager (~1100 lines) dedicated to the implementation of the spying activities.

10 Implementation sketch A datapoint (Sliding window or Forever) per spying device. These datapoints will contain also the dpes to be archived. These datapoints will be permanent, and will contain an “active” boolean dpe telling if they are currently used. A list containing the active connections Primary dpes -> Spying devices. SPY_SLW is dpConnected to all the Primary dpes in that list. When one of their values changes, SPY_SLW takes the appropriate actions. Through another thread, SPY_SLW is periodically woken up, to handle the starting and termination of the active Sliding Windows, and the periodical archival of active Forevers.

11 Identification part –.Common.dpe (string, the name of the Primary dpe to be spied) –.Common.UnicosRef (string, the name of the Unicos device to which the Primary dpe belongs)(optional) –.Common.type (string: “FLOAT” or “BOOL”) matches the type of the Primary dpe –.Common.complete (boolean) Are all the compulsory parameters initialized? Sliding window handling part –.Sliding.duration (int, length of the window in granularity units) –.Sliding.repetition (int, time interval between two windows in granularity units) –.Sliding.counter_to_new (int, time remaining before starting a new window) –.Sliding.active (Boolean, is the Sliding window currently acquiring?) –.Sliding.counters (dyn_int, one element per running window) –.Sliding.initialized (dyn_bool, one element per running window) –.Sliding.initial_time (dyn_time, one element per running window) Datapoint structure for Sliding windows (1/3) (general)

12 Part dealing with analogue signals –.Sliding.Float.partial_sums (dyn_float, one element per running window) –.Sliding.Float.sum (float, will contain the result of a completed sum; archived) –.Sliding.Float.average (float, will contain the result of a completed sum; archived) –.Sliding.Float.old (float, the last acquired value of the Primary dpe) –.Sliding.Float.offset (float, value to be removed from the newly arrived Primary dpe value before processing it) –.Sliding.Float.time_unit (int, normalizing coefficient for partial_sums) –.Sliding.Float.initial_old (dyn_float, one per running window) –.Sliding.Float.partial_deltas (dyn_float, for diagnostic) –.Sliding.Float.total_time (float, for diagnostic) Datapoint structure for Sliding windows (2/3) (float)

13 Part dealing with boolean signals –.Sliding.Bool.partial_times_up (dyn_float, one per running window) –.Sliding.Bool.partial_risings (dyn_int, one per running window) –.Sliding.Bool.partial_fallings (dyn_int, one per running window) –.Sliding.Bool.time_up (float, total time for which the Primary dpe was TRUE. archived) –.Sliding.Bool.time_up_fraction (float, time fraction for which the Primary dpe was TRUE. archived) –.Sliding.Bool.rising (int, number of False->True transitions. archived) –.Sliding.Bool.rising_per_hour (int, number of False->True transitions per hour. archived) –.Sliding.Bool.falling (int, number of True->False transitions. archived) –.Sliding.Bool.falling_per_hour (int, number of True->False transitions per hour. archived) –.Sliding.Bool.old (bool, the last acquired value of the Primary dpe) –.Sliding.Bool.initial_old (dyn_bool, one per running window) Part dealing with UNICOS Operator requests –.Sliding.OneBit.previous (saves the previous value of ManReg01) –.Sliding.OneBit.mask (integer used as a bit pattern, with 1 in the position to be monitored) –.Sliding.OneBit.trigger (bool, written when the bit to be monitored changes) Datapoint structure for Sliding windows (3/3) (boolean)

14 –.Common.dpe (string, the name of the Primary dpe to be spied) –.Common.UnicosRef (string, the name of the Unicos device to which the Primary dpe belongs)(optional) –.Common.type (string: “FLOAT” or “BOOL”) matches the type of the Primary dpe –.Common.complete (boolean) Are all the compulsory parameters initialized? –.Forever.starting_time (time, when the acquisition was started) –.Forever.archivage_frequency (int, time between two archivals in granularity units) –.Forever.counter_to_new _archived (int, time remaining before archiving a value) –.Forever.restart_trigger (boolean, write it to force a restart of the acquisition) –.Forever.active (boolean, is the Sliding window currently acquiring?) –.Forever.archive_trigger (boolean, write it to force a new archival) –.Forever.elapsed_time (float, internal usage) Datapoint structure for Forever (1/3) (general)

15 –.Forever.Float.partial_sum (float) –.Forever.Float.sum (float, is the result of a completed sum; archived) –.Forever.Float.average (float, is the result of a completed average; archived) –.Forever.Float.restart_value (float, value with which the partial_sum will be initialized) –.Forever.Float.offset (float, value to be removed from the newly arrived Primary dpe value before processing it) –.Forever.Float.old (float, the last acquired value of the Primary dpe) –.Forever.Float.time_unit (int, normalizing coefficient for partial_sums) –.Forever.Float.high_trigger_threshold (float) –.Forever.Float.low_trigger_threshold (float) –.Forever.Float.high_trigger_enabled (bool) –.Forever.Float.low_trigger_enabled (bool) Datapoint structure for Forever (2/3) (float)

16 –.Forever.Bool.partial_time_up (float) –.Forever.Bool.partial_risings(int) –.Forever.Bool.partial_falling (int) –.Forever.Bool.time_up (float, total time for which the Primary dpe was TRUE. archived) –.Forever.Bool.time_up_fraction (float, time fraction for which the Primary dpe was TRUE. archived) –.Forever.Bool.rising (int, number of False->True transitions. archived) –.Forever.Bool.rising_per_hour (int, number of False->True transitions per hour. archived) –.Forever.Bool.falling (int, number of True->False transitions. archived) –.Forever.Bool.falling_per_hour (int, number of True->False transitions per hour. archived) –.Forever.Bool.old (bool, the last acquired value of the Primary dpe) –.Forever.OneBit.previous (saves the previous value of ManReg01) –.Forever.OneBit.mask (integer used as a bit pattern, with 1 in the position to be monitored) –.Forever.OneBit.trigger (bool, written when the bit to be monitored changes) Datapoint structure for Forever (3/3) (boolean)

17 Demo Created ~100 dummy analogue signals, ~100 boolean signals (Primary dpes) Created corresponding Sliding_Windows and Forever spying devices Added -a ctrl manager to periodically modify the values of the Primary dpes, and -a ctrl manager to save the “archived” values into text files.


Download ppt "(fw)SPY: a tool to add dpe “statistics” to your PVSS application* Giulio Morpurgo, CERN/EN/ICE * Based on requirements from Benjamin and Quique."

Similar presentations


Ads by Google