CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum by 3S-Smart Software Solutions GmbH | A member of the CODESYS Group
Deutsche Version English version russian version 
It is currently Thu Dec 13, 2018 5:44 am

All times are UTC+01:00




Post new topic  Reply to topic  [ 1 post ] 
Author Message
PostPosted: Wed Dec 05, 2018 8:58 pm 
Offline

Joined: Tue Dec 04, 2018 9:57 pm
Posts: 1
I try to make a small program in codesys 2.3.9.47

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.
Encoder: Kubler KIS40 - RS422 - 5V power supply. 6 signal wires and 2 power supply.
Cable on drum is about 17 meters.
Motor on drum will have a speed 193 r/min
Drum will have a speed about 25 r/min
PLC must stop -K1 (230V contactor) when kable is out 17 meters.
PLC must stop -K2 (230V contaktor) when kable are in at 0 meter.

I will use the Ref signal on encoder card 750-637 to set CV (counter value) at 0 meter.

CPU: Wago 750-842
DI: Wago 750-431
Encodercard: Wago 750-637
DO: Wago 750-517
Endcard: Wago 750-600

There will be a radio receiver to run motor IN and OUT and this signal will not be used in PLC.
Only encoder, encoder-card and DO-card are in use.

PLC must remember CV (counter-value) if PLC power fall out.

I have work a lot with testing LedderDiagram before in Codesys/Wago on switchboard, but has not work with StructuredText.
I try to make a function block but have problem because input from encoder are WORD and not a BOOL signal.
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.
I can also read the count value AT %IB2 (0 to 255) and AT %IB3 (0 to 16).

My problem is to make a program where I have a limit on the output.
In standard Lib, there are only function blocks for CTU, CTD and CTUD with BOOL CU or CD input.

Can someone please help me?

Best Regards
Kimmi


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 1 post ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited