Forum Home › Forums › Understanding the Software › Using Formulas › Help witch formula
- This topic has 37 replies, 5 voices, and was last updated 3 years, 7 months ago by Mikhail.
-
AuthorPosts
-
March 13, 2020 at 12:28 pm #6604KrzysztofParticipant
I need little help.
Cnl 1 real, possible values from 0 to 31
Cnl 2 calc discreteFormula 1
public double if_S_S(double in1,double in2,double in3)
{
if(in1>in2 && in1<in3)
{
return 0;
}
else
{
return 1;
}
}I put in Cnl 2 formula If_S_S(Val(1), 0, 16) when current Value of Cnl = 0
and I have error when I send to the server:The name “If_S_S” does not exist in the current context.
What is wrong ?
I tried with Formula 2
public double if_S(double in1)
{
if(in1>0 && in1<16)
{
return 0;
}
else
{
return 1;
}
}and I have the same error
March 13, 2020 at 2:00 pm #6606MikhailModeratorCould you make screenshots of formulas, channels and error?
March 13, 2020 at 2:54 pm #6609KrzysztofParticipanthmm, I don’t see my replay
March 13, 2020 at 3:07 pm #6611KrzysztofParticipantFormula
https://drive.google.com/open?id=1zUaBomMFXQrcGidyvxGruY4DvjA9rrlL
Chanel config
https://drive.google.com/open?id=13sTrm8towtqriEB8nv77E6FE8-s4ZEFk
Server message
https://drive.google.com/open?id=1ZXHOlk5K3gM7Qg_QF5U-w5ywZ8oSM5ci
Calc log
https://drive.google.com/open?id=1w7Um7WaWi5-J5Ep8jp_V76htfDlDiuI-- This reply was modified 4 years, 1 month ago by Krzysztof.
March 13, 2020 at 3:11 pm #6613March 16, 2020 at 6:27 am #6618MikhailModeratorPlease upload images without ZIP to make possible opening them in browser (not download).
March 19, 2020 at 12:25 pm #6610KrzysztofParticipantFormula
Chanel config
Server message
Calc log
March 19, 2020 at 12:25 pm #6608KrzysztofParticipantMarch 19, 2020 at 12:25 pm #6607KrzysztofParticipantMarch 26, 2020 at 5:21 pm #6652KrzysztofParticipantI hope you can see images now
March 26, 2020 at 6:28 pm #6653manjey73ParticipantThe name of the formula is if_S_S not If_S_S
March 26, 2020 at 6:50 pm #6654KrzysztofParticipantThanks a lot. I just corrected and works well 🙂
May 4, 2020 at 9:28 am #6795josef.novotnyParticipantThank you very much too.
August 27, 2020 at 4:15 am #7200hethongscada62ParticipantDear Mr. Mikhail,
My project that controls electricity parameters likes Voltage, current, power… was created. I is running. Now i want to get a consume energy per 1 minute, per 1 hour, per 1 day. Channels of the Minute and Hourly types were created. But i can not know which formula will be used. Could you help me to resolve this?
Thanks and best regards
Han HoangAugust 27, 2020 at 2:23 pm #7201MikhailModeratorHello,
To get energy consumption per hour and per day, I suggest using Elastic Report plugin.
To get minute difference, you need 2 additional channels:
1. Channel that stores a value minute ago. This is a channel of the Minute real type.
It uses formula like that:double GetDif(int srcCnl, int difCnlNum) { double newVal = Val(srcCnl); double curVal = Val(); SetVal(difCnlNum, newVal - curVal); SetVal(CnlNum, newVal); }
srcCnl – input channel that stores a source value.
difCnlNum – input channel that stores difference2. Channel that stores difference.
-
AuthorPosts
- You must be logged in to reply to this topic.