Forum Home › Forums › Understanding the Software › Using Formulas › Help witch formula
- This topic has 37 replies, 5 voices, and was last updated 3 years, 6 months ago by Mikhail.
-
AuthorPosts
-
August 28, 2020 at 2:27 am #7202hethongscada62Participant
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 HoangAugust 28, 2020 at 3:14 am #7203hethongscada62ParticipantDear 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 HoangAugust 28, 2020 at 6:08 am #7204KrzysztofParticipantFor 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 134For screen https://ibb.co/ZH7rfjD
Enter GetDif (133, 134)August 28, 2020 at 9:45 am #7205hethongscada62ParticipantDear 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 HoangAugust 28, 2020 at 4:08 pm #7206MikhailModeratorYou 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.
August 29, 2020 at 8:08 am #7208hethongscada62ParticipantDear 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 HoangAugust 29, 2020 at 8:50 am #7209KrzysztofParticipantIn 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 PoladAugust 29, 2020 at 8:50 am #7210KrzysztofParticipantPoland 🙂
August 29, 2020 at 12:34 pm #7212hethongscada62ParticipantDear 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 HoangAugust 29, 2020 at 1:53 pm #7213KrzysztofParticipantChannel 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.August 29, 2020 at 3:00 pm #7214hethongscada62ParticipantDear Krzysztof,
Thank you for your fast reply. I will do what you suggested tomorrow. I will inform to you a result.
Thanks again
Han HoangAugust 29, 2020 at 11:43 pm #7215hethongscada62ParticipantGood Morning Krzysztof,
The formula was tested last night, but i have not got the result.
https://ibb.co/vmmQxWc
Something is wrong? Where?
The bestAugust 30, 2020 at 6:06 am #7216MikhailModeratorHello,
– 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.August 30, 2020 at 6:07 am #7217MikhailModeratorTo get the result you need to wait an hour. So I suggest change the channel type from Hourly real to Minute real.
August 30, 2020 at 7:35 am #7219KrzysztofParticipantHan, 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.
-
AuthorPosts
- You must be logged in to reply to this topic.