manjey73

Forum Replies Created

Viewing 15 posts - 286 through 300 (of 923 total)
  • Author
    Posts
  • in reply to: data storage under mill second #15545
    manjey73
    Participant

    Unfortunately, not yet, I suggested to Mikhail to add such an opportunity, since it was asked about back on version 5

    manjey73
    Participant

    Change the ScadaAgent port to another one other than 10002

    <?xml version="1.0" encoding="utf-8" ?>
    <ScadaAgentConfig>
      <ListenerOptions>
        <Port>10002</Port>

    See the configuration file in the ScadaAgent\Config folder. After that, restart the services.
    Also, when configuring the configuration, specify this port in the project Instances

    • This reply was modified 1 year, 6 months ago by manjey73.
    in reply to: Enter date and time from web browser #15530
    manjey73
    Participant

    With the Date and Time format, it is transmitted as a string, Cmd is not suitable here

    Input Script – Val()
    Output Script – GetStrDt(CmdDataStr) or GetStrDtToUtc(CmdDataStr)

    Script Table
    For Locale Time

    public double GetStrDt(string dt)
    {
    SetVal(CnlNum, EncodeDate(DateTime.Parse(dt)));
    return EncodeDate(DateTime.Parse(dt));
    }

    For UTC Time

    public double GetStrDtToUtc(string dt)
    {
    SetVal(CnlNum, EncodeDate(DateTime.Parse(dt).ToUniversalTime()));
    return EncodeDate(DateTime.Parse(dt).ToUniversalTime());
    }
    • This reply was modified 1 year, 6 months ago by manjey73.
    • This reply was modified 1 year, 6 months ago by manjey73.
    in reply to: Sending commands from Rapid SCADA to OpenPLC #15527
    manjey73
    Participant

    In a simple version, you can control it through the start variable
    In this case, the PLC does not actually stop, it does the work of “Doing nothing”

    if (start)
    { Your program }
    else do nothing
    in reply to: Sending commands from Rapid SCADA to OpenPLC #15526
    manjey73
    Participant

    It seemed to me that the start and stop of the PLC is not related to the protocol, it is a higher level.
    But it can also be solved through protocol variables, but for this your PLC program must be written accordingly. These are fundamentally different approaches.

    manjey73
    Participant

    Data Acquisition: How do I connect my PLC to Rapid SCADA: ?? Are there specific drivers or protocols I should be aware of: ??

    What kind of PLC do you have?
    Does it support the Modbus protocol?

    Visualization: I want to create user friendly dashboards. What are the best pracices for designing visualizations in Rapid SCADA:?? Any tips on using the built-in components effectively: ??

    What exactly do you want to draw?

    There are video tutorials on Yutube

    in reply to: How to retrieve data from the Channels table in a custom module? #15457
    manjey73
    Participant

    Cnl CnlArc = ServerContext.Cnls.ArcCnls.Values.Where(x => x.CnlNum == cnlNum).FirstOrDefault();

    It is possible to get from the Scada Module in this way through the required channels.
    where is CnlNum the channel number you need

    There are 4 types of channel lists
    ArcCnls – all channels that can be saved in the database
    CnlOut – output channels only
    Calculated and another one where the input channels are

                // Каналы Archive - все Input, InputOutput, Calculated, CalculatedOutput
                try
                {
                    Cnl CnlArc = ServerContext.Cnls.ArcCnls.Values.Where(x => x.CnlNum == cnlNum).FirstOrDefault();
                    if (CnlArc != null)
                    {
                        if (!dictCnl.ContainsKey(Name)) // Сразу добавлять в словарь наверное не получится, так как неизвестен поток ??? Известна программа
                        {
                            dictCnl.Add(Name, CnlArc);
                        }
                    }
                }
                catch
                {
                    moduleLog.WriteLine($"НЕТ ArcCnls"); // TEST
                }
    
                // Каналы Output
                try
                {
                    Cnl CnlOut = ServerContext.Cnls.OutCnls.Values.Where(x => x.CnlNum == cnlNum).FirstOrDefault();
                    if (CnlOut != null)
                    {
                        if (!dictCnl.ContainsKey(Name))
                        {
                            dictCnl.Add(Name, CnlOut);
                        }
                    }
                }
                catch
                {
                    moduleLog.WriteLine($"НЕТ OutCnls"); // TEST
                }
            }
    

    So I add the channels I need to my dictionaries as an example.

    Next, you can study Cnl CnlArc and take the necessary actions depending on the Data Types, format, etc.

    • This reply was modified 1 year, 7 months ago by manjey73.
    in reply to: I want to display text from decimal numbers. #15424
    manjey73
    Participant

    This is a test of the second formula.
    You need to create 8 calculation channels and specify in the formula which channel to take data from and which byte to take.
    GetByte1(105, 6) is an example to take the 6th byte. The value can be from 0 to 7

    in reply to: I want to display text from decimal numbers. #15423
    manjey73
    Participant
    in reply to: I want to display text from decimal numbers. #15422
    manjey73
    Participant
    public double GetByte1(int num, int bytenum)
    {
    byte[] mass = BitConverter.GetBytes(Val(num));
    if (bytenum >= 0 && bytenum <= 7)
    {
        return Convert.ToDouble(mass[bytenum]);
    }
    else return double.NaN;
    }

    This formula will probably be more correct with your values

    in reply to: I want to display text from decimal numbers. #15421
    manjey73
    Participant
    public double GetByte(double val, int n)
    {
        UInt64 uintVal = (UInt64)val;
        return (uintVal >> (n * 8)) & 0xFF;
    }

    I’m not sure if this will work correctly. I’ll try to check in VisualStudio

    in reply to: I want to display text from decimal numbers. #15420
    manjey73
    Participant

    Well, do you want exactly what I assumed?

    in reply to: Precision Loss Due 64-bit data #15415
    manjey73
    Participant

    I did not try to check the channel type from the driver immediately before recording, for example, if I created an integer channel directly by the driver, and the user then changed it to double.

    If there is such an opportunity, then it is very good.

    in reply to: I want to display text from decimal numbers. #15407
    manjey73
    Participant

    Do you want to have 8 channels with a number display 111, 114, 98, 111, 108, 108, 101 and 72 ?
    5th version does not support arrays. You will have to get everything into the input channel in double, then make 8 calculation channels and write a script that will pull out the required from the total “number” either in the form of strings or in the form of numbers.

    in reply to: Precision Loss Due 64-bit data #15406
    manjey73
    Participant

    You can assign the channel data type directly in the driver. Including in the View, you also generate code that allows you to use the Channel Creation Wizard based on your driver’s code. That is, the user does not need to think about what type of channel needs to be set for the signal, the channel creation wizard will do everything necessary.

    I don’t remember if it is possible to check channel types from the driver code, since it is configured even before you create channels, but it can definitely help create channels and even specify the required formulas. For example, look at the Modbus code when setting up the bitmask.

Viewing 15 posts - 286 through 300 (of 923 total)