Warning on apparently simple code (from codesys manual V2.3)

fsahmed83
2017-02-14
2017-03-16
  • fsahmed83 - 2017-02-14

    Just started Codesys. Tried to implement a simplified version of the traffic signal example included in the V2.3 manual (controlling only one set of lights). Two problems :
    1. The TP timer doesn't seem to respect the PT value. Same value for all lights and it randomly lengthens or shortens the period.
    2. Warning after JMPC instruction : Part of the statements have no effect. (Code in the attached screenshot).

    What am I missing?

    IMG: Warning_Codesys.jpg

     
  • Anonymous - 2017-02-19

    Originally created by: scott_cunningham

    If ZAB is a timer TON type of FB, then ZAB.Q will be False until the time expires. Then your code would not jump to MARK and would always be resetting and starting the timer over. What is ZAB?

     
  • r.evbatyrov - 2017-02-20

    Hello fsahmed83,

    the IL in V3 is network-based, whereas it was text-based in V2.3, causing some conceptual incompatibilities. For example, in V3 you can place a label only at the beginning of a network (not everywhere between two lines). Hovewer, the content of the accumulator get lost between two networks. So, you cannot just copy the code of 2.3-IL and use it in V3-IL.

    What you're missing.
    1. V3-IL is a no more supported outdated feature that is not recommended to use for new development. So, avoid using IL.
    2. Your ZAP is probably an instance of TP. There is no initialization of PT parameter before call, so it doesnot respect it. To realize, which logic correspond to your IL-code, convert the network to FBD (FBD->View->As FBD). The diagram shows clearly, that PT is not assigned.
    3. Syntax checker expects, that the JMPC xxxxxx is the last code line in the network, causing that warning.

    Regards,
    Roman

     
  • fsahmed83 - 2017-03-16

    r.evbatyrov hat geschrieben:
    Hello fsahmed83,
    the IL in V3 is network-based, whereas it was text-based in V2.3, causing some conceptual incompatibilities. For example, in V3 you can place a label only at the beginning of a network (not everywhere between two lines). Hovewer, the content of the accumulator get lost between two networks. So, you cannot just copy the code of 2.3-IL and use it in V3-IL.
    What you're missing.
    1. V3-IL is a no more supported outdated feature that is not recommended to use for new development. So, avoid using IL.
    2. Your ZAP is probably an instance of TP. There is no initialization of PT parameter before call, so it doesnot respect it. To realize, which logic correspond to your IL-code, convert the network to FBD (FBD->View->As FBD). The diagram shows clearly, that PT is not assigned.
    3. Syntax checker expects, that the JMPC xxxxxx is the last code line in the network, causing that warning.
    Regards,
    Roman

    Thanks both of you. Rewrote it in ST and it works now.

     

Log in to post a comment.