270 likes | 477 Views
Novel techniques while developing on the WinCC OA. Experience with the UCPC library. Outline. What is UCPC CPC6 ideas CPC6 technics. UNICOS and UCPC. HVAC. LHC cryogenics. LHC Gas Control. LHC Collimators Interlocks. Supervision layer. UCPC package. Application packages
E N D
Novel techniques while developing on the WinCC OA Experience with the UCPC library.
Outline • What is UCPC • CPC6 ideas • CPC6 technics
UNICOS and UCPC HVAC LHC cryogenics LHC Gas Control LHC Collimators Interlocks Supervision layer UCPC package Application packages (CIET, SURVEY, QPS, ..) Application packages (PIC, WIC, CIS,…) Process Control applications UNICOS UNICORE Control layer PLCs (non CPC) PLCs CPC Industrial PC UNICOS is a framework to create control applications UCPC: A basic package (Continuous Process Control) to develop integrated process control applications. UCPC Advanced Course: General Introduction
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, …)
What is UCPC WinCC OA It is a CPC device’s implementation in WinCC OA: • Reuse UNICOS/FW components • Follow UNICOS/FW convention
Axioms/aims • Keep all scripts in the .ctl, not .pnl • Minimize device implementation code • Use spaces not tabs
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
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
Development workflow Template DTI unPackageCreation Package PVSSBootstrapper flex extractor PVSS Project
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, …
PRACTICAL PART Let’s talk about control code: Outline: • Importation • Animation
Importation: CPC5 • Constants that describe importation line • Generic check function • Front-End specific check functions • Generic set function • Front-End specific set functions
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
Importation: CPC5 - set DPE unConfigGenericFunctions_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);
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;
Device check/set algorithm setDeviceConfig(aDevice) address unit format smooth range description archive alert 5 range alert Foreach DPE Setup DPE parameters meta info sms categories sms message mask event Setup device Device specific setup (if define)
PRACTICAL PART II Outline: • Importation • Animation
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
Animation: UNICOS level Unicos requires a callback for system integrity. • Device needs to implement: • RegisterCB(string sDp, boolbSystemConnected) • Disconnection animation
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
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)
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
Refactored animation What I care about in device implementation: • List of DPEs that needs for animation • Animation itself
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
Animation: CPC5 – faceplate/PosSt if(g_bSystemConnected) unGenericObject_DisplayValue(g_sPosStFormat, g_sPosStUnit, fPosSt, "StatusPosition", "unDisplayValue_Status", bPosStInvalid|| (!bSystemIntegrityAlarmEnabled) || (iValAlarm > c_unSystemIntegrity_no_alarm_value));
Animation: CPC6 – faceplate/PosSt cpcFaceplate_animateOnlineValue(dpes, values, "PosSt", g_params["PosStUnit"],g_params["PosStFormat"], "cpcColor_Faceplate_Status"); cpcFaceplate_animateAnalogValue(dpes, values, "PosSt", "PosSt", "cpcColor_Faceplate_Status");