<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="395275" data-post-id="395275">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="tallakt" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/tallakt/120/942_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  tallakt
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="n0gg1n" data-post="11" data-topic="76927">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/n0gg1n/48/18271_2.png" class="avatar"> n0gg1n:</div>
<blockquote>
<p>wouldn’t it make more sense to use Elixirs event driven approach? There is also a newer norm (IEC 61499) which is closer to the BEAM event model, have you looked into that?</p>
</blockquote>
</aside>
<p>I modelled Xignal after PLCs that I used to work with earlier. I think the scan makes the system easy to reason about and I believe for many signals performance will be better. The current system implements:</p>
<p>io at scan rate x Hz<br>
 → <br>
io image in memory<br>
 → <br>
scan runner at y Hz<br>
 → <br>
output image in memory<br>
 → <br>
IO writer at x Hz</p>
<p>The good thing is you can have several IO devices at different rates and it doesn’t matter. Its very simple.</p>
<p>Even so, just recently I made a <code>:triggered</code> mode that reads the inputs, then runs the logic, then writes, based on events. You can still run slower io in the same mix though, in the old way.</p>
<p>I have done many test with threading though, and because these logic tasks are very lightweight, to get performance you need to match n threads to n CPU cores, something I would normally not consider in Elixir.</p>
<p>I didnt look into the new event based standards except very briefly. I don’t think these have been very successful to my knowledge, and I am not sure if they even make practical sense. Anyhow, that is not the system I wrote with Xignal. Maybe something to test for Yignal? Even for Modbus, values are often read in blocks, and many values woudn’t change… but you still need a way to inform each signal about time advancing?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="395275" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/xignal-and-yaopcua-soft-plc-software-in-elixir/76927/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-395275" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="395275"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #11"></div>
  </section>
</div>
    <div class="postbit" id="395281" data-post-id="395281">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="n0gg1n" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/n0gg1n/120/18271_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  n0gg1n
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>The problem I see with this is that you are recomputing all values in your step function and most of the time they won’t change (obviously depending on the application). But realistically you are wasting compute.<br>
So my feeling is you are borrowing the “wrong” abstractions.<br>
Would be nice to see more examples on how Xignal would solve different problems. But emulating the tick based approach doesn’t feel right.</p>
<aside class="quote no-group" data-username="tallakt" data-post="12" data-topic="76927">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/tallakt/48/942_2.png" class="avatar"> tallakt:</div>
<blockquote>
<p>but you still need a way to inform each signal about time advancing?</p>
</blockquote>
</aside>
<p>What do you mean by that? Just trigger an event as soon as something changed.</p>
<p>I don’t want to sound too negative because I really like the idea of having a BEAM alternative to traditional plc programming. But I think a better approach would be to build on BEAMs strength being event driven.</p>
<p>I think <a class="mention" href="/u/peerst" rel="nofollow">@peerst</a> already tried something similar with <a href="https://www.grisp.org" rel="noopener nofollow ugc">GRiSP</a>.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="395281" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/xignal-and-yaopcua-soft-plc-software-in-elixir/76927/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-395281" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="395281"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #12"></div>
  </section>
</div>
    <div class="postbit" id="395284" data-post-id="395284">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="tallakt" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/tallakt/120/942_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  tallakt
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Grisp is more about hardware. Eg I2C belongs in the PCB domain whereas in the PLC world you would connect to IO modules eg over ethernet. Also you may want to expose «tags» over OPC-UA that would interoperate with other parts of your system.</p>
<p>So what I meant with time is that every xignal (PLC block) would also implicitly get a time input. With the scan method I implemented this is passed every tick. With a flow/event based system you somehow have to implement this eg for an integral block. The clock would have to be run at a fixed rate or every time you get an update or need to read the output, you would have to update the integral value for the time passed since last time.</p>
<p>I think the flow/event based system makes a lot of sense for a system with a huge number of paths, expensive calculations, and data that updates infrequently.</p>
<p>The point where that model would make more sense than a scanned system is far beyond whatever I have seen in my work experience. Actually computational power is rarely the limit, running the scans is a waste but it doesnt really make any difference. And, you could always run Xignal systems alongside flow/event systems if you like. Its all just plain Elixir.</p>
<p>Another issue with flow/event based system is that real time properties are harder to reason about, even if your CPU is more idle on average. Eg a signal change that touches most of your blocks would increase the update time a lot causing jitter. If you run everything all the time, its always the same amount of calculations.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="395284" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/xignal-and-yaopcua-soft-plc-software-in-elixir/76927/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-395284" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="395284"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #13"></div>
  </section>
