<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Codesys program with Wago 750-637 encoder card</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/5bed0a53cd/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/5bed0a53cd/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/CODESYS-V2/thread/5bed0a53cd/</id><updated>2020-02-27T23:05:16.173000Z</updated><subtitle>Recent posts to Codesys program with Wago 750-637 encoder card</subtitle><entry><title>Codesys program with Wago 750-637 encoder card</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/5bed0a53cd/?limit=25#31fe" rel="alternate"/><published>2020-02-27T23:05:16.173000Z</published><updated>2020-02-27T23:05:16.173000Z</updated><author><name>Kimmi</name><uri>https://forge.codesys.com/u/kimmi/</uri></author><id>https://forge.codesys.comb13f23331726a5aee332101a90ce78456f912fb2</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I try to make a small program in codesys 2.3.9.47&lt;/p&gt;
&lt;p&gt;I have one incremental encoder that will be used as a limit for measure when we have taken 17meters out of a drum and as a limit when cable are back om drum. &lt;br/&gt;
Encoder: Kubler KIS40 - RS422 - 5V power supply. 6 signal wires and 2 power supply.&lt;br/&gt;
Cable on drum is about 17 meters.&lt;br/&gt;
Motor on drum will have a speed 193 r/min&lt;br/&gt;
Drum will have a speed about 25 r/min&lt;br/&gt;
PLC must stop -K1 (230V contactor) when kable is out 17 meters.&lt;br/&gt;
PLC must stop -K2 (230V contaktor) when kable  are in at 0 meter.&lt;/p&gt;
&lt;p&gt;I will use the Ref signal on encoder card 750-637 to set CV (counter value) at 0 meter.&lt;/p&gt;
&lt;p&gt;CPU: Wago 750-842&lt;br/&gt;
DI:    Wago 750-431&lt;br/&gt;
Encodercard: Wago 750-637&lt;br/&gt;
DO:   Wago 750-517&lt;br/&gt;
Endcard:       Wago 750-600&lt;/p&gt;
&lt;p&gt;There will be a radio receiver to run motor IN and OUT and this signal will not be used in PLC.&lt;br/&gt;
Only encoder, encoder-card and DO-card are in use.&lt;/p&gt;
&lt;p&gt;PLC must remember CV (counter-value) if PLC power fall out.&lt;/p&gt;
&lt;p&gt;I have work a lot with testing LedderDiagram before in Codesys/Wago on switchboard, but has not work with StructuredText.&lt;br/&gt;
I try to make a function block but have problem because input from encoder are WORD and not a BOOL signal.&lt;br/&gt;
I can read wActualPosition AT %IW1; and it read up to 65536, before it start at 0 and read up again. It count down when I change direction om motor.&lt;br/&gt;
I can also read the count value AT %IB2 (0 to 255) and AT %IB3 (0 to 16).&lt;/p&gt;
&lt;p&gt;My problem is to make a program where I have a limit on the output.&lt;br/&gt;
In standard Lib, there are only function blocks for CTU, CTD and CTUD with BOOL CU or CD input.&lt;/p&gt;
&lt;p&gt;Can someone please help me?&lt;/p&gt;
&lt;p&gt;Best Regards&lt;br/&gt;
Kimmi&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>