<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Calling a Method from different Tasks</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/9185c56976/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/9185c56976/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/9185c56976/</id><updated>2020-02-27T13:55:53.393000Z</updated><subtitle>Recent posts to Calling a Method from different Tasks</subtitle><entry><title>Calling a Method from different Tasks</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/9185c56976/?limit=25#4481" rel="alternate"/><published>2020-02-27T13:55:53.393000Z</published><updated>2020-02-27T13:55:53.393000Z</updated><author><name>yannickasselin1</name><uri>https://forge.codesys.com/u/yannickasselin1/</uri></author><id>https://forge.codesys.com1584d99e232160b2ab194008f44b0fb7f8b3ed27</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Yes I use TC3.&lt;br/&gt;
I will look for the TestAndSet Function.&lt;br/&gt;
Thanks a lot.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Calling a Method from different Tasks</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/9185c56976/?limit=25#6812" rel="alternate"/><published>2020-02-27T13:55:53.181000Z</published><updated>2020-02-27T13:55:53.181000Z</updated><author><name>rickj</name><uri>https://forge.codesys.com/u/rickj/</uri></author><id>https://forge.codesys.come7ebe4ef917f4d7c5f55eb8718149ed7f225fc07</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;There is a possibility the method will be interrupted between reading and writing the variable.  So I do not believe it is enough.  I believe you said in another post that you are using TC3, if so Bechhoff has a TestAndSet function/function block that disables task preemption while it performs these operations.  There must also be a "disable task preemption" function/function block or something similar in the 3S or CAA libraries.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Calling a Method from different Tasks</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/9185c56976/?limit=25#3ad0" rel="alternate"/><published>2020-02-27T13:55:52.966000Z</published><updated>2020-02-27T13:55:52.966000Z</updated><author><name>josepmariarams</name><uri>https://forge.codesys.com/u/josepmariarams/</uri></author><id>https://forge.codesys.com8af2222c69713c471c3b0cf235156a8a95745fc9</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I amb calling all my fbs from all tasks. And I pass to him the task from which has been called. Inside t'he fb, a switch case determine the function( runHigh, runMid, or runFreewheel) that has to be called un function of the task whic calls.&lt;/p&gt;
&lt;p&gt;Enviat des del meu Aquaris M5.5 usant Tapatalk&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Calling a Method from different Tasks</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/9185c56976/?limit=25#6e51" rel="alternate"/><published>2020-02-27T13:55:52.744000Z</published><updated>2020-02-27T13:55:52.744000Z</updated><author><name>yannickasselin1</name><uri>https://forge.codesys.com/u/yannickasselin1/</uri></author><id>https://forge.codesys.comb5136399ae5393d113c98e74c714d848e6c8d7fe</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;If I want to call the same method from different Tasks, what would be the way to prevent the method being called from the 2 tasks at the same time?&lt;/p&gt;
&lt;p&gt;I thought about using a "busy" variable in the FB holding the method. Setting it to TRUE at the beginning of the method and setting it FALSE at the end and make sure the "Busy" variable is false before calling the method.&lt;/p&gt;
&lt;p&gt;Is this enough or is there a better way of doing this?&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>