The basics of formulas?

Forum Home Forums Understanding the Software Using Formulas The basics of formulas?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #5326
    Zero
    Participant

    I’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

    #5332
    Mikhail
    Moderator

    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.

    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.

    #5356
    Zero
    Participant

    Hello 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 impossible

    my formula:
    double OneTwo()
    {
    return(Val(1) + Val(2));
    }

    I hope you have all the information you need to understand the problem

    Zero

    #5364
    Mikhail
    Moderator

    Try

    double OneTwo()
    {
      return Val(1) + Val(2);
    }
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.