• Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Control RO with Direct switch by Mervis

    Mervis
    4
    7
    1929
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      Martin Trojan last edited by

      I have controled light on RO, it is connected with wall button with DirectSwitch functionality. I want control RO from Mervis as well but it does not work. How can I do it?

      T 1 Reply Last reply Reply Quote 0
      • T
        tomas_hora administrators @Martin Trojan last edited by

        @martin-trojan Please check DirectSwitch_force from the Lib.UniPi

        1 Reply Last reply Reply Quote 0
        • M
          Martin Trojan last edited by Martin Trojan

          Hello, it works.

          I want control light from web(digital setter) and HW button with direct switch. But I dont know how to create this funcionality. My solution blinking the lights and I am succesfull to turn on/off lights after 2-3 attempts. Can someone help me?
          0_1544094512713_5589bcc5-93ec-4c37-9307-9b844843483e-image.png

          0_1544103765654_f418b52f-e269-493c-91ee-f9f135940f06-image.png

          1 Reply Last reply Reply Quote 0
          • M
            Martin Trojan last edited by

            Can @tomas_hora recommend how to setup web button when it is swithed by hw button to match the current state of light and not swich at the same time?

            Martin Kudláček 1 Reply Last reply Reply Quote 0
            • Martin Kudláček
              Martin Kudláček administrators @Martin Trojan last edited by

              Hello @martin-trojan, this isn't as easy as it looks like. We are preparing a solution as we speak and we will get back to you as soon as possible.

              Thanks for your patience,
              Martin

              1 Reply Last reply Reply Quote 0
              • M
                Martin Trojan last edited by

                @Martin-Kudláček any progress?

                1 Reply Last reply Reply Quote 0
                • T
                  TomasKnot last edited by TomasKnot

                  Hi @Martin-Trojan,

                  This is just one possible solution, but you can use a custom ST FunctionBlock with this code (use the name "DigitalMemoryMultiplexer" if you do use it):

                  FUNCTION_BLOCK DigitalMemoryMultiplexer
                  (*
                  EXTENDS //base type
                  IMPLEMENTS //interface type list
                  *)
                  	VAR
                  		previous_inp_1: BOOL;
                  		previous_inp_2: BOOL;
                  		previous_outp: BOOL;
                  	END_VAR
                  	VAR_INPUT
                  		inp1: BOOL;
                  		inp2: BOOL;
                  	END_VAR
                  	VAR_OUTPUT
                  		outp: BOOL;
                  	END_VAR
                  	INIT
                  		previous_inp_1 := inp1;
                  		previous_inp_2 := inp2;
                  		previous_outp := inp1;
                  	END_INIT
                  
                  
                  	IF inp1 <> previous_inp_1 THEN
                  		outp := inp1;
                  		previous_inp_1 := inp1;
                  	ELSIF inp2 <> previous_inp_2 THEN
                  		outp := inp2;
                  		previous_inp_2 := inp2;
                  	ELSE
                  		outp := previous_outp;
                  	END_IF;
                  	
                  	previous_outp := outp;
                  END_FUNCTION_BLOCK
                  

                  And connect it like this:
                  alt text

                  The DO_2_01 is set as DirectSwitch Trigger and the WEB_LIGHT_BUTTON is tied to a HMI Digital Setter. Whenever you are using DirectSwitch remember to set the Debounce value on the DI sufficiently high for your input device.

                  Again, there are many other options for doing this, including using two HMI elements on top of each other (Digital Indicator and Digital Setter).

                  Here is the project file, for reference: https://www.mediafire.com/file/1o8kq9iici2qc8g/ForumProject.7z/file

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post