Showing results 1 to 9 of 9

Thread: Report Generator - Write value to hardware

  1. #1

    Default Report Generator - Write value to hardware

    Hi.
    I want to use the max, min result in report generator to write value to internal variables. I have read help file that has function for this purpose
    Write value to variable

    To write a value from the Report Generator to a variable, enter the variable name, the "value" property and the cell that contains the value to:

    =variablerw(variable name,"value",cell)

    I tried to use it but unsuccessful . Please guide me how it work.

    Brgds


  2. #2
    Join Date
    25.06.2012
    Posts
    155

    Default Re: Report Generator - Write value to hardware

    Hi mytom,

    Thank you very much for your post.

    In fact the variablerw syntax should be as: =variablerw("target_variable", "value", ACTUALVALUE)

    Please note to write a value to a variable using the variablerw the report must be executed, not only displayed. For that, you can use the screen specific functions "Write all values" or "Write selected values or the zenon function "Report Generator: execute".

    It is also very important to notice that writing to reports it is only possible if the "Reporting: Report Generator and Report Viewer" module is licensed.

    I strongly suggest to read the help topics:
    Manual > Reporting > Report Generator > Engineering in the Editor > zenon functions for Report Generator > Report Generator: execute

    For demonstration purposes only, I attached a sample v8.00 project to this message. It is very friendly and easy to use.

    Good luck,
    David Cerdeira

    Attached Files Attached Files

  3. #3
    Join Date
    17.02.2020
    Posts
    18

    Default Re: Report Generator - Write value to hardware

    Quote Originally Posted by david.cerdeira View Post
    Hi mytom,

    Thank you very much for your post.

    In fact the variablerw syntax should be as: =variablerw("target_variable", "value", ACTUALVALUE)

    Please note to write a value to a variable using the variablerw the report must be executed, not only displayed. For that, you can use the screen specific functions "Write all values" or "Write selected values or the zenon function "Report Generator: execute".

    It is also very important to notice that writing to reports it is only possible if the "Reporting: Report Generator and Report Viewer" module is licensed.

    I strongly suggest to read the help topics:
    Manual > Reporting > Report Generator > Engineering in the Editor > zenon functions for Report Generator > Report Generator: execute

    For demonstration purposes only, I attached a sample v8.00 project to this message. It is very friendly and easy to use.

    Good luck,
    David Cerdeira

    Thanks for the useful explanaition, David.

    I used the "Report Generator: execute" function and am controlling it with a "Time Control Function" and it is working normally. However, I was wondering If it is possible to excute certain parts of the Report Generator writing functions only, instead of excuting the whole Report Generator. The goal is to automatically excute a single "Variablerw" function only (using time control for example), in order to reduce the load on my server as much as possible. 

  4. #4
    Join Date
    28.02.2013
    Posts
    207

    Default Re: Report Generator - Write value to hardware

    Dear Anas,

    if you only want to write a single variable why not using a simple SetValue function?

    What is the use case you are targeting?

    Regards,
    Felix

  5. #5
    Join Date
    17.02.2020
    Posts
    18

    Default Re: Report Generator - Write value to hardware

    Quote Originally Posted by felixst View Post
    Dear Anas,

    if you only want to write a single variable why not using a simple SetValue function?

    What is the use case you are targeting?

    Regards,
    Felix


    Thanks Felix.
    The Use case:
    calculating the daily energy production from the total energy production value. (I know that the VACO function in Zenon Logic can do the job, but since I have to archive the values before using them anyway I opted to doing it manually. The Runtime sometimes freezes and we lose the internal variable values, in addition to the fact that Zenon Logic functionality is lost during the Freeze/Restart period)

    The method:
    1- Archiving a certain variable once every day.
    2- Importing said archive in Report Generator in column A.
    3- Finding the maximum value in Column A and writing this value to an internal variable once per day.
    4- Utilizing said internal variable throughout the day in other calculations.

    Is it possible to use the Setvalue function in this context?

  6. #6
    Join Date
    28.02.2013
    Posts
    207

    Default Re: Report Generator - Write value to hardware

    Dear Anas,

    thanks for your explanation.
    No in that case SetValue will not offer a solution as it cannot access archived variables.

    Regards,
    Felix

  7. #7
    Join Date
    17.02.2020
    Posts
    18

    Default Re: Report Generator - Write value to hardware

    Quote Originally Posted by felixst View Post
    Dear Anas,

    thanks for your explanation.
    No in that case SetValue will not offer a solution as it cannot access archived variables.

    Regards,
    Felix

    Hello Felix,
    You are welcome.
    I am using the method I mentioned above, but I am facing a problem. When the Runtime stops and starts again, I am forced to run the "Report Generator: excute" function manually (in order to start the Variablerw functions inside the Report Generator.)
    To solve this, I created an AUTOSTART script and added the "Report Generator: excute" function in it. The intention is to make this function start automatically when Runtime starts. However this is not happening, the function does not start automatically when the Runtime starts, and I am forced to start the function manually. 
    What could be the problem? 

  8. #8
    Join Date
    28.02.2013
    Posts
    207

    Default Re: Report Generator - Write value to hardware

    Dear Anas,

    is it a network project?
    Did you try to use AUTOSTART_SRVPRJ?

    Regardsm
    Felix

  9. #9
    Join Date
    17.02.2020
    Posts
    18

    Default Re: Report Generator - Write value to hardware

    hi Felix,

    It is a regular project. I solved the problem though.
    The problem was with the Time Filter of the Report Generator. by default this filter is set to 1 hour as a Relative time filter. I have already changed that to 2 days in the related Report Generator Screen, However, the time filter of the Report Generator itself kept the default time filter settings.
    That's why I was able to run the Variablerw functions from within the Report Generator Screen itself. However, the "Report Generator: excute" function, which I assume to be connected to the Report Generator itself rather than the Report Generator Screen, had a "0x06" instead of the actual variable values from the designated archive (which happened to lie outside the relative time filter period.) This in turn led me to believe that the "Report Generator: excute" Function wasn't running with the other functions under the AUTOSTART script.  

Similar Threads

  1. Report generator
    By mariustitulescu in forum zenon Supervisor
    Replies: 1
    Last Post: 5th October 2015, 08:30
  2. Report Generator
    By navaneet in forum zenon Supervisor
    Replies: 3
    Last Post: 12th June 2013, 23:34
  3. Replies: 9
    Last Post: 20th April 2011, 18:30
  4. Report generator
    By sldewit in forum zenon Supervisor
    Replies: 1
    Last Post: 30th March 2011, 00:11
  5. Report Generator
    By rolindo in forum zenon Supervisor
    Replies: 1
    Last Post: 21st November 2009, 23:50

Posting Rules

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •