Page 1 of 2 1 2 LastLast
Showing results 1 to 10 of 15

Thread: Configuration of Alarm in Zenon Editor

  1. #1
    bmcbrita Gast

    Default Configuration of Alarm in Zenon Editor

    Hi,

    I have a small problem with the configuration of one of the alarms coming from one of the machines linked to our data collection system.
    The alarm is called "Machine in Standby" (internal variable: S0.M85.4), because we have 5programs that we run on the machine so we want to track downtime information with different program numbers.
    I have written a program using Case statements that IF program number 2 is running send the value of S0.M85.4 to "varOut1" ELSE when program 4 is running send the value of S0.M85.4 to "varOut2".

    For example currently we are running program 2. When we change the program to go from one product to another product, the machine is in standby mode, which means their is a recieved time for varOut1 in the alarm list. And as soon as we change the other program the machine shows recieved time for "varOut2".

    The problem here is because the varOut1 is left without any cleared time information so it shows me NEGATIVE duration of time in IPA.

    This can be resolved by adding few command lines in the VBA code saying , SET "Cleared_time" = "System time" for "varOut1" when program is changed from 2 to 4.

    Could any one please help me in writing this statement which assigns the "Time_Cleared" field as "System_time" when a program is changed on the machine.

    I Have also attached the VBA code that I wrote for this program, if you could please check and tell me what statement would I have to write to set the clear time as system time whenever the program number is changed on the machine.

    Thanks.
    Attached Files Attached Files

  2. #2
    Join Date
    30.05.2007
    Location
    Salzburg
    Posts
    879

    Default Re: Configuration of Alarm in Zenon Editor

    As far as I've understood your question you want to write the local system time to a variable? Correct?
    -> if so you can use the Now() function

    Debug.Print Now

    If you want to have the time in a special format you can also combine this with the format function

    Debug.Print Format(Now(), "yyyy-mm-dd hh-mm-ss")

  3. #3

    Default Re: Configuration of Alarm in Zenon Editor

    Hello,

    basically the "Time_cleared" is not able to set from "outside" in order to follow the FDA specification, which is fulfiled by zenon.

    The "Time_cleared", with an alarm, is set from zenon, and no one else, as soon as the alarm situation is gone, means that a value changes to something not in alarm range. As I understand your description the values changes only to a new alarm.

    It is quite hard to follow your description, anything more understandable would be apprecitated very much, a schema rather than code would be sufficient.

    lg,
    wolfgang

  4. #4
    bmcbrita Gast

    Default Re: Configuration of Alarm in Zenon Editor

    Hi,

    Thanks for the reply.

    Basically I am looking for information coming from a signal, because I have 5 program numbers on the machine I want to look at downtime caused by all 5 different programs.

    The program number can only be changed when machine is in standby.

    For example, if program number 2 is running and I stop the machine, an alarm would be raised giving "Recieved time" in "Alarm List" (for outputvariable1).

    And when i change the program number to 4 the machine raises another alarm giving "Recieved Time" in "Alarm List" (for outputvariable2).

    Because now the program number is changed so "outputvariable1" has no "cleared time" in "Alarm List" and therefore it still stays active. The only time it will clear itself is when i change the program number back to 2 and start the machine.

    So the solution I thought was to write a statement saying when program is changed from 2 to 4, give the value of "System Time" to "Clear time" (in Alarm List) so that the alarm is not active.

    I required your guidance in writing this statement.

    Your help would be much appreciated.

    Thanks.

  5. #5

    Default Re: Configuration of Alarm in Zenon Editor

    thanks for the details. If I understand correctly, you would like one operations counter, which counts the downtime, for a total of 5 programs.

    If there is a variable for "standby" you could just use this variable for a total downtime regardless of the program. In addition, you could use a variable of the mathematics driver where the output is 1 when "program > 0" AND "standby=0". You could again count the output of this mathematics variable with another mathematics variable (COUNT(X01) from the statistics group)

    Would it be a problem for your PLC program, if all but the current program output variable would be set to "0"? If not, at activating e.g. program three, you could activate the outputvariable for program three and deactivate all other output variables. In IPA you would have the active time for each program. If in addition the "standby" variable should also be included, please include two mathematics variable, and use the mathematics variable in IPA instead.

    Hope this helps?

    Kind regards

  6. #6
    bmcbrita Gast

    Default Re: Configuration of Alarm in Zenon Editor

    Thanks for your reply.

    I think your way of configuring will work but it means that deactiviting the other outputvariables will be a manual operation that would be done manually using the Z-Editor every time when a program is changed.

    The vba code I have written works perfectly fine and it does output the variables in correct manner but my problem is that when a program is changed on the machine the "standby" alarm for the previous program is still active and the next "standby" alarm for next program starts running.

    All i want is the previous program's alarm to clear as soon as the next program is changed.

    If this doesn't make sense I can upload few screen shots for you to look at.

    Thanks.

  7. #7
    bmcbrita Gast

    Default Re: Configuration of Alarm in Zenon Editor

    Sorry I understood you wrong please the first paragraph of my previous post.

    The vba code I have written works perfectly fine and it does output the variables in correct manner but my problem is that when a program is changed on the machine the "standby" alarm for the previous program is still active and the next "standby" alarm for next program starts running.

    All i want is the previous program's alarm to clear as soon as the next program is changed.

    If this doesn't make sense I can upload few screen shots for you to look at.

    Thanks.

  8. #8

    Default Re: Configuration of Alarm in Zenon Editor

    Maybe I should have been a little more clearere. What I meant was, that when e.g. program "2" is chosen, you reset all other outputvariables (send the value "0") for the other programs. This can be configured, and during runtime would not require the zenon editor.

    Just create for each program a small recipe with all OTHER outputvariables, where you send the value "0". When e.g. program "2" becomes active, you execute the recipe and all output variables are reset, and the alarms are reset as well.

    Or maybe I still don't understand what your problem exactly is?

  9. #9

    Default Re: Configuration of Alarm in Zenon Editor

    Hello

    For example, if program number 2 is running and I stop the machine, an alarm would be raised giving "Recieved time" in "Alarm List" (for outputvariable1).

    And when i change the program number to 4 the machine raises another alarm giving "Recieved Time" in "Alarm List" (for outputvariable2).

    Because now the program number is changed so "outputvariable1" has no "cleared time" in "Alarm List" and therefore it still stays active. The only time it will clear itself is when i change the program number back to 2 and start the machine.

    So the solution I thought was to write a statement saying when program is changed from 2 to 4, give the value of "System Time" to "Clear time" (in Alarm List) so that the alarm is not active.
    Instead of setting the "Clear time" of the alarm through VBA, why not set the value of the variable to something not in alarm state. In this case zenon sets the "Clear time" on its own. The setting of a value on a certain variable can also been done in your VBA code easily.

  10. #10
    bmcbrita Gast

    Default Re: Configuration of Alarm in Zenon Editor

    @Mark Clemens:
    The things you have mentioned in your reply have been already done and that works fine, if you look at the VBA code file I have attached in my first post.

    The problem is:
    Suppose program running on machine is 2.
    When the program is changed on the machine, the machine is in standby, so that means the alarm is active in Zenon runtime in Alarm list showing the recieved time of the variable.

    Now when program is changed on the machine to 4, another alarm is active in Alarm list showing recieved time. This means the alarm from program 2 is NOT cleared yet so there is no clear time in Alarm list for program 2's variable.

    I want to resolve this issue so that Program 2's variable gets a recieved time as soon as program 4 is active.

    I hope this helps.

    @ Wolfgangm:

    I think you have understood the problem correctly.

    From your reply I understand that you are saying, set a value to that varibale through VBA code.
    If I am not Wrong I would have to write something like:
    When program is changed from 2 --> 4 then set the value of varOut1 = 1 and then Zenon would set the clear time itself.

    Because I tried to do something like this and I think the code was not quite right so it did not function.

    Regards.

Similar Threads

  1. Replies: 5
    Last Post: 30th July 2018, 10:45
  2. SQL Database and Zenon Editor
    By bmcbrita in forum zenon Supervisor
    Replies: 4
    Last Post: 2nd August 2009, 22:24
  3. How to draw mimics in zenon Editor
    By nahala in forum zenon Supervisor
    Replies: 4
    Last Post: 27th April 2009, 08:31
  4. can't create new project in zenon editor
    By shahramkh59 in forum zenon Supervisor
    Replies: 3
    Last Post: 15th April 2009, 07:12
  5. Replies: 0
    Last Post: 20th August 2007, 17:04

Posting Rules

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