Actor Framework POLARIS Migration from CS to AFbased
Actor Framework @ POLARIS Migration from CS to AF-based applications Alexander Kessler Helmholtz Institute Jena, Germany Institute of Optics and Quantum Electronics, FSU Jena, Germany CS – Workshop 2016
POLARIS Improvements AF @ POLARIS Alexander Kessler CS – Workshop 2016
Structure of my talk Ø Problems with CS 3. 3 @ LV 2014 Ø Design goals and decisions Ø Why not CS++ ? ! Ø Expirience with AF Ø Comminication via POLARIS LNA Ø UI Actors Ø Conclusion AF @ POLARIS Alexander Kessler CS – Workshop 2016
Problems @RUNTIME - Crashs of CS if DNS. exe died or unreachable - Starts of CS fails -> Split in smaller CS – applications - Dim. Indicator library shows very strange behavior - DIM Services sometimes don’t work - At CS start: delay is needed between DIM service subscription AF @ POLARIS Alexander Kessler CS – Workshop 2016
Problems @Development and Debug - Crashs of LV 2014 - Running CS blocks dev. environment - DIM Services sometimes don’t work - Web. DID very slow and instable - Always internal LV errors AF @ POLARIS Alexander Kessler CS – Workshop 2016
Problems Low Acceptance by POLARIS crew • Complicate installation (DMS, Access, DIM) • Difficult to operate • To much overhead for POLARIS • Main motivation for usage of CS was DIM AF @ POLARIS Alexander Kessler CS – Workshop 2016
DIM Indicator Problems AF @ POLARIS Alexander Kessler CS – Workshop 2016
DIM indicators problem AF @ POLARIS Alexander Kessler CS – Workshop 2016
Design goals Ø KISS as posible! Ø One drag and drop EXE + config. ini Ø Stabile against network errors Ø Conifigurations in INI Files Ø Event driven communication via LV Network Streams AF @ POLARIS Alexander Kessler CS – Workshop 2016
Why not CS++? Ø Stress… Quick LV 2014 solution was needed or roll back to LV 2009 Ø First make own expirience with AF based application design! Ø Frequent switches to newest LV Version not possible Ø Nevertheless: intergration in CS++ should be easy due to AF approach AF @ POLARIS Alexander Kessler CS – Workshop 2016
My AF expirience • Even for LVOOP Developer – - • • AF @ POLARIS new kind of programming! => a lot of pitfalls Debug is complicated Messaging is not type safe, actor crashes if one sends wrong message Usage of AF Project Provider highly recommended! As well as usage of zero coupling messages! Alexander Kessler CS – Workshop 2016
My AF expirience DEBUG • Actors run asynchrony • Typically without UI • “invisible” connected via message classes • Blocks depending library if running • If shutdown wasn’t successful -> restart of LV is needed AF @ POLARIS Alexander Kessler CS – Workshop 2016
My AF expirience Communication via DIM ü But: AF enforce clean SW design! ü Well defined shutdown behaviour! ü OOP even for communication! Communication via AF & LNA AF @ POLARIS Alexander Kessler CS – Workshop 2016
Config with Open. G Read/Write INI Cluster. vi • Reads and writes a cluster from/to a INI Section • Default: Typedef name = section name • But You can customize section name via „Set Data Name. vi“ • Very convenient programming • Very easy for user [Pass 9] X Motor = „P 9 X Actuator“ Y Motor = „P 9 Y Actuator“ Filter. Wheel = „P 9 Filter“ Camera = „A 5 -P 9 Cam“ AF @ POLARIS Alexander Kessler CS – Workshop 2016
1: N Communication via Network Streams • Network stream 1: 1 one • • • way communication Easy to use (? ) Event driven Lossless AF standard lib: LNA (linked network actor) Transport of message objects via network! AF @ POLARIS Alexander Kessler CS – Workshop 2016
POLARIS LNA Connection Server App P 2 P Actor_1 LNA Server POLARIS LNA_1 Listener … … POLARIS LNA_1 POLARIS LNA_N P 2 P Actor_N POLARIS LNA_1 AF @ POLARIS Alexander Kessler CS – Workshop 2016
Server App LNA Server Service LNA 1…N CLIENT SERVER POLARIS LNA Communication Client P 2 P Actor POLARIS LNA Listener C. request (Client URL) Connect Disconnect Connect Data MSG CMD MSG AF @ POLARIS Data MSG CMD MSG Alexander Kessler Data MSG CMD MSG CS – Workshop 2016
POLARIS LNA Actor • • • AF LNA doesn’t destroy Stream Endpoints in case of error! Reconnect is not sure! => Extention is needed But via child class is difficult… Copy and adapt -> POLARIS LNA Actor AF @ POLARIS Alexander Kessler CS – Workshop 2016
P 2 P Actor • Envelopes LNA control code • Ancestor for network Actors • Starts POLARIS LNA as nested actor AF @ POLARIS • • Active or passive connect Creates unique LNA Name Manages LNA errors Tries to reconnect Alexander Kessler CS – Workshop 2016
Zero Coupling Messages • Caller write concrete implementation to LNA • LNA calls “Send Update Status. vi” if connection Abstract Msg status changes Implements „Send“ • Via dynamic dispatch “Do. vi” of child class is called • “Do” calls a action VI of Msg for Callercaller actor Impements „Do“ AF @ POLARIS Alexander Kessler CS – Workshop 2016
Zero Coupling Messages AF @ POLARIS Alexander Kessler CS – Workshop 2016
UI Actors: Viewable Actor (Win 8 Framework) • UI Actors inherits from Viewable Actor or P 2 P Actor • P 2 P Actor launches Viewable Actor as nested actor UI Actor Core Application AF @ POLARIS Alexander Kessler CS – Workshop 2016
UI Design AF @ POLARIS Alexander Kessler CS – Workshop 2016
UI Design AF @ POLARIS Alexander Kessler CS – Workshop 2016
UI Design AF @ POLARIS Alexander Kessler CS – Workshop 2016
CS -> AF cooking recipe • Define a Actor for Your CS Class • Proc Case. vi cases -> Actions for Actor • Proc State. vi -> Using of State Actor Pattern ? • My experience with hierarchy of two Actors: Step Motor and Step Motor Controller -> huge amount of forward Msgs • -> classical LV state machine AF @ POLARIS Alexander Kessler CS – Workshop 2016
Conclusion Ø Complete redesign Ø And pay some learning fee (never change a running system…) Ø Result: clean LVOOP based application design Ø Classes are highly reusable AF @ POLARIS Ø OOP based communication even via network Ø 1: N network streams communication library developed @ POLARIS Ø Flexible UI are simple to create Ø The beginning is hard, but if bases Actors run, its funny! Alexander Kessler CS – Workshop 2016
- Slides: 27