Showing results 1 to 5 of 5

Thread: Script error at runtime

  1. #1
    Join Date
    26.02.2021
    Posts
    25

    Frage Script error at runtime

    Hi eveyone,

    I have a problem with a script at runtime. Zenon 8.20

    1- I created two functions to Start/Stop the Historian files recording, and one more function to export a report from a .RDL file.
    2- I created two scripts to excute this functions with a trigger of two boolean variables.
                                   I thought this was pretty basic and stright forward stuff, but I'm having troubles when I try to simulate at runtime.

    With the scripts on my project, the runtime gets stuck, not even opening a screen. I delete the scripts, and everything get back to normal. I checked the runtime files to find out what was the problem but I don't undertand where is the problem here. I pasted here the runtime files, first one with last time I tried with the scripts on (runtime stuck), and the second one, once I deleted the scripts (runtime fine). I got no clue what's the matter.

    I read about more people having troubles with scripts at runtime, but I haven't seen which are the most common errors or ways to solve them.

    Thank you 

    *** Create changed Runtime files for project: "SURDRY_V0" - Runtime folder: "C:\Users\Surdry\Desktop\BackUp1\SURDRY_V0\SURDRY_V 0"
    scripts.cmp
    password.cmp File will not be overwritten!
    \data.rgm File will not be overwritten!
    \Grupo de recetas AC1\data.rgp File will not be overwritten!
    \Grupo de recetas AC1\Recipe 0.rcp File will not be overwritten!
    \Grupo de recetas AC1\versions.rgp File will not be overwritten!
    *** 1 Runtime file(s) of the project "SURDRY_V0" were created in the Runtime folder.

    *** Create changed Runtime files for project: "SURDRY_V0" - Runtime folder: "C:\Users\Surdry\Desktop\BackUp1\SURDRY_V0\SURDRY_V 0"
    password.cmp File will not be overwritten!
    \data.rgm File will not be overwritten!
    \Grupo de recetas AC1\data.rgp File will not be overwritten!
    \Grupo de recetas AC1\Recipe 0.rcp File will not be overwritten!
    \Grupo de recetas AC1\versions.rgp File will not be overwritten!
    *** 0 Runtime file(s) of the project "SURDRY_V0" were created in the Runtime folder.



  2. #2
    Join Date
    01.07.2008
    Location
    Salzburg, AT
    Posts
    995

    Default Re: Script error at runtime

    Do the stop, export and start (or trigging those BOOL vars, i'm not sure what is your concept) are working like expected if you execute the functions NOT by script, but e.g. via buttons in a screen? And also if you click very fast?

  3. #3
    Join Date
    01.07.2008
    Location
    Salzburg, AT
    Posts
    995

    Default Re: Script error at runtime

    and maybe you are causing some recursive function call, e.g. when the function starting historian is linked in the historian as function to be executed when historian starts...

  4. #4
    Join Date
    26.02.2021
    Posts
    25

    Default Re: Script error at runtime

    Yes, the functions were working fine externally, by itself as a function trigger by buttons. 
    I tried them firts by themselves and then I grouped them in two different scripts.
    That was giving me some headaches, so I realized I could delete the scripts and trigger the functions with booleans limits. I'm still trying to make it work. 
    Apparently, when I set the "Achive:Start" and "Archive:Stop" in two different boolean variables, there is some kind of trouble at the runtime.
    I changed the functions to be triggered by the same bool variable at rising ans falling edges and seems to be working fine.

    Now I have to add the "Report Viewer: export/print" Function to be triggered at the same time than the "Archive:Stop" function. I'm assuming I can do that by adding another limit to the same bollean configued in the same way, otherwise my understanding says that I would have to create a Script with those to functions. (Probably back to headaches...)

    Another thing I'm concern about is that, I can set start/stop functions for the historian data to be read, but when I set the report to be "printed/saved" I can't make it work in the same way, where it goes to collect the data since the "Historian start function" is triggered, there is just a timing filter, which drive me to have to stimate the lenght of my cicle. 

    And one last thing is that I'm having troubles with the PDFs my report is creating because it generates a bunch of blanck pages.

    Thank you for any help.

  5. #5
    Join Date
    01.07.2008
    Location
    Salzburg, AT
    Posts
    995

    Default Re: Script error at runtime

    To start and stop the historian by limit of a variable is probably the simplest and well working solution. 

    For export, hmm, the historian has to stop (and this can take some time, depending the size, quantity of files in the directory, HDD access speed etc.), then, so after some delay, export. My proposal: link in this historian to the property for 'end function' a set value function for additional (another) BOOL variable. By this variable make a limit with delay 5(?)s to trigger the export.

Similar Threads

  1. Replies: 2
    Last Post: 19th May 2018, 06:19
  2. Zenon Runtime error
    By azami in forum zenon Network
    Replies: 6
    Last Post: 23rd February 2018, 08:11
  3. Runtime Error
    By sidramsatyal in forum zenon Service Engine Supervisor
    Replies: 1
    Last Post: 21st November 2013, 13:40
  4. Runtime error
    By ansab.tp in forum zenon Service Engine Supervisor
    Replies: 8
    Last Post: 30th January 2013, 11:11
  5. Runtime Error
    By shikra in forum zenon Energy Edition
    Replies: 2
    Last Post: 10th April 2011, 16:25

Posting Rules

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