Joined: Tue Dec 04, 2018 9:57 pm
I try to make a small program in codesys 184.108.40.206
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?