Untitled

mail@pastecode.io avatar
unknown
plain_text
20 days ago
3.8 kB
1
Indexable
Never
(*

=====================================================================================

Begin MODELOCK logic

=====================================================================================

*)

MODE_TARGET := '/MODE.TARGET';

SELECT_ML := '^/SELECT_ML.CV';

REQ_MODE_TARGET := '/REQ_MODE.TARGET';

REQ_MODE_TRK :='^/REQ_MODE_TRK.CV';

ML_ACTIVE := '^/CND/OUT_D.CV';

(*

-------------------------------------------------------------------------------------

Update Requested Mode on Download

-------------------------------------------------------------------------------------

*)

IF

    ((SYSSTAT('$sysstat_opts:MyDownload')OR

      ('^/DOWNLOAD.CV' = TRUE)) AND

     (REQ_MODE_TRK = TRUE))

THEN

    '/REQ_MODE.TARGET' := MODE_TARGET;

    REQ_MODE_TARGET := MODE_TARGET;

    PREV_REQ_MODE := MODE_TARGET;

ENDIF;

'^/DOWNLOAD.CV' := FALSE;

(*

-------------------------------------------------------------------------------------

Ignore MODELOCK if not Enabled

-------------------------------------------------------------------------------------

*)

IF

    (SELECT_ML = 0)

THEN

    IF

        (PREV_REQ_MODE != REQ_MODE_TARGET)

    THEN

        '/MODE.TARGET' := REQ_MODE_TARGET;

    ELSE

        IF

            ((PREV_MODE_TARGET != MODE_TARGET) AND

             (REQ_MODE_TRK = TRUE))

        THEN

            '/REQ_MODE.TARGET' := MODE_TARGET;

        ENDIF;

    ENDIF;

ELSE

(*

-------------------------------------------------------------------------------------

Provide MODELOCK Option Selected

-------------------------------------------------------------------------------------

*)

    ML_PREV := '/MODELOCKED.CV';

    IF

        (((ML_PREV = TRUE) AND

         (MODE_TARGET != REQ_MODE_TARGET)) OR

         ((PREV_REQ_MODE != REQ_MODE_TARGET) AND

         (REQ_MODE_TRK = TRUE)))

    THEN

        '/MODE.TARGET' := REQ_MODE_TARGET;

    ELSE

        IF

            ((PREV_MODE_TARGET != MODE_TARGET) AND

             (REQ_MODE_TRK = TRUE))

        THEN

            '/REQ_MODE.TARGET' := MODE_TARGET;

        ENDIF;

    ENDIF;

(*

-------------------------------------------------------------------------------------

Set Modelock for following different combinations of arbitration:

Immediate Lock, Delayed Lock, Immediate Lock with Override option,

Delayed Lock with Override option, No Lock, Lock regardless of Ownership

-------------------------------------------------------------------------------------

*)

    ML_NEW := ((ML_ACTIVE = TRUE) AND

              ('/HOLD_REQ.CV' = FALSE));

(*

-------------------------------------------------------------------------------------

SP Tracking and Switch to Default Operator mode (if enabled)

-------------------------------------------------------------------------------------

*)

    IF

        (ML_NEW != ML_PREV)

    THEN

(*

-------------------------------------------------------------------------------------

Write back MODELOCKED

-------------------------------------------------------------------------------------

*)

        '/MODELOCKED.CV' := ML_NEW;

        IF

            ((ML_NEW = TRUE) AND

             ('^/SP_TRK_ON_NEW_ML.CV' = TRUE))

        THEN

            '/REQ_OUTP.CV' := '/OUT.CV';

            '/REQ_SP.CV' := '/SP.CV';

        ELSE

            IF

                ('^/ENAB_DFLT_OPMD.CV' = TRUE)

            THEN

                '/MODE.TARGET' := '^/DFLT_OPMD.TARGET';

            ENDIF;

        ENDIF;

    ENDIF;

ENDIF;

PREV_MODE_TARGET := '/MODE.TARGET';

PREV_REQ_MODE := '/REQ_MODE.TARGET';

(*

=====================================================================================

End of Code

=====================================================================================

*)
Leave a Comment