Novel techniques while developing on the WinCC OA Experience with the UCPC library.

27
Novel techniques while developing on the WinCC OA Experience with the UCPC library.

Transcript of Novel techniques while developing on the WinCC OA Experience with the UCPC library.

Page 1: Novel techniques while developing on the WinCC OA Experience with the UCPC library.

Novel techniques while developing on the WinCC OA

Experience with the UCPC library.

Page 2: Novel techniques while developing on the WinCC OA Experience with the UCPC library.

Outline

• What is UCPC• CPC6 ideas• CPC6 technics

Page 3: Novel techniques while developing on the WinCC OA Experience with the UCPC library.

UCPC Advanced Course: General Introduction3

UNICOS and UCPCUNICOS is a framework to create control applications UCPC: A basic package (Continuous Process Control) to develop integrated

process control applications.

UNICORE

UCPC package

PLCs CPC PLCs (non CPC)

Application packages(PIC, WIC,

CIS,…)

Application packages

(CIET, SURVEY, QPS, ..)

Control layer

UNICOS

Supervision layer

Industrial PC

HVAC

Process Control applications

LHC Collimator

s Interlocks

LHC Gas Control

LHC cryogenics

CERN, Sept/2012

Page 4: Novel techniques while developing on the WinCC OA Experience with the UCPC library.

What is CPC

Continuous Process Control is the set of devices implemented in the SCADA (WinCC OA, WinCC Flexible) and PLC (Siemens, Schneider, CoDeSyS)– IO objects (AnalogInput, DigitalOutput, …)– Interface objects (AnalogParameter, WordStatus,

…)– Field objects (Analog, OnOff, MassFlowController,

…)– Control Objects (PCO, PID, AnalogAlarm, …)

Page 5: Novel techniques while developing on the WinCC OA Experience with the UCPC library.

What is UCPC WinCC OA

It is a CPC device’s implementation in WinCC OA:– Reuse UNICOS/FW components– Follow UNICOS/FW convention

Page 6: Novel techniques while developing on the WinCC OA Experience with the UCPC library.

Axioms/aims

• Keep all scripts in the .ctl, not .pnl• Minimize device implementation code• Use spaces not tabs

Page 7: Novel techniques while developing on the WinCC OA Experience with the UCPC library.

Aims

• Keep all scripts in the .ctl, not .pnl– Minimize changeable code in panels– Using g_params mapping instead dedicated

variables:• Old: g_sPosStUnit, g_sPosStFormat, …• New: g_params mapping

• Minimize device implementation code• Use spaces not tabs

Page 8: Novel techniques while developing on the WinCC OA Experience with the UCPC library.

Aims

• Keep all scripts in the .ctl, not .pnl• Minimize device implementation code– Use generic UCPC functions in device

implementations, e.g. powerful UCPC core• Use spaces not tabs

Page 9: Novel techniques while developing on the WinCC OA Experience with the UCPC library.

Device ctrl scripts

CPC5 CPC6 CPC6 templated0

5000

10000

15000

20000

25000

30000

35000

40000

45000

deviceCPC core

Line

s of

cod

e

Page 10: Novel techniques while developing on the WinCC OA Experience with the UCPC library.

Development workflow

Package

PVSSBootstrapper

flex extractor

unPackageCreation

PVSS Project

TemplateDTI

Page 11: Novel techniques while developing on the WinCC OA Experience with the UCPC library.

Target: control script

UCPC is the set of device implementations.The device implementation:• Importation and exportation• Animation– Widget– Faceplate– Right click menu

• Access rights• Configuration, …

Device creation effort

ImportationAnimationOthers

Page 12: Novel techniques while developing on the WinCC OA Experience with the UCPC library.

PRACTICAL PART

Let’s talk about control code:Outline:– Importation– Animation

Page 13: Novel techniques while developing on the WinCC OA Experience with the UCPC library.

Importation: CPC5

• Constants that describe importation line• Generic check function• Front-End specific check functions• Generic set function• Front-End specific set functions

Page 14: Novel techniques while developing on the WinCC OA Experience with the UCPC library.

Importation: CPC6

• Constants that describe importation line– Few additional constants for shared fields

• Configuration function– For each DPE specify it properties

• Core does all the work– Based on simple atomic functions– Proxy to the UNICOS core when possible

Page 15: Novel techniques while developing on the WinCC OA Experience with the UCPC library.

