OSCAT blinds and automatic calibration

251 views Asked by At

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.

1

There are 1 answers

4
Sergey Romanov On
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