<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to How to access the value of a variable held in the previous cycle in ST?</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/2158b6f2cc/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/2158b6f2cc/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/2158b6f2cc/</id><updated>2021-09-01T15:50:01.226000Z</updated><subtitle>Recent posts to How to access the value of a variable held in the previous cycle in ST?</subtitle><entry><title>How to access the value of a variable held in the previous cycle in ST?</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/2158b6f2cc/?limit=25#fb79/a2ed" rel="alternate"/><published>2021-09-01T15:50:01.226000Z</published><updated>2021-09-01T15:50:01.226000Z</updated><author><name>sean-barton</name><uri>https://forge.codesys.com/u/sean-barton/</uri></author><id>https://forge.codesys.com862b7c1f1a7672efaad1d8b2972602b7ec956695</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Right, this is what I typically do to compare past and present values as well.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>How to access the value of a variable held in the previous cycle in ST?</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/2158b6f2cc/?limit=25#fb79" rel="alternate"/><published>2021-08-31T11:19:47.285000Z</published><updated>2021-08-31T11:19:47.285000Z</updated><author><name>i-campbell</name><uri>https://forge.codesys.com/u/i-campbell/</uri></author><id>https://forge.codesys.comc420794c1d72a7aa43f923a30fbed14cbc66616b</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;therr is no special command for this, you would need create a new variable called "previous_x" and do &lt;br/&gt;
previous_x := x;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>How to access the value of a variable held in the previous cycle in ST?</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/2158b6f2cc/?limit=25#e7cc/1e0a" rel="alternate"/><published>2021-08-31T10:17:44.635000Z</published><updated>2021-08-31T10:17:44.635000Z</updated><author><name>pcs-1282</name><uri>https://forge.codesys.com/u/pcs-1282/</uri></author><id>https://forge.codesys.com5c195d84c3402e0d499c523eb36638bc8c1ce7d4</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi, pardon my ignorance, I am a bit new to this, but to compare the Old &amp;amp; New values, I would need to have access to them. My doubt is, for a particular variable, say X, how do I go about getting the value of X:Old (as in the value it held in the previous scan cycle)? Thank you!&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>How to access the value of a variable held in the previous cycle in ST?</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/2158b6f2cc/?limit=25#e7cc" rel="alternate"/><published>2021-08-31T09:14:47.195000Z</published><updated>2021-08-31T09:14:47.195000Z</updated><author><name>ph0010421</name><uri>https://forge.codesys.com/u/ph0010421/</uri></author><id>https://forge.codesys.comdee80fbfc6713ef45d31d7f50ea48437e57c9fc4</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Changed := Old &amp;lt;&amp;gt; New;&lt;br/&gt;
Old := New;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>How to access the value of a variable held in the previous cycle in ST?</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/2158b6f2cc/?limit=25#ab85" rel="alternate"/><published>2021-08-31T05:52:08.780000Z</published><updated>2021-08-31T05:52:08.780000Z</updated><author><name>pcs-1282</name><uri>https://forge.codesys.com/u/pcs-1282/</uri></author><id>https://forge.codesys.com516972440cbb17424b2281758a17ed782f96f9b1</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Is it possible in CODESYS to access the value that a variable held in the previous cycle and compare it with it's present value? I am used to working with ABB's tool, which had the option of defining an attribute called &lt;em&gt;STATE&lt;/em&gt; to a variable, which helps in accessing it's previous cycle value in the ST code. Thank you!&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>