Using ONS in a Program

Lee23
2022-02-10
2022-02-11
  • Lee23 - 2022-02-10

    Greetings I am new to the Codesys envivroment aswell as the industry as a whole. I am wondering if ONS or Oneshot the Instruction is available in the Ladder Logic of the Codesys software similar to other programming software or if it has a different classification I am currently not seeing, I am looking at the function blocks R_TRIG and the RS function block and thinking that they are the solution however I thought I would ask incase I was missing something or there is an alternate solution.

    Thank you for your time.

     

    Last edit: Lee23 2022-02-10
  • i-campbell

    i-campbell - 2022-02-11

    hi, welcome to codesys and the industry.

    ONS is a particular manufacturer's name for it. In IEC 61131-3, and so CODESYS, its equivelant is yes the R_TRIG. In this case, when the Powerflow on the left changes from false to true, Powerflow on the right is true for one scan.

    There are some things in the standard and in CODESYS, which I could not find in the online help.

    VariableA VariableB VariableC
    --||--------|P|-------()
    

    The "Contact with positive edge detection", |P|, detects false to true transitions of VariableB. So you can see, this is slightly different to the R_TRIG.

     

Log in to post a comment.