Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

toggel

bilecik11
2013-09-06
2013-09-10
  • bilecik11 - 2013-09-06

    ich hab mal eine Frage: wie projektiere ich ein toggle (FUB oder KOP )bit unter codesys 2.3 SetTag setzt je 'nur' auf 1 bzw 0... aber ich möchte gerne ein und den selben button zum ein- & ausschalten benutzen. Kann mir da jemand helfen???

     
  • Schuero - 2013-09-06

    Moin.

    Für sowas eigent sich total gut "ST". Das kannst duso proggen wie du sprichst.

    Wenn Toggel Eins ist , dann mach Toggel Null.

    in ST

    if(Toggle = TRUE) then
    Toggle = FALSE;
    else
    Toggle = TRUE;
    end_if

    so, diese Funktion rufst du dann immer einmal auf, wenn du ein Button drückst.

    Gruß Schuero

     
  • Anonymous - 2013-09-09

    Originally created by: jl

    Oder:

    R_TRIGButton(CLK:= button , Q=> );

    IF R_TRIGButton.Q then
    Toggle := NOT Toggle;
    end_if

     
  • Erik Böhm - 2013-09-10

    Oder direkt im Button die Variable bei Toggle eintragen.

     

Log in to post a comment.