Importation: CPC5 - set DPEunConfigGenericFunctions_setFloatIntBlock(dsConfigs,PVSS_MODBUS_FLOAT,makeDynString("PosSt", "OutOVSt", "AuPosRSt", "MPosRSt"),makeDynInt(UN_CONFIG_ANALOG_ADDRESS_POSST, UN_CONFIG_ANALOG_ADDRESS_OUTOVST, UN_CONFIG_ANALOG_ADDRESS_AUPOSRST, UN_CONFIG_ANALOG_ADDRESS_MPOSRST),makeDynString("MPosR", "PLiOn", "PLiOff"),makeDynInt(UN_CONFIG_ANALOG_ADDRESS_MPOSR, UN_CONFIG_ANALOG_ADDRESS_PLION, UN_CONFIG_ANALOG_ADDRESS_PLIOFF),makeDynInt(UN_CONFIG_ANALOG_UNIT, UN_CONFIG_ANALOG_FORMAT, UN_CONFIG_ANALOG_DEADBANDE, UN_CONFIG_ANALOG_DEADBANDE_TYPE),makeDynInt(UN_CONFIG_ANALOG_RANGEMIN, UN_CONFIG_ANALOG_RANGEMAX),makeDynString("PosSt", "OutOVSt"),makeDynInt(UN_CONFIG_ANALOG_ARCHIVE_ACTIVE, UN_CONFIG_ANALOG_ARCHIVE_TIME_FILTER),exceptionInfo);

Page 16: Novel techniques while developing on the WinCC OA Experience with the UCPC library.

Importation: CPC6 – set DPE

mappingClear(props);props["hasUnit"] = true;props["hasFormat"] = true;props["hasSmooth"] = true;props["hasArchive"] = true;props["hasPvRange"] = true;props["address"] = ".ProcessInput.PosSt";props["dataType"] = CPC_FLOAT;config["PosSt"] = props;

Page 17: Novel techniques while developing on the WinCC OA Experience with the UCPC library.

Device check/set algorithm

Setup DPEForeach DPE

setDeviceConfig(aDevice) addressunit

formatsmoothrange

descriptionarchive

alert5 range alert

Setup device

parametersmeta info

sms categoriessms messagemask event

Device specific setup (if define)

Page 18: Novel techniques while developing on the WinCC OA Experience with the UCPC library.

PRACTICAL PART II

Outline:– Importation– Animation

Page 19: Novel techniques while developing on the WinCC OA Experience with the UCPC library.

Animation: PVSS level

• dpConnect(function, dpe1, dpe2, …)• function(string dpe1_name, int dpe1_value,

string dpe2_name, bool dpe2_value,…)

• dpDisconnect(function, dpe1, dpe2, …)Problems:• DPE list should be consistent• Proxy function in case of floating amount of dpes

Page 20: Novel techniques while developing on the WinCC OA Experience with the UCPC library.

Animation: UNICOS level

Unicos requires a callback for system integrity.• Device needs to implement:– RegisterCB(string sDp, bool bSystemConnected) – Disconnection animation

Page 21: Novel techniques while developing on the WinCC OA Experience with the UCPC library.

Animation: alert handler

In case when device contains alert handler that could be modified by user• Device needs to implement:– PVSS animation routine on alert handler lock state

Page 22: Novel techniques while developing on the WinCC OA Experience with the UCPC library.

Animation: customizable device

In case when device could not have some dpe configured (for example, interlocks could be disabled)• Device needs to implement:– Set of connect/disconnect functions for each

possible combination of configured dpes– Set of animation functions (normally these

functions proxy to the generic one)

Page 23: Novel techniques while developing on the WinCC OA Experience with the UCPC library.

Animation: worst case

• Register callback– Connect alert_hdl– Disconnect alert_hdl

• Animate alert_hdl– Connect set1– Disconnect set1– Connect set2– Disconnect set2

• Animate set1 (proxy)• Animate set2• Animate disconnection

Page 24: Novel techniques while developing on the WinCC OA Experience with the UCPC library.

Refactored animation

What I care about in device implementation:• List of DPEs that needs for animation• Animation itself

Page 25: Novel techniques while developing on the WinCC OA Experience with the UCPC library.

Animation: CPC6

• Function to define DPE list for animation– Insure connect/disconnect operates with the same

dpes • Animation function– Does disconnection animation for free– Clear API for animation

• Static init function– Use one mapping variable (key-value)– Insure that no wrong access in the implementation

Page 26: Novel techniques while developing on the WinCC OA Experience with the UCPC library.

Animation: CPC5 – faceplate/PosStif(g_bSystemConnected) unGenericObject_DisplayValue(g_sPosStFormat, g_sPosStUnit, fPosSt, "StatusPosition", "unDisplayValue_Status", bPosStInvalid || (!bSystemIntegrityAlarmEnabled) || (iValAlarm > c_unSystemIntegrity_no_alarm_value));

Page 27: Novel techniques while developing on the WinCC OA Experience with the UCPC library.

Animation: CPC6 – faceplate/PosStcpcFaceplate_animateOnlineValue(dpes, values, "PosSt", g_params["PosStUnit"], g_params["PosStFormat"], "cpcColor_Faceplate_Status");

cpcFaceplate_animateAnalogValue(dpes, values, "PosSt", "PosSt", "cpcColor_Faceplate_Status");