REXYGEN Community Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Login

    Javascript

    REXYGEN HMI Designer
    3
    12
    990
    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
      martijnperdaan
      last edited by

      is it possible that I write my own page in PHP and JavaScript and can control everything? if so what javascript code do I use to turn on a lamp

      1 Reply Last reply Reply Quote 0
      • jaroslav_sobotaJ
        jaroslav_sobota
        last edited by

        Hi Martijn,
        have a look at example 0201-22. It contains the files custom-hmi-example.hmi.html and custom-hmi-example.hmi.js. That way you can generate HMI with arbitrary content.

        Example 0301-20 also contains a custom HMI. This one is based on REST API of REXYGEN.

        You can also read the documentation of REXYGEN HMI. Especially Chapter 5 will help if you want your very own HMI page.

        Hope this helps, let me know.

        Best regards
        Jaroslav

        1 Reply Last reply Reply Quote 0
        • M
          martijnperdaan
          last edited by

          @jaroslav_sobota said in Javascript:

          Example 0301-20

          Example 0301-20 is a good example, but with what piece of script I can switch a lamp on and off with a button

          1 Reply Last reply Reply Quote 0
          • jaroslav_sobotaJ
            jaroslav_sobota
            last edited by

            Hi Martijn,
            there is no code to switch a lamp on or off directly from HMI. In REXYGEN HMI, you always control parameters of the function blocks in your running algorithm. These may result in switching the lamp on or off, depending on how your blocks are connected.

            0_1584621730920_rexygen-hmi-constants.png

            This basic principle is the same regardless of what HMI you build. Even if you build your very own HMI page, you'll use functions to write parameter values to function blocks. And possibly also to read their inputs and outputs.

            Hope this helps, let me know.

            Jaroslav

            M 1 Reply Last reply Reply Quote 0
            • M
              martijnperdaan @jaroslav_sobota
              last edited by

              @jaroslav_sobota
              can you also show me the javascript code you used for that button and Spider?

              cechuratC 1 Reply Last reply Reply Quote 0
              • M
                martijnperdaan
                last edited by

                I want to make it like this (see link) and then in every red box you can turn on and dim another light

                https://www.perdaanelectronics.nl/testJeroen.php

                jaroslav_sobotaJ 1 Reply Last reply Reply Quote 0
                • cechuratC
                  cechurat @martijnperdaan
                  last edited by cechurat

                  @martijnperdaan
                  Hi Martijn,
                  the switch and slider are standard components of REXYGEN HMI Designer - there is no need for any additional custom javascript.

                  Please, go through Chapter 3 of REXYGEN HMI documentation. Once you run into any troubles let me know and I will try to guide you.

                  Regards, Tomas

                  1 Reply Last reply Reply Quote 0
                  • jaroslav_sobotaJ
                    jaroslav_sobota @martijnperdaan
                    last edited by

                    @martijnperdaan
                    Hi Martijn,
                    if you insist on building your very own HMI page, have a look at the example 0301-20 as I mentioned earlier. It contains also the Javascript code to read and write data from/to your running algorithm via REXYGEN REST API.

                    Best regards
                    Jaroslav

                    1 Reply Last reply Reply Quote 0
                    • M
                      martijnperdaan
                      last edited by

                      yes i have seen that and that is a nice example only can you help me a bit on how to use a slider and 3 switches and how the javascript code should look like from a REXYGEN REST API.

                      cechuratC 1 Reply Last reply Reply Quote 0
                      • cechuratC
                        cechurat @martijnperdaan
                        last edited by

                        @martijnperdaan
                        Hi Martijn,

                        if you send us all your project files (zipped project folder) and list of parameters controlled by slider/switch I will prepare the HMI svg sample file for you.

                        You can upload the project directly here to the forum or send via e-mail to support@rexygen.com

                        Regards, Tomas

                        1 Reply Last reply Reply Quote 0
                        • M
                          martijnperdaan
                          last edited by

                          ok but i don't need hmi svg sample just the javascript code to work the multiple sliders and switch with a REXYGEN REST API.

                          i want to do it through my own php page

                          1 Reply Last reply Reply Quote 0
                          • jaroslav_sobotaJ
                            jaroslav_sobota
                            last edited by

                            Hello Martijn,
                            here is an example with one CNR and 2 CNB constants which are controlled from web HMI via REST API: 0301-21_REST_API_Webpage_Javascript.zip

                            I believe that's all you need. Now it's on you to build upon this concept.

                            Btw, what is your motivation for building your very own HMI? From your questions I guess that using the HMI Designer and building the HMI without any hand coding would be much easier and more straightforward for you.

                            Let me know.

                            Jaroslav

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

                            This is a community forum for REXYGEN users and fans. Detailed information can be found at REXYGEN homepage.

                            There is also an outdated REXYGEN community forum.

                            Powered by NodeBB.