<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Correct approach for asynchronous system commands?</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/5ca3c513c1/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Runtime/thread/5ca3c513c1/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Runtime/thread/5ca3c513c1/</id><updated>2021-11-29T20:27:02.033000Z</updated><subtitle>Recent posts to Correct approach for asynchronous system commands?</subtitle><entry><title>Correct approach for asynchronous system commands?</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/5ca3c513c1/?limit=25#9254" rel="alternate"/><published>2021-11-29T20:27:02.033000Z</published><updated>2021-11-29T20:27:02.033000Z</updated><author><name>lefish</name><uri>https://forge.codesys.com/u/lefish/</uri></author><id>https://forge.codesys.com14a8395ad35efffddf55d60b580fc75daea55658</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi there,&lt;/p&gt;
&lt;p&gt;I am developing a control system on a Raspberry Pi, consisting of two main TASKS:&lt;/p&gt;
&lt;p&gt;(1) MAIN TASK: "Soft realtime" tasks for controlling actors and reading digital inputs via EtherCAT (EK1100). Cycle time 100 ms.&lt;br/&gt;
(2) Asynchronous system commands for checking various system properties. Cycle time of multiple seconds are perfectly fine.&lt;/p&gt;
&lt;p&gt;At first I put the realtime and asynchronous tasks into the MAIN TASK, as I thought the state machine implementation of asynchronous tasks would take care of their asynchronous nature.&lt;/p&gt;
&lt;p&gt;Despite this approach I had the problem, that the asynchronous system commands led to very high jitter in MAIN TASK causing the EtherCAT bus to malfunction -&amp;gt; EtherCAT stopped working at random times -&amp;gt; NOT usable&lt;/p&gt;
&lt;p&gt;To fix this issue I created a freewheeling TASK for the asynchronous system commands with a priority value of 31. Lets call it SLOW TASK.&lt;/p&gt;
&lt;p&gt;Now I have jitter values of &amp;lt; 10 ms in MAIN TASK and cycle times of up to 5 s on SLOW TASK. &lt;/p&gt;
&lt;p&gt;As far as I can tell everything is working fine.&lt;/p&gt;
&lt;p&gt;Nevertheless I would like to check, if my approach is correct.&lt;/p&gt;
&lt;p&gt;Please send me your optinions on my approach.&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;
&lt;p&gt;LeFish&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>