<!doctype html><htmllang=enclass="js csstransforms3d"><head><metacharset=utf-8><metaname=viewportcontent="width=device-width,initial-scale=1"><metaname=generatorcontent="Hugo 0.80.0"><metaname=descriptioncontent="Strolch is a parameterized framework for use on servers and IoT"><metaname=authorcontent="Strolch"><linkrel=iconhref=/favicon.icotype=image/ico><title>Architecture - Strolch</title><linkhref=/css/nucleus.css?1626091328rel=stylesheet><linkhref=/css/fontawesome-all.min.css?1626091328rel=stylesheet><linkhref=/css/hybrid.css?1626091328rel=stylesheet><linkhref=/css/featherlight.min.css?1626091328rel=stylesheet><linkhref=/css/perfect-scrollbar.min.css?1626091328rel=stylesheet><linkhref=/css/auto-complete.css?1626091328rel=stylesheet><linkhref=/css/atom-one-dark-reasonable.css?1626091328rel=stylesheet><linkhref=/css/theme.css?1626091328rel=stylesheet><linkhref=/css/hugo-theme.css?1626091328rel=stylesheet><linkhref=/css/theme-green.css?1626091328rel=stylesheet><scriptsrc=/js/jquery-3.3.1.min.js?1626091328></script><style>:root#header+#content>#left>#rlblock_left{display:none!important}</style></head><bodydata-url=/plc/architecture/><navid=sidebar><divid=header-wrapper><divid=header><aid=logohref=/><imgsrc=/logo.png></a></div><divclass=searchbox><labelfor=search-by><iclass="fas fa-search"></i></label><inputdata-search-inputid=search-bytype=searchplaceholder=Search...>
<spandata-search-clear><iclass="fas fa-times"></i></span></div><scripttype=text/javascriptsrc=/js/lunr.min.js?1626091328></script><scripttype=text/javascriptsrc=/js/auto-complete.js?1626091328></script><scripttype=text/javascript>varbaseurl="https:\/\/strolch.li\/";</script><scripttype=text/javascriptsrc=/js/search.js?1626091328></script></div><sectionid=homelinks><ul><li><aclass=paddinghref=/><iclass="fas fa-home"></i>Home</a></li></ul></section><divclass=highlightable><ulclass=topics><lidata-nav-id=/api/title=APIclass=dd-item><ahref=/api/>API</a></li><lidata-nav-id=/history/title=Historyclass=dd-item><ahref=/history/>History</a></li><lidata-nav-id=/documentation/title=Documentationclass=dd-item><ahref=/documentation/>Documentation</a><ul><lidata-nav-id=/documentation/architecture/title=Architectureclass=dd-item><ahref=/documentation/architecture/>Architecture</a></li><lidata-nav-id=/documentation/model/title=Modelclass=dd-item><ahref=/documentation/model/>Model</a></li><lidata-nav-id=/documentation/do-and-donts/title="Do and Don't"class=dd-item><ahref=/documentation/do-and-donts/>Do and Don't</a></li><lidata-nav-id=/documentation/runtime-configuration/title="Runtime Configuration"class=dd-item><ahref=/documentation/runtime-configuration/>Runtime Configuration</a></li><lidata-nav-id=/documentation/realms/title=Realmsclass=dd-item><ahref=/documentation/realms/>Realms</a></li><lidata-nav-id=/documentation/components/title=Componentsclass=dd-item><ahref=/documentation/components/>Components</a></li><lidata-nav-id=/documentation/services-and-commands/title="Services and Commands"class=dd-item><ahref=/documentation/services-and-commands/>Services and Commands</a></li><lidata-nav-id=/documentation/searches/title=Searchesclass=dd-item><ahref=/documentation/searches/>Searches</a></li><lidata-nav-id=/documentation/queries/title=Queriesclass=dd-item><ahref=/documentation/queries/>Queries</a></li><lidata-nav-id=/documentation/transactions/title=Transactionsclass=dd-item><ahref=/documentation/transactions/>Transactions</a></li><lidata-nav-id=/documentation/policies/title=Policiesclass=dd-item><ahref=/documentation/policies/>Policies</a></li><lidata-nav-id=/documentation/observers/title=Observersclass=dd-item><ahref=/documentation/observers/>Observers</a></li><lidata-nav-id=/documentation/versioning/title=Versioningclass=dd-item><ahref=/documentation/versioning/>Versioning</a></li><lidata-nav-id=/documentation/reports/title=Reportsclass=dd-item><ahref=/documentation/reports/>Reports</a></li><lidata-nav-id=/documentation/priviles/title=Privilegesclass=dd-item><ahref=/documentation/priviles/>Privileges</a></li></ul></li><lidata-nav-id=/plc/title=PLCclass="dd-item
parent"><ahref=/plc/>PLC</a><ul><lidata-nav-id=/plc/architecture/title=Architectureclass="dd-item active"><ahref=/plc/architecture/>Architecture</a></li><lidata-nav-id=/plc/example-set-up/title="Example Set-Up"class=dd-item><ahref=/plc/example-set-up/>Example Set-Up</a></li></ul></li><lidata-nav-id=/tutorial/title=Tutorialclass=dd-item><ahref=/tutorial/>Tutorial</a><ul><lidata-nav-id=/tutorial/configuration/title=Configurationclass=dd-item><ahref=/tutorial/configuration/>Configuration</a></li><lidata-nav-id=/tutorial/model/title=Modelclass=dd-item><ahref=/tutorial/model/>Model</a></li><lidata-nav-id=/tutorial/crud-book/title="CRUD Book"class=dd-item><ahref=/tutorial/crud-book/>CRUD Book</a></li></ul></li><lidata-nav-id=/download/title=Downloadclass=dd-item><ahref=/download/>Download</a></li><lidata-nav-id=/development/title=Developmentclass=dd-item><ahref=/development/>Development</a></li></ul><sectionid=shortcuts><h3>More</h3><ul><li><aclass=paddinghref=https://strolch.li/tags><iclass="fas fa-tags"></i>Tags</a></li><li><aclass=paddinghref=https://github.com/strolch-li><iclass="fab fa-github"></i>GitHub project</a></li></ul></section><sectionid=footer><p>Built with <ahref=https://github.com/matcornic/hugo-theme-learn><iclass="fas fa-heart"></i></a>from <ahref=https://getgrav.org>Grav</a> and <ahref=https://gohugo.io/>Hugo</a></p></section></div></nav><sectionid=body><divid=overlay></div><divclass="padding highlightable"><div><divid=top-bar><divid=top-github-link><aclass=github-linktitle="Edit this page"href=https://github.com/Pi4J/pi4j.github.io/tree/main/contentplc/architecture.mdtarget=blank><iclass="fas fa-code-branch"></i><spanid=top-github-link-text>Edit this page</span></a></div><divid=breadcrumbsitemscopeitemtype=http://data-vocabulary.org/Breadcrumb><spanid=sidebar-toggle-span><ahref=#id=sidebar-toggledata-sidebar-toggle><iclass="fas fa-bars"></i></a></span><spanid=toc-menu><iclass="fas fa-list-alt"></i></span><spanclass=links><ahref=/>Strolch Overview</a> > <ahref=/plc/>PLC</a> > Architecture</span></div><divclass=progress><divclass=wrapper><navid=TableOfContents><ul><li><ahref=#architecture>Architecture</a><ul><li><ahref=#overview>Overview</a></li><li><ahref=#plc-architecture>PLC Architecture</a></li></ul></li></ul></nav></div></div></div></div><divid=head-tags></div><divid=body-inner><h1>Architecture</h1><h2id=architecture>Architecture</h2><h3id=overview>Overview</h3><p><imgsrc=/assets/images/Strolch-PLC-Architecture-Overview.pngalt="Strolch PLC Architecture Overview"></p><p>The Strolch PLC architecture sees the Strolch Agent as the server, managing
logical devices, i.e. multiple sensors and actors together and thus deciding on
further steps. With this architecture multiple PLCs can be combined together in
one agent for flow control.</p><h3id=plc-architecture>PLC Architecture</h3><p><imgsrc=/assets/images/Strolch-PLC-Architecture.pngalt="Strolch PLC Architecture"></p><p>On the agent side the two main classes are the <code>PlcGwServerHandler</code> and the
<code>PlcGwService</code></p><p>The <code>PlcGwServerHandler</code> handles connections from remote PLCs over WebSockets and
sends the requests to these PLCs. A <code>PlcGwService</code> instance will be notified and
can then decide on an action. In an execution model with Activities, the
<code>PlcNotificationListener</code> interface can be implemented, or the <code>PlcExecutionPolicy</code>
can be directly extended.</p><p>On the PLC side, the <code>PlcGwClientHandler</code> is optional if no agent is required. The
<code>PlcHandler</code> initializes the model and connections. The <code>Plc</code> class is Strolch
agnostic and manages the connections and notifies <code>PlcListener</code> instances on
changes coming from the underlying connections. The <code>PlcService</code> implementations
implement business logic, and can also be notified on updates from connections.</p><footerclass=footline></footer></div></div><divid=navigation><aclass="nav nav-prev"href=/plc/title=PLC><iclass="fa fa-chevron-left"></i></a><aclass="nav nav-next"href=/plc/example-set-up/title="Example Set-Up"style=margin-right:0><iclass="fa fa-chevron-right"></i></a></div></section><divstyle=left:-1000px;overflow:scroll;position:absolute;top:-1000px;border:none;box-sizing:content-box;height:200px;margin:0;padding:0;width:200px><divstyle=border:none;box-sizing:content-box;height:200px;margin:0;padding:0;width:200px></div></div><scriptsrc=/js/clipboard.min.js?1626091328></script><scriptsrc=/js/perfect-scrollbar.min.js?1626091328></script><scriptsrc=/js/perfect-scrollbar.jquery.min.js?1626091328></script><scriptsrc=/js/jquery.sticky.js?1626091328></script><scriptsrc=/js/featherlight.min.js?1626091328></script><scriptsrc=/js/highlight.pack.js?1626091328></script><script>hljs.initHighlightingOnLoad();</script><scriptsrc=/js/modernizr.custom-3.6.0.js?1626091328></script><scriptsrc=/js/learn.js?1626091328></script><scriptsrc=/js/hugo-learn.js?1626091328></script><scriptsrc=/mermaid/mermaid.js?1626091328></script><script>mermaid.initialize({startOnLoad:true});</script></body></html>