Forum Home › Forums › Understanding the Software › Using Formulas › The basics of formulas?
- This topic has 3 replies, 2 voices, and was last updated 4 years, 5 months ago by
Mikhail.
-
AuthorPosts
-
April 19, 2019 at 9:02 am #5326
Zero
ParticipantI’m a beginner with both C# and rapidscada. After following the youtube tutorials and reading the docementation. I’m still unable to use formulas. At this forum are a lot of topics about using formulas, but these seem like more advanced problems.
My question is, What exactly do I need to do for a basic mathematical function? For example: Add the value of modbus channel 1 to the value of modbus channel 2 and display it in the table.
Thank you in advance
Zero
April 19, 2019 at 11:21 am #5332Mikhail
ModeratorWhat exactly do I need to do for a basic mathematical function? For example: Add the value of modbus channel 1 to the value of modbus channel 2 and display it in the table.
1. Create an input channel #3 that has Calculated real type.
2. Set a formula for channel #3: Val(1) + Val(2)
3. Specify channel #3 in a scheme or table view.
That’s it.April 24, 2019 at 8:56 am #5356Zero
ParticipantHello again,
I did exactly that, lots of error. so I reverse engineered the rules (more or less) by these errors. 2 errors remain
2019-04-24 10:45:17 <LTITIS01012><SYSTEM><ACT> ScadaServerService 5.1.1.0 is started
2019-04-24 10:45:17 <LTITIS01012><SYSTEM><ACT> Check the existence of the data directories is completed successfully
2019-04-24 10:45:17 <LTITIS01012><SYSTEM><ACT> Check the existence of the configuration database files is completed successfully
2019-04-24 10:45:17 <LTITIS01012><SYSTEM><ACT> Input channels are read from the configuration database. Active channel count: 37
2019-04-24 10:45:17 <LTITIS01012><SYSTEM><ACT> Ouput channels are read from the configuration database
2019-04-24 10:45:17 <LTITIS01012><SYSTEM><ACT> Users are read from the configuration database
2019-04-24 10:45:17 <LTITIS01012><SYSTEM><ACT> Formulas are read from the configuration database
2019-04-24 10:45:18 <LTITIS01012><SYSTEM><ERR> Error compiling the source code of the formulas:
Line 509, column 38: error CS1502: De beste treffer voor de overbelaste methode voor System.Convert.ToDouble(object) heeft enkele ongeldige argumenten (overloaded methode for system.convert.toDouble(object) has invalid arguments)
Line 509, column 55: error CS1503: Het argument 1: kan niet converteren van methodegroep naar object (can’t convert methodegroup to object)
See the file C:\SCADA\ScadaServer\Log\CalcEngine.cs with the source code
2019-04-24 10:45:18 <LTITIS01012><SYSTEM><ERR> Normal program execution is impossiblemy formula:
double OneTwo()
{
return(Val(1) + Val(2));
}I hope you have all the information you need to understand the problem
Zero
April 24, 2019 at 1:36 pm #5364Mikhail
ModeratorTry
double OneTwo() { return Val(1) + Val(2); }
-
AuthorPosts
- You must be logged in to reply to this topic.