<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Global variable access by Programms and Modbus Devices (attach device to bus)</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/bfc36a35d2/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Runtime/thread/bfc36a35d2/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Runtime/thread/bfc36a35d2/</id><updated>2024-07-18T11:27:11.709000Z</updated><subtitle>Recent posts to Global variable access by Programms and Modbus Devices (attach device to bus)</subtitle><entry><title>Global variable access by Programms and Modbus Devices (attach device to bus)</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/bfc36a35d2/?limit=25#abba" rel="alternate"/><published>2024-07-18T11:27:11.709000Z</published><updated>2024-07-18T11:27:11.709000Z</updated><author><name>wbj0t</name><uri>https://forge.codesys.com/u/wbj0t/</uri></author><id>https://forge.codesys.comde9eb048ba8ebe319447df6eb14faaf8020a2584</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi everyone. I use Raspberry Pi 4, one core codesys SL.&lt;br/&gt;
I have a question about global variable access via programm when I glued the same variable to &lt;strong&gt;MODBUS SERIAL/TCP DEVICE&lt;/strong&gt; holding register.&lt;br/&gt;
So, the question: what behavior of this modifying?&lt;br/&gt;
When I set "Always update variables (in bus cycle)" and set some task as bus for the Device, then in another task I cant change this varible (can, but immediatly the old value setted again).&lt;br/&gt;
But the same things works with &lt;strong&gt;MODBUS SLAVE&lt;/strong&gt;: again "Always update..." and master attached to some task, then I change variable in another task and all works.&lt;br/&gt;
I cant set up my variables from retains file at PrepareStart event because of this behavior with &lt;strong&gt;MODBUS SERIAL/TCP DEVICE&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Thanks, wbj0t.&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>