</div>
    <div class="postbit" id="395295" data-post-id="395295">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="n0gg1n" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/n0gg1n/120/18271_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  n0gg1n
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="tallakt" data-post="14" data-topic="76927">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/tallakt/48/942_2.png" class="avatar"> tallakt:</div>
<blockquote>
<p>The point where that model would make more sense than a scanned system is far beyond whatever I have seen in my work experience. Actually computational power is rarely the limit, running the scans is a waste but it doesnt really make any difference. And, you could always run Xignal systems alongside flow/event systems if you like. Its all just plain Elixir.</p>
</blockquote>
</aside>
<p>I totally agree. I just found it always quite confusing to wrap my head around designing tick based systems. It just feels more natural to implement it event based from my perspective since the world is also event driven.</p>
<aside class="quote no-group" data-username="tallakt" data-post="14" data-topic="76927">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/tallakt/48/942_2.png" class="avatar"> tallakt:</div>
<blockquote>
<p>Another issue with flow/event based system is that real time properties are harder to reason about, even if your CPU is more idle on average. Eg a signal change that touches most of your blocks would increase the update time a lot causing jitter. If you run everything all the time, its always the same amount of calculations.</p>
</blockquote>
</aside>
<p>What does real time really mean? If you have jitter for several seconds its definitely a problem for many automation problems, but what jitter are we expecting? It’s more in the ms area and I don’t think that’s at problem at all for most automation problems?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="395295" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/xignal-and-yaopcua-soft-plc-software-in-elixir/76927/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-395295" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="395295"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #14"></div>
  </section>
</div>
    <div class="postbit" id="395312" data-post-id="395312">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="tallakt" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/tallakt/120/942_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  tallakt
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I think this is a good discussion and the existence of two separate PLC standards reflect this. Though I did a little research it seems the tick based approach is the more pragmatic and popular choice by far right now. So I dont se Xignal going in that direction, because its a core design choice that affects the whole code base.</p>
<p>I want Xignal to be useful not an R&amp;D project. Going to events ticks off the feeling «its the purer approach», but really it wont matter for many plants if one or the other method was used.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="395312" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/xignal-and-yaopcua-soft-plc-software-in-elixir/76927/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-395312" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="395312"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #15"></div>
  </section>
</div>
    <div class="postbit" id="395354" data-post-id="395354">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="n0gg1n" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/n0gg1n/120/18271_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  n0gg1n
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="tallakt" data-post="16" data-topic="76927">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/tallakt/48/942_2.png" class="avatar"> tallakt:</div>
<blockquote>
<p>I think this is a good discussion and the existence of two separate PLC standards reflect this. Though I did a little research it seems the tick based approach is the more pragmatic and popular choice by far right now. So I dont se Xignal going in that direction, because its a core design choice that affects the whole code base.</p>
</blockquote>
</aside>
<p>Yes tick based approach is definitely the industry standard. But for me it feels more natural to think event based. But as you already said: since it is based on the BEAM you could “escape” the tick based approach on a higher level as you want.<br>
And at the end it is just a matter of taste.</p>
<p>Hope you are able to share more information with us in the future <img src="https://forum.elixirforum.com/images/emoji/apple/slight_smile.png?v=15" title=":slight_smile:" class="emoji" alt=":slight_smile:" loading="lazy" width="20" height="20"></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="395354" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/xignal-and-yaopcua-soft-plc-software-in-elixir/76927/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-395354" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="395354"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #16"></div>
  </section>
</div>
    <div class="postbit" id="395407" data-post-id="395407">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="cmo" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/cmo/120/19618_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  cmo
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Can you write your own instructions (AOIs in Rockwell speak)?</p>
<p>With regards to the tags, I was saying that working with thousands, even hundreds or dozens, of tags defined throughout the codebase does not seem like a maintainable way to go.  How do I import/export tags?  How do I filter and sort them?</p>
<aside class="quote no-group" data-username="tallakt" data-post="3" data-topic="76927">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/tallakt/48/942_2.png" class="avatar"> tallakt:</div>
<blockquote>
<p>It can show “online view”, a web page containing the code, then the live values next to each statement. I think this should be almost on par with many PLC software I have used. Though very few bells and whistles at this point. You can see IO and state machine states etc.</p>
</blockquote>
</aside>
<p>Very nice.  Though, in my experience it is a lot easier to work with the live state in LD or FB than ST.</p>
<aside class="quote no-group" data-username="tallakt" data-post="3" data-topic="76927">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/tallakt/48/942_2.png" class="avatar"> tallakt:</div>
<blockquote>
<p>Yes. It uses Elixir testing and then there is a test runner that does not use wall time. I think this is a huge improvement to PLS software I have seen, and also for AI it can iterate better with testing.</p>
</blockquote>
</aside>
<p>Very nice.  Usually, people do manual testing.  FactoryTalk Logix Echo allows you to fiddle with time.  I am in the process of migrating my PLC test framework to use it so I can take advantage of that.  Been talking to real PLCs which is slow and manually advancing timers is arduous and not 100% correct.</p>
<aside class="quote no-group" data-username="tallakt" data-post="3" data-topic="76927">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/tallakt/48/942_2.png" class="avatar"> tallakt:</div>
<blockquote>
<p>Hot code reload works well and was foundational to the design. So you can reload the code and timers, integrals, etc run uninterrupted. There is also retentive values for storing between restarts.</p>
<p>If the new code doesn’t match the old code or doesnt run in a sandbox, the hot code reload is blocked.</p>
<p>Its a different way then traditional PLC, but the functionality should let you work pretty easily with running systems.</p>
</blockquote>
</aside>
<p>Sounds similar to how you have to download to GE’s Proficy (<img src="https://forum.elixirforum.com/images/emoji/apple/nauseated_face.png?v=15" title=":nauseated_face:" class="emoji" alt=":nauseated_face:" loading="lazy" width="20" height="20"> to those PLCs).  Live edits are essential in my eyes.</p>
<p>I’ve not used an <code>sr</code> bit before.  Generally, you need debounce timers, deadbands etc on level sensors etc.</p>
<p><a class="mention" href="/u/n0gg1n" rel="nofollow">@n0gg1n</a> IEC 61499 really intrigues me.  I think I discovered it shortly after Elixir and was lovestruck.  I have never heard of it being used in the wild, you?  Sounds like how I imagine a DCS works.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="395407" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/xignal-and-yaopcua-soft-plc-software-in-elixir/76927/18">Post #17</a>
	                </div>
	            </div>
              <div id="likers-container-395407" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="395407"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #17"></div>
  </section>
</div>
    <div class="postbit" id="395409" data-post-id="395409">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="n0gg1n" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/n0gg1n/120/18271_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  n0gg1n
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="cmo" data-post="18" data-topic="76927">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/cmo/48/19618_2.png" class="avatar"> cmo:</div>
<blockquote>
<p><a class="mention" href="/u/n0gg1n" rel="nofollow">@n0gg1n</a> IEC 61499 really intrigues me. I think I discovered it shortly after Elixir and was lovestruck. I have never heard of it being used in the wild, you? Sounds like how I imagine a DCS works.</p>
</blockquote>
</aside>
<p>That was exactly my journey, too! I’ve never seen it in the wild either, but I’ve only worked with fairly old systems so far.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="395409" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/xignal-and-yaopcua-soft-plc-software-in-elixir/76927/19">Post #18</a>
	                </div>
	            </div>
              <div id="likers-container-395409" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="395409"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #18"></div>
  </section>
</div>
    <div class="postbit" id="395464" data-post-id="395464">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="tallakt" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/tallakt/120/942_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  tallakt
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group quote-modified" data-username="cmo" data-post="18" data-topic="76927" data-full="true">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/cmo/48/19618_2.png" class="avatar"> cmo:</div>
<blockquote>
<p>Can you write your own instructions (AOIs in Rockwell speak)?</p>
<p>With regards to the tags, I was saying that working with thousands, even hundreds or dozens, of tags defined throughout the codebase does not seem like a maintainable way to go. How do I import/export tags? How do I filter and sort them?</p>
<aside class="quote no-group" data-username="tallakt" data-post="3" data-topic="76927">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/tallakt/48/942_2.png" class="avatar"> tallakt:</div>
<blockquote>
<p>Yes. It uses Elixir testing and then there is a test runner that does not use wall time. I think this is a huge improvement to PLS software I have seen, and also for AI it can iterate better with testing.</p>
</blockquote>
</aside>
<p>Very nice. Usually, people do manual testing. FactoryTalk Logix Echo allows you to fiddle with time. I am in the process of migrating my PLC test framework to use it so I can take advantage of that. Been talking to real PLCs which is slow and manually advancing timers is arduous and not 100% correct.</p>
<aside class="quote no-group" data-username="tallakt" data-post="3" data-topic="76927">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/tallakt/48/942_2.png" class="avatar"> tallakt:</div>
<blockquote>
<p>Hot code reload works well and was foundational to the design. So you can reload the code and timers, integrals, etc run uninterrupted. There is also retentive values for storing between restarts.</p>
<p>If the new code doesn’t match the old code or doesnt run in a sandbox, the hot code reload is blocked.</p>
<p>Its a different way then traditional PLC, but the functionality should let you work pretty easily with running systems.</p>
</blockquote>
</aside>
<p>Sounds similar to how you have to download to GE’s Proficy (<img src="https://forum.elixirforum.com/images/emoji/apple/nauseated_face.png?v=15" title=":nauseated_face:" class="emoji" alt=":nauseated_face:" loading="lazy" width="20" height="20"> to those PLCs). Live edits are essential in my eyes.</p>
<p>I’ve not used an <code>sr</code> bit before. Generally, you need debounce timers, deadbands etc on level sensors etc.</p>
<p><a class="mention" href="/u/n0gg1n" rel="nofollow">@n0gg1n</a> IEC 61499 really intrigues me. I think I discovered it shortly after Elixir and was lovestruck. I have never heard of it being used in the wild, you? Sounds like how I imagine a DCS works.</p>
</blockquote>
</aside>
<p>Can you write your own instructions; you can write yourself anything in the library in your own project. Its all just Elixir. Eg (AI provided translations):</p>
<p>Xignal:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">xignal pump(level) do
  wanted = sr(level &gt; 80.0, level &lt; 20.0)
  run = ton(wanted, ~t(5s))
  [run: run, hours: runtime(run) / ~t(1h)]
end
</code></pre>
<p>Rockwell AOI (ish)</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">// Structured Text inside the AOI
IF Level &gt; 80.0 THEN Latch := 1; END_IF;
IF Level &lt; 20.0 THEN Latch := 0; END_IF;

Delay.IN := Latch;
Delay.PRE := 5000;
TONR(Delay);   // timer instruction on the local timer tag
Run := Delay.DN;
// ...plus your own accumulator logic for hours
</code></pre>
<p>Tags; you can structure the code any way you want. Xignal prints IO lists in mix tasks, but thats really just the tip of the iceberg. In general, you create IO points and connect them to xignals (transform with signals). You usually would connect every IO by itself, but you could also script it eg, for connecting 10 pumps with a common IO addressing convention.</p>
<p>“I’ve not used an <code>sr</code> bit before. Generally, you need debounce timers, deadbands etc on level sensors etc.” - Xignal provide built in <code>xignal</code>s (blocks) for all of these and a lot more.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="395464" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/xignal-and-yaopcua-soft-plc-software-in-elixir/76927/20">Post #19</a>
	                </div>
	            </div>
              <div id="likers-container-395464" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="395464"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #19"></div>
  </section>
</div>
    <div class="postbit" id="395465" data-post-id="395465">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="tallakt" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/tallakt/120/942_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  tallakt
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="n0gg1n" data-post="17" data-topic="76927">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/n0gg1n/48/18271_2.png" class="avatar"> n0gg1n:</div>
<blockquote>
<p>Yes tick based approach is definitely the industry standard. But for me it feels more natural to think event based. But as you already said: since it is based on the BEAM you could “escape” the tick based approach on a higher level as you want.<br>
And at the end it is just a matter of taste.</p>
</blockquote>
</aside>
<p>I wanted to share my cat litter box project. It interfaces a Tuya web service (not to recommend it though, its cheap but crap). The project integrates scan based PLC functionality with web services and http notifications, which are normal Elixir code and event based. I think maybe its the best of both worlds actually. Short time scans for control stuff, then pan out to events for database, notifications, other systems, calculations that happen infrequently etc.</p>
<aside class="onebox githubrepo" data-onebox-src="https://github.com/tallakt/cat_litter_box">
  <header class="source">

      <a href="https://github.com/tallakt/cat_litter_box" target="_blank" rel="noopener nofollow ugc">github.com</a>
  </header>

  <article class="onebox-body">
    <div class="github-row" data-github-private-repo="false">
  <img width="690" height="344" src="https://opengraph.githubassets.com/2c042f2fd4ee6b3bacdcd7f5a16da964/tallakt/cat_litter_box" class="thumbnail">

  <h3><a href="https://github.com/tallakt/cat_litter_box" target="_blank" rel="noopener nofollow ugc">GitHub - tallakt/cat_litter_box</a></h3>

    <p><span class="github-repo-description">Contribute to tallakt/cat_litter_box development by creating an account on GitHub.</span></p>
</div>

  </article>

  <div class="onebox-metadata">
    
    
  </div>

  <div style="clear: both"></div>
</aside>

<p>This was 100% AI written and commissioned, and the AI can work easily with Xignal projects. It has AI introspection tools as well as human facing ones.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="395465" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/xignal-and-yaopcua-soft-plc-software-in-elixir/76927/21">Post #20</a>
	                </div>
	            </div>
              <div id="likers-container-395465" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="395465"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-last-post cat-last-post" title="Last post!"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>