<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Detect CoDeSys runs in simulation mode</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/0f0d9617f4/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/0f0d9617f4/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/CODESYS-V2/thread/0f0d9617f4/</id><updated>2021-12-30T13:06:38.286000Z</updated><subtitle>Recent posts to Detect CoDeSys runs in simulation mode</subtitle><entry><title>Detect CoDeSys runs in simulation mode</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/0f0d9617f4/?limit=25#d6df" rel="alternate"/><published>2021-12-30T13:06:38.286000Z</published><updated>2021-12-30T13:06:38.286000Z</updated><author><name>eschwellinger</name><uri>https://forge.codesys.com/u/eschwellinger/</uri></author><id>https://forge.codesys.com25f3f79446d2f50cd27f7541bcf887a49d4f68ab</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;or use PFC100 &amp;amp; CODESYS.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Detect CoDeSys runs in simulation mode</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/0f0d9617f4/?limit=25#a23e/ef49" rel="alternate"/><published>2021-12-30T06:14:04.322000Z</published><updated>2021-12-30T06:14:04.322000Z</updated><author><name>george13</name><uri>https://forge.codesys.com/u/czerwinb/</uri></author><id>https://forge.codesys.comd2e219a1dfb1513a1d3c671061db28fc347ee0e5</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Thanks a lot for a hint! When I first saw your reply I hoped this is it, but... unfortunately it doesn't work since CoDeSys v2.3 says this pragma is not supported. Not only IsSimulationMode, but also the IF statement.&lt;br/&gt;
&lt;img src="./attachment/CoDeSys-v2.3-pragma-test.PNG" width="50%"/&gt;&lt;/p&gt;
&lt;p&gt;You inspired me to check the CoDeSys help docs and I found that it supports a few use cases for other pragmas:&lt;br/&gt;
&lt;img src="./attachment/CoDeSys-v2.3-available-pragmas.PNG" width="50%"/&gt;&lt;/p&gt;
&lt;p&gt;It looks like it is time for a costly upgrade to e!COOCKPIT...&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Detect CoDeSys runs in simulation mode</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/0f0d9617f4/?limit=25#a23e/f819" rel="alternate"/><published>2021-12-30T06:14:04.276000Z</published><updated>2021-12-30T06:14:04.276000Z</updated><author><name>george13</name><uri>https://forge.codesys.com/u/czerwinb/</uri></author><id>https://forge.codesys.com6eb9dfbc0ab6adcbdca7f54dae5e0c377e11723c</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Thanks a lot for a hint! When I first saw your reply I hoped this is it, but... unfortunately it doesn't work since CoDeSys v2.3 says this pragma is not supported. Not only IsSimulationMode, but also the IF statement.&lt;br/&gt;
&lt;img src="./attachment/CoDeSys-v2.3-pragma-test.PNG" width="50%"/&gt;&lt;/p&gt;
&lt;p&gt;You inspired me to check the CoDeSys help docs and I found that it supports a few use cases for other pragmas:&lt;br/&gt;
&lt;img src="./attachment/CoDeSys-v2.3-available-pragmas.PNG" width="50%"/&gt;&lt;/p&gt;
&lt;p&gt;It looks like it is time for a costly upgrade to e!COOCKPIT...&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Detect CoDeSys runs in simulation mode</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/0f0d9617f4/?limit=25#a23e/7145" rel="alternate"/><published>2021-12-30T06:14:04.125000Z</published><updated>2021-12-30T06:14:04.125000Z</updated><author><name>george13</name><uri>https://forge.codesys.com/u/czerwinb/</uri></author><id>https://forge.codesys.com53140b3d5b975ae5db488afeed0c601f8e165bb8</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Thanks a lot for a hint! When I first saw your reply I hoped this is it, but... unfortunately it doesn't work since CoDeSys v2.3 says this pragma is not supported. Not only IsSimulationMode, but also the IF statement.&lt;br/&gt;
&lt;img src="./attachment/CoDeSys-v2.3-pragma-test.PNG" width="50%"/&gt;&lt;/p&gt;
&lt;p&gt;You inspired me to check the CoDeSys help docs and I found that it supports a few use cases for other pragmas:&lt;br/&gt;
&lt;img src="./attachment/CoDeSys-v2.3-available-pragmas.PNG" width="50%"/&gt;&lt;/p&gt;
&lt;p&gt;It looks like it is time for a costly upgrade to e!COOCKPIT...&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Detect CoDeSys runs in simulation mode</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/0f0d9617f4/?limit=25#a23e" rel="alternate"/><published>2021-12-28T21:55:42.868000Z</published><updated>2021-12-28T21:55:42.868000Z</updated><author><name>i-campbell</name><uri>https://forge.codesys.com/u/i-campbell/</uri></author><id>https://forge.codesys.comcac3c1b6b4518918714b7f36f412fb4bf849b8cd</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;in v3.5 there is a pragma &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="err"&gt;{IF defined (IsSimulationMode)}&lt;/span&gt;
&lt;span class="err"&gt;  // simulation code&lt;/span&gt;
&lt;span class="err"&gt;{ELSE}&lt;/span&gt;
&lt;span class="err"&gt;  // normal code&lt;/span&gt;
&lt;span class="err"&gt;{END_IF}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;I am not sure if that existed already in V2.3, try it&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Detect CoDeSys runs in simulation mode</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/0f0d9617f4/?limit=25#42de" rel="alternate"/><published>2021-12-26T16:25:57.976000Z</published><updated>2021-12-26T16:25:57.976000Z</updated><author><name>george13</name><uri>https://forge.codesys.com/u/czerwinb/</uri></author><id>https://forge.codesys.com8fdf286d4eb3cf65cba25db5bb6e97b504bdb3e3</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi all, is it possible to detect that the program runs in the simulation mode in CoDeSys 2.3 rather than on the PLC?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Why I need this?&lt;/strong&gt;&lt;br/&gt;
I own WAGO PLC 750-880 and I am using the SysRtcGetTime() function to read the PLC clock. As you know it doesn't work in the simulation mode, therefore I am using RTC() function block to &lt;em&gt;simulate&lt;/em&gt; the clock by providing a certain date.&lt;/p&gt;
&lt;p&gt;Any ideas are welcome!&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>