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

Left / right buttons function

2022-07-27
2022-07-28
  • edwin200000

    edwin200000 - 2022-07-27

    Good afternoon,

    I have codesys 2.3 and HY-TTC94 PLC. I have a hard time with this problem.
    I have tried so much things but it didn't work. I hope I can explain it well.
    I want that if I push a button some outputs go on(stand left) and if I push another button (stand right) some outputs go off and some outputs go on and If i push another time at the button it goes back to the first stand and every output of stand right is off. but here is the thing: I have also a display where you can control outputs individual. If I turn off all outputs on the display. and pushes again on the button then everything goes to stand links. and somehow he will turn on all outputs of position left and right.
    How could that be. I will show you some pictures.

    I don't know what I am doing wrong? maybe cause I use XOR box to control the actual outputs.
    but I wouldn't know how else you can control an output from two inputs.

    I hope I explained it well. Thanks for help in advance.

    Edwin

     
  • h-hermsen

    h-hermsen - 2022-07-27

    why dont you use some RS or SR flip flops and latch the outputs?

     
  • edwin200000

    edwin200000 - 2022-07-28

    Goodmorging or goedemorgen H-Hermsen,

    Thanks for your answer. I have used RS box before but got the same problem that when I set the outputs off on the dispay and press the button(Knop_1_)then stand_left and stand_right is on. And I will try this morning to latch the outputs maybe it will work. Good suggestion. I will let you know if it works.

    Edwin

     
    • h-hermsen

      h-hermsen - 2022-07-28
      • I tried to understand your coding problem but I think I dont understand that what you are trying to achieve.

      However, maybe understanding the issue isn't perse needed since usually triggers involve flip flop solutions.

      In worst case you can use some kind of state machine to achieve your goal (since in fact it is a state driven problem) but If you implemnt this, use SFC or Structured text and definitly do not use LD or FBD/CFC to implement it.

       

      Last edit: h-hermsen 2022-07-28
  • edwin200000

    edwin200000 - 2022-07-28

    I didn't work unfortunatelly. I tried also some different things but it didn't work. So I am gonna make a state machine programm. Hopefully then it will work. Thanks for the suggestion.

    Edwin

     

Log in to post a comment.