manjey73

Forum Replies Created

Viewing 15 posts - 661 through 675 (of 904 total)
  • Author
    Posts
  • in reply to: Continuing a calcuation after restart ? #7916
    manjey73
    Participant

    Retain Formula for writing a variable to a file retain.txt

    string pathRet = @"/opt/scada/ScadaServer/Config/retain.txt";
    Dictionary<int, double> DictRet = new Dictionary<int, double>();
    public double Retain (double ret)
    {
    DictRet[CnlNum] = ret;
    return ret;
    }

    Example of applying the formula in the input channel database. Retain(Val(150))
    The control channel can contain setval(150, Cmd)

    The lowest input channel uses the load_retain formula
    Recording in the loadret channel()

    bool initRet = false;
    double LoadRet()
    {
    if (!initRet)
    {
    
    if (System.IO.File.Exists(pathRet))
    {
    string[] RetLoad = System.IO.File.ReadAllLines(pathRet, Encoding.UTF8);
    for (int i = 0; i < RetLoad.Length; i++)
    {
    SetVal(Convert.ToInt32(RetLoad[i].Substring(RetLoad[i].IndexOf("[")+1, RetLoad[i].IndexOf(", ")-(RetLoad[i].IndexOf("[")+1)),10),Convert.ToDouble(RetLoad[i].Substring(RetLoad[i].IndexOf(", ")+2,RetLoad[i].IndexOf("]")-(RetLoad[i].IndexOf(", ")+2))));
    }
    initRet = true;
    }
    
    }
    return Convert.ToDouble(initRet);
    }

    Executed once at server startup

    The most recent channel uses the save_retain formula
    Entry in the saveret channel formula()

    double SaveRet()
    {
    string[] RetSave = new string[DictRet.Count];
    bool eq = false;
    for (int i = 0; i < DictRet.Count; i++)
    {
    RetSave[i] = Convert.ToString(System.Linq.Enumerable.ElementAt(DictRet, i));
    }
    
    if (!System.IO.File.Exists(pathRet))
    {
    System.IO.File.WriteAllLines(pathRet, RetSave, Encoding.UTF8);
    return 0;
    }
    else
    {
    string[] RetOld = System.IO.File.ReadAllLines(pathRet, Encoding.UTF8);
    eq = System.Linq.Enumerable.SequenceEqual(RetOld, RetSave);
    if (!eq)
    {
    System.IO.File.WriteAllLines(pathRet, RetSave, Encoding.UTF8);
    }
    }
    return Convert.ToDouble(eq);
    }

    The path to Raspberry specify your own in the first formula.
    An example file retain.txt

    [450, 23]
    [451, 51]
    [452, 51,5]
    [453, 46]

    The first digit is the channel number, the second is the channel value.
    The file is written when the variable specified as Retain is changed.
    You can also initialize the necessary variables when starting the server.

    For changing variables in the process of work, but which need to be saved, it is better to add probably another timer and record no more than x minutes. I think so.
    For configuration variables that rarely change, you can use as-is.

    in reply to: Continuing a calcuation after restart ? #7914
    manjey73
    Participant

    On Raspberry, I used formulas to save and read channel data to a file. Since the values fall into RAM (tmpfs)

    in reply to: modbus data after restart scada (historian trends) #7884
    manjey73
    Participant

    Насколько знаю, это доступно только пользовательским командам протокола, которых нет в драйвере. Так что не совсем ясен сам вопрос ?
    з.ы. а почему на английском сайте ?

    in reply to: HTTPS on Linux #7847
    manjey73
    Participant

    Redirection was enabled by the site owner on the apache stub page, so it shouldn’t happen by itself 🙂

    in reply to: HTTPS on Linux #7838
    manjey73
    Participant

    This means that when we open the root of the site, the Apache page should open and not jump to the internal site. It is not clear why this is happening ?

    in reply to: HTTPS on Linux #7828
    manjey73
    Participant

    Thank you, it works. But there are nuances 🙂 For example, if you write the root of the site mysite.com then there is a redirect from the apache page that should not be, is there any way to fix it ?

    http://mysite.com:8084/scada/Login.aspx

    I used port 8084. Michael needlessly removed the settings for mono-xsp4 from the installation description file for the mono version

    • This reply was modified 5 years, 2 months ago by manjey73.
    in reply to: Not Receiving Data from Request – Modbus #7795
    manjey73
    Participant

    Maybe the address is not 5 ? And this address is listed in the documentation as an example, if the device has an address of 5 ? Or maybe someone changed the address in the device ? The same baud, parity, bit depth ?

    in reply to: Not Receiving Data from Request – Modbus #7793
    manjey73
    Participant

    Changed it to Port 23 and no difference. ????

    You have a different port specified in the Ethernet settings-RS485 and it must be specified in the communication line settings. It is the one that is registered as Local Port Number and not 502 or 23 by default

    In this case, the Modbus device settings should be as for RTU mode-TransMode = RTU

    in reply to: Not Receiving Data from Request – Modbus #7781
    manjey73
    Participant

    Have you tried connecting to the device via USB-RS485 ?

    in reply to: Not Receiving Data from Request – Modbus #7775
    manjey73
    Participant

    Try reading just one register first and make sure they are readable. and only then add registers to the query group

    in reply to: Not Receiving Data from Request – Modbus #7774
    manjey73
    Participant

    1

    2

    3

    in reply to: Not Receiving Data from Request – Modbus #7773
    manjey73
    Participant

    Why are you using port 502 ? after all, by default, the device Ethernet-RS485 has port 23 when it is configured as a tcp server ?

    in reply to: Not Receiving Data from Request – Modbus #7764
    manjey73
    Participant

    You have a simple interface converter, not a protocol converter. You configure the communication line as a TCP Client by specifying the IP and port. Scada is configured to work with the RS485 interface. transmode = RTU Address = 5 do not specify a Call Number, leave the field blank

    • This reply was modified 5 years, 2 months ago by manjey73.
    in reply to: Not Receiving Data from Request – Modbus #7763
    manjey73
    Participant

    Does your converter convert the protocol from Modbus TCP to Modnus RTU ? or is it just an ethernet – rs485 interface converter ? If the latter, then set the transemode RTU mode and remove the callnumber leave only the IP and port communication line settings

    in reply to: rapidscada on a Synology NAS with web server #7613
    manjey73
    Participant

    If the Denian system is similar and there is enough space to install Mono, it is quite possible. Mono uses a lot of space during installation.

Viewing 15 posts - 661 through 675 (of 904 total)