<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to ow to create a loop.</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/7fb447dd4c/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/7fb447dd4c/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/7fb447dd4c/</id><updated>2020-02-27T13:58:03.367000Z</updated><subtitle>Recent posts to ow to create a loop.</subtitle><entry><title>ow to create a loop.</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/7fb447dd4c/?limit=25#5450" rel="alternate"/><published>2020-02-27T13:58:03.367000Z</published><updated>2020-02-27T13:58:03.367000Z</updated><author><name>Strucc</name><uri>https://forge.codesys.com/u/strucc/</uri></author><id>https://forge.codesys.com706b1ca81e3bc8b9a188fd425feddde8eeab192a</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;All you have to do, is to call this program regularly...&lt;/p&gt;
&lt;p&gt;The easiest way, probably to add a call into PLC_PRG, what is created by default in your project:&lt;/p&gt;
&lt;p&gt;AnalogDigital();&lt;/p&gt;
&lt;p&gt;Just have a look at the devices tree in your project, and look at the Tasks element... Make sure that PLC_PRG - or your AnalogDigital is regularly called...&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>ow to create a loop.</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/7fb447dd4c/?limit=25#1945" rel="alternate"/><published>2020-02-27T13:58:03.106000Z</published><updated>2020-02-27T13:58:03.106000Z</updated><author><name>kenneth164</name><uri>https://forge.codesys.com/u/kenneth164/</uri></author><id>https://forge.codesys.com70009761c94c557538824e0f06c7cc677567ece8</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;For my work i had to try and work with codesys but a have to create a program where we can change an incomming signal in 4-20mA to a signal in lux but i have a problem that we can't create a loop to make sure the function keeps going for every new input we get . this is what i have so far:&lt;/p&gt;
&lt;p&gt;ROGRAM AnalogDigital&lt;br/&gt;
VAR&lt;br/&gt;
Lux: REAL;&lt;br/&gt;
input1: REAL;&lt;br/&gt;
LuxMax: REAL;&lt;br/&gt;
LuxMin: REAL;&lt;br/&gt;
Output1: BOOL;&lt;br/&gt;
END: BOOL;&lt;br/&gt;
Input3 : BOOL;&lt;/p&gt;
&lt;p&gt;END_VAR&lt;/p&gt;
&lt;p&gt;Lux:= (input1 - 4)*(LuxMax - LuxMin)/(20-4);&lt;/p&gt;
&lt;p&gt;IF Lux&amp;gt; 500 THEN;&lt;/p&gt;
&lt;p&gt;Input3:=TRUE;&lt;/p&gt;
&lt;p&gt;Output1:=Input3;&lt;/p&gt;
&lt;p&gt;ELSE;&lt;br/&gt;
Lux:= (input1 - 4)*(LuxMax - LuxMin)/(20-4);&lt;/p&gt;
&lt;p&gt;END_IF&lt;/p&gt;
&lt;p&gt;ty for the help in advance&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>