0

I'm using OSCAT library to control blinds. My PLC is PFC200 from Wago and I'm using e!Cockpit. Everything works fine but I would like to get rid of automatic calibration after power failure built in the BLIND_CONTROL_S function block.

As it is written in the last sentence the "The automatic calibration however can be prevented if both inputs UP and DN are FALSE". And it actually stops the blinds to be calibrated (basically moving up and then down) but afterwards I can't control the blinds any more - UP and DOWN buttons are not working.

enter image description here

I was trying almost everything with no luck. With such an approach buttons works fine:

BlindControl(
    UP := BlindSecurity.QU,
    DN := BlindSecurity.QD,
    S_IN := BlindSecurity.STATUS,
    PI := BlindSecurity.PO
);

But in this case, there is an automatic calibration which I don't like. All blinds are going up and then down. I'm going to move into a new house within a week, I will be modifying my program a lot a the beginning, I don't want the blinds to move with each download.

Witch such approach the calibration is turned off (as suggested in the last sentence of the documentation):

BlindControl(
    UP := FALSE,
    DN := FALSE,
    S_IN := BlindSecurity.STATUS,
    PI := BlindSecurity.PO
);

BlindControl.UP := BlindSecurity.QU;
BlindControl.DN := BlindSecurity.QD;

But then buttons don't work any more.

UPDATE: The whole problem might be caused because of BLIND_INPUT as the QU and QA are automatically set to TRUE when the PLC starts:

enter image description here

And I didn't find a way to make them FALSE. Even if I will force false then in the next PLC cycle they get true again. Until the blinds go up/down in a configured time.

Dawid Rutkowski
  • 2,658
  • 1
  • 29
  • 36

1 Answers1

0
PROGRAM PLC_PRG
    VAR
        xInit: BOOL := FALSE; (* Initialize PLC *)
    END_VAR

    BlindControl(
        UP := BlindSecurity.QU AND xInit,
        DN := BlindSecurity.QD AND xInit,
        S_IN := BlindSecurity.STATUS,
        PI := BlindSecurity.PO
    );

    xInit := TRUE;
END_PROGRAM
Sergey Romanov
  • 2,949
  • 4
  • 23
  • 38
  • I'm afraid that this won't work because moving blinds up or down takes more then one processor cycle. Your code will skip move in the first cycle but in the next one the blind will start moving as the logic of BlindControl thinks that the blind is not up yet. – Dawid Rutkowski Mar 29 '21 at 21:39
  • I read your question again and I think I am correct. In this example we skip blinds move on first PLC cycle and then it works as usual. Only one cycle 20ms when you turn on PLC and then it works as usual. – Sergey Romanov Mar 31 '21 at 04:24
  • I've tested your example and it definitely will not work because of the reasons I mention. I just skip the initial move in the first cycle but the blind needs time to move up/down. The only thing you code does is that the blind will start moving in the second PLC cycle, not the first one. – Dawid Rutkowski Apr 04 '21 at 20:57
  • I updated my question with few more details. – Dawid Rutkowski Apr 05 '21 at 08:33