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

    Solved Logging a String

    REXYGEN Studio
    3
    11
    842
    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
      MikeyH
      last edited by

      Hi All,

      I'd like to log observation notes (text) written in a HMI text box. Can you log such an event to a TRND block so you can compare it to other events (temperatures etc) in your TRND or Archive?

      Cheers

      Mike

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

        Hi Mike,

        thank you for your question. It is possible to write string to Archives using function bloc called ARS - https://www.rexygen.com/doc/ENGLISH/MANUALS/BRef/ARS.html

        However it is quite challenging to read out the strings back from Archive to the running algorithm. I would suggest to write simple cyclic string buffer in REXLANG just for your purpose. Therefore you can easily compare the strings within running algorithm using String library function blocks (or equal functions embedded in REXLANG).

        Hope it helps.

        Kind regards
        Tomas

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

          Thank you Tomas,

          I will try that. I do not need to read the string back to the HMI. Just have it available in the archive CSV. The purpose is to put an observational comment against an event, parameter change etc. That way when looking at the archive data I can see a logged comment as to why and when I changed the parameter.

          I assume the HMI Input.svg is ok to use for text?

          Cheers

          Mike

          1 Reply Last reply Reply Quote 0
          • R
            reitinge
            last edited by reitinge

            Hi Mike,
            you are right, the HMI Input component can be used for text after changing format to text in the component Options.

            Documentation for Rexygen HMI can be found here:
            https://www.rexygen.com/doc/ENGLISH/MANUALS/RexHMI/RexHMI_ENG.html

            Cheers
            Jan

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

              Thank you Jan

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

                Hi Jan,

                When trying to use the ARS block and/or the MHI Input.svg I get the attached error. Download error.csv

                Cheers

                Mike

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

                  Update,

                  This seems of fixed itself! I have no issue using the ARS block or input.svg box now.

                  I know the ARS block only logs when "run" is set to on. How can I have the ARS block only log the input value of the input.svg once each time the input is changed. Currently once I enter a value it continuously logs it, I only want the value to appear in log/archive once at from time I entered it. Then log the next input once and so on.

                  Deleting the text from the HMI input.svg works but I wondered if there is a better way.

                  Cheers

                  Mike

                  1 Reply Last reply Reply Quote 0
                  • R
                    reitinge
                    last edited by

                    Hi Mike,
                    string change checking can be easily done in a Python block:
                    https://www.rexygen.com/doc/ENGLISH/MANUALS/BRef/PYTHON.html
                    You can compare the previous value of a string input with the current one, and if the values ​​differ, you can set the logical output to true and connect that output to the ARS:run input.

                    There is probably other solution with the String blocks:
                    https://www.rexygen.com/doc/ENGLISH/MANUALS/BRef/BRef_ENGch11.html
                    and Logic control blocks:
                    https://www.rexygen.com/doc/ENGLISH/MANUALS/BRef/BRef_ENGch8.html
                    but the solution using a Python block is easier for me personally.

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

                      Thank you Jan,

                      How do I gain access to the Python block? I have the latest version of REXYGEN but it does not show in my library.

                      27436544-c172-4a2d-a2a3-ea8817169204-image.png

                      Cheers

                      Mike

                      1 Reply Last reply Reply Quote 0
                      • R
                        reitinge
                        last edited by

                        You're welcome, Mike.
                        The Python block must be checked when installing Rexygen Studio (it is not part of the default installation).
                        Python_install.PNG

                        Cheers
                        Jan

                        M 1 Reply Last reply Reply Quote 0
                        • M
                          MikeyH @reitinge
                          last edited by

                          Oh I see, that’s an easy fix.

                          Thanks Jan

                          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.