Help witch formula

Forum Home Forums Understanding the Software Using Formulas Help witch formula

Viewing 15 posts - 16 through 30 (of 38 total)
  • Author
    Posts
  • #7202
    hethongscada62
    Participant

    Dear Mr. Mikhail.
    Thank you for your fast reply.
    I will use Elastic Report plugin and Chat plugin but after completely creating the project.
    I am trying to use the formula that was suggested by you. But i can not type full formula on column “Formula” of the “Input Table”. No longer more 1 raw. You can see it bellowing
    https://ibb.co/ZH7rfjD
    Sorry i am not IT programmer so could you let me know Why? How will i do?
    Thanks and best regards
    Han Hoang

    #7203
    hethongscada62
    Participant

    Dear Mr.Mikhail,
    I can type the formula into column “Edit Source Code” of “Formula Table”.
    You can see it following:
    https://ibb.co/hdSyQn3
    But into column “Formula” of “Input Channel” Table i can NOT type it. What will i have to configure in “Input Channel” table of rapid Scada?
    Thank You again.
    Han Hoang

    #7204
    Krzysztof
    Participant

    For screen https://ibb.co/hdSyQn3
    In the “Name” column, enter GetDif, in the “Source” column, type the formula exactly as Mikhail wrote without entries 133 and 134

    For screen https://ibb.co/ZH7rfjD
    Enter GetDif (133, 134)

    #7205
    hethongscada62
    Participant

    Dear Mr(?) Krzysztof,
    Thank you for your reply.
    I done step by step likes you suggested, but i have not got any result.
    Type the formula exactly as Mikhail without entries 133 and 134
    https://ibb.co/gDWgmbz
    After Uploading to server. Server stop work. Check the Stats, some wrong was here
    https://ibb.co/bK24hnv
    https://ibb.co/bLKC7Ls
    Could you tell me WHERE WILL I HAVE TO WRITE THE FORMULA? In the column “Formula” of the “Input channel_Device”??? or in the column “Source Code” of “FORMULA” table???
    Thank you again
    Han Hoang

    #7206
    Mikhail
    Moderator

    You did right. The formula has a mistake, sorry. Add to the method:

      return newVal;
    }

    This formula was not tested, because testing formulas is a part of Extended support service, not free support.

    #7208
    hethongscada62
    Participant

    Dear Mr.Mikhail,
    When the following formula was wrote to “Formula” table:
    “double GetDif(int srcCnl, int difCnlNum)
    { double newVal = Val(srcCnl); double curVal = Val(); SetVal(difCnlNum, newVal – curVal); SetVal(CnlNum, newVal); return newVal;
    }
    I restart server, server is running. That means the formula is OK, isn’t?
    But when to write it to column “Formula” of “input channel-device”, i can not write longer than 01 raw. Maybe the formula is too long, isn’t?
    I need this formula for my demo project, so pls let me know the fee if you can not help on this forum.
    Thanks and best regards
    Han Hoang

    #7209
    Krzysztof
    Participant

    In the Input Channel table “in the Formula” column you should enter GetDif(133, 134) where 133 is the source channel number, 134 is the channel number with the formula result.
    If you get an error, check the server log.

    best regards
    Krzysztof (Chris) and I’m a boy 🙂 from Polad

    #7210
    Krzysztof
    Participant

    Poland 🙂

    #7212
    hethongscada62
    Participant

    Dear Krzysztof,
    I am a man, from VietNam. Very nice to know You on this forum.
    With your help i entered GetDif(133, 135) into the column “Formula” of Input Channel-Device. Where the 133 is input source channel (The consumption energy); The 135 channel of cause is difference.
    https://ibb.co/SrBGGwz
    Restart a server. The server is running well. But the difference i have not got. The value (5,634.90) in the 135 is the same (5,634.90) as source value in the 133. The result is bellowing:
    https://ibb.co/qpX7g21
    Where is the wrong?
    Pls tell me
    Thanks and best regards
    Han Hoang

    #7213
    Krzysztof
    Participant

    Channel 135 is a channel where you store the value from channel 133 every hour, best name it Energy6 – Hourly or something similar.
    Set channel 136 as Calculated real. The difference is stored in this channel. No formula should be entered in this channel, unless the result needs to be scaled e.g. Cnl/10
    NOTE: before the first cycle, chanel 136 will be 133, only after the next hour there will be a difference. This will happen every time you restart the server. For report purposes, the Elastic Report is a better solution, unless you don’t care about the report, but only about showing the difference.

    #7214
    hethongscada62
    Participant

    Dear Krzysztof,
    Thank you for your fast reply. I will do what you suggested tomorrow. I will inform to you a result.
    Thanks again
    Han Hoang

    #7215
    hethongscada62
    Participant

    Good Morning Krzysztof,
    The formula was tested last night, but i have not got the result.
    https://ibb.co/vmmQxWc
    Something is wrong? Where?
    The best

    #7216
    Mikhail
    Moderator

    Hello,

    – Change the name of channel 135 to “Previous value”. It’s for understanding
    – Change the formula of channel 135 to GetDif(133, 136)
    – Channel 136 should have the Calculated real type and has no formula of this channel.

    #7217
    Mikhail
    Moderator

    To get the result you need to wait an hour. So I suggest change the channel type from Hourly real to Minute real.

    #7219
    Krzysztof
    Participant

    Han, your power consumption is too low to see GetDif (133, 136) working with the Minete Real channel setup, but I assure you, with the Hourly setup it will work. I didn’t notice that you had a wrong entry. I tested it on my installation and it works fine.

Viewing 15 posts - 16 through 30 (of 38 total)
  • You must be logged in to reply to this topic.