Using formulas bit confusing

Forum Home Forums Understanding the Software Using Formulas Using formulas bit confusing

This topic contains 4 replies, has 3 voices, and was last updated by Mikhail Mikhail 1 year, 6 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1359

    rambo
    Participant

    I have got some success simulating a channel for temp reading, As far as I see, the communicator device data table displays all values in decimal format.

    that means raw values ( modbus TCP ) massage is decoded and converted into decimal.

    I have add Getbyte formula ( as suggested by Mikhail in other query)

    public double GetByte(double val, int n)
    {
    UInt64 uintVal = (UInt64)val;
    return (uintVal >> (n*8)) & 0xFF;
    }

    I am trying to read byte bye means of putting Getbyte(Cnl,0) in formula of input channel.

    Scada server restart shows error
    2016-06-28 15:25:34 <****><SYSTEM><ERR> Error compiling the source code of the formulas:
    Line 429, column 55: error CS0103: The name ‘Getbyte’ does not exist in the current
    context

    Also I have tried with GetBit (Cnl, 0)

    Same result
    2016-06-28 15:25:48 <*****><SYSTEM><ACT> Formulas are read from the configuration database
    2016-06-28 15:25:49 <*****><SYSTEM><ERR> Error compiling the source code of the formulas:
    Line 429, column 55: error CS0103: The name ‘Getbit’ does not exist in the current context
    See the file C:\SCADA\ScadaServer\Log\CalcEngine.cs with the source code
    2016-06-28 15:25:49 <*****><SYSTEM><ERR> Normal program execution is impossible.
    2016-06-28 15:29:21 <******><SYSTEM><ACT> ScadaServerService is stopped

    Where I am doing the mistake…..

    I am trying to capture the actual massage bytes and bits.

    Pls Help

    Regards,

    #1360
    Mikhail
    Mikhail
    Moderator

    Function and variable names are case sensitive. Check it.

    #1371

    rambo
    Participant

    You are right ….

    Its working now… thanks a lot.

    #2547

    manraj
    Participant

    I having trouble running my addition codes in SCADA,I am looking to take a value from the MODbus operator as an input value for this codes.

    /*
    * C# Program to Get a Number and Display the Sum of the Digits
    */
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    namespace Program
    {
    class Program
    {
    static void Main(string[] args)
    {
    int num, sum = 10,

    while (num != 0)
    {
    num = num / 10;
    sum = sum + num;
    }

    }
    }

    Please show me an example of a simple addition coding to test it in the scada configuration.I have a basic level C# coding only.

    #2548
    Mikhail
    Mikhail
    Moderator

    Please create a new topic and describe what calculations you need.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.