Solved Logging a String
-
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 -
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
-
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.htmlCheers
Jan -
Thank you Jan
-
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
-
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
-
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. -
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.
Cheers
Mike
-
You're welcome, Mike.
The Python block must be checked when installing Rexygen Studio (it is not part of the default installation).
Cheers
Jan -
Oh I see, that’s an easy fix.
Thanks Jan