manjey73

Forum Replies Created

Viewing 15 posts - 16 through 30 (of 924 total)
  • Author
    Posts
  • in reply to: Error Communication Failed #17817
    manjey73
    Participant

    If you don’t see any bytes transmitted from the device in the log, then there is a problem with the connection.

    in reply to: Mobile resolution or view #17795
    manjey73
    Participant

    As far as I know, no. I made a mnemonic specifically for the vertical version of a mobile device and created a second user specifically so that they could connect from a mobile device. Then he scored đŸ™‚

    in reply to: Entering future data #17788
    manjey73
    Participant

    – Will you have yesterday’s soup?
    – Yes, of course.
    – Then come back tomorrow. đŸ™‚

    In order to write into the future, this future probably needs to be created. You can’t do this with scripts like that. It also doesn’t seem to be possible to read database data using scripts. But is it possible to rewrite the channel data all the time so that these values will be relevant tomorrow?

    in reply to: Help with Remote Access to Webstation (External Devices) #17777
    manjey73
    Participant

    Do you have a router? To log in from the outside, you need to configure port forwarding on your PC with a web server port 80 or 10008, depending on your settings. A static external IP address is required, which the router will receive.
    You may also need to configure the firewall.

    manjey73
    Participant

    If you have a Windows system and the Server is both an operator’s computer, then you can use the sound module.

    ModAlarmFork

    If Linux or everything is separate, the web client connects remotely. The option is to use the Auto Control Module and somehow play with scripts. Another option is to add your own html page with sound to the i-frame on each page and show it when there are events, and then use a script to repeat it. In general, I have not tried these options in any way. Maybe the developer will tell you something.

    in reply to: can we implement pop-up messages on scadaWeb #17732
    manjey73
    Participant
    public double CheckComm(double min, double max, double mult, string str = "" )
    {
    if (Cmd < min || Cmd > max) throw new Exception($"The value must be within {min} - {max} {str}");
    return Cmd*mult;
    }
    
    public double CheckComm1(double min, double max, string str = "" )
    {
    if (Cmd < min || Cmd > max) throw new Exception($"The value must be within {min} - {max} {str}");
    return Cmd;
    }

    Commands have a mode where you can raise an exception.
    I made myself two formulas for convenience.

    CheckComm(16, 32, 10, "degrees")

    manjey73
    Participant

    An XML script is the result of an export from a script table. It needs to be imported, not copied as it is. XML is saved in UTF-8 format, so there should be no errors due to the operation of the site, etc.

    manjey73
    Participant

    ExportTON

    try to import

    manjey73
    Participant

    You may have picked up extra characters. You need to make copies of windows framed with the CODE tag. For example, if you copy the code that you copied here, we get an error because the site changes some characters to others.

    manjey73
    Participant

    Strangely, I copied these scripts to a new project, and there were no similar errors with saving XML.

    manjey73
    Participant

    The service channel with the Status tag works only when the Communicator starts one or another driver. When polling is turned off, this channel does not work.

    Probably using the Status signal from the Communicator when the line is running. But in principle, no one prevents you from duplicating the status of the channel(s) when the server turns it into an invalid state and turns it gray (you need to see what kind of status number it becomes, but it seems to be 4)

    My solution is on an additional calculation channel with a timer.
    For example, we added input channel 110 to the Device with the Status tag code.

    I am adding an additional channel 111 – Calculated – The input formula for the TON timer

    TON(ValRel(-1), 2, Val(), "m")

    TON(IN, PT, Q, “min”) – IN – The value of the controlled channel can be explicitly specified as Val(110)
    PT – A unit of time, for example, if in minutes 2
    The Q channel for the control output, if the formula is used by itself, it is necessary to specify the current channel Val() – these difficulties appeared when I had to make two timers in one formula, more on that later
    “m” – Specifies what the units of time are s, m, h, or sec, min, hour are allowed -see the formula
    The timer index can be omitted when used in the
    channel, by default = 0. If you use multiple timers inside other functions, you can use multiple timers by adding indexes to them and assigning internal variables to them.

    The formula in the Script table

    // IEC timers and others
    public static long Ticks()
    {
    DateTime now = DateTime.Now;
    long time = now.Ticks/10000;
    return time;
    }
    
    protected class UtilTimer
    {
    public long et;
    public bool flag;
    public bool q;
    }
    
    protected Dictionary<string, UtilTimer> TonTimer = new Dictionary<string, UtilTimer>();
    
    // Timer with a delay of turning on TON
    public double TON(double IN, double PT, double Q, string str = "", int idx = 0)
    {
    var ut = new UtilTimer() {et = 0L, flag = false, q = false};
    string keys = $"{CnlNum}_{idx}"; // The key is the channel number plus the timer index, zero by default.
    
    long ET  = 0L;
    long _pt = Convert.ToInt64(PT);
    bool q   = Q > 0;
    bool _in = IN > 0;
    string s = str.ToLower();
    
    if (s == "s" || s == "sec") _pt = Convert.ToInt64(PT) * 1000;
    if (s == "m" || s == "min") _pt = Convert.ToInt64(PT) * 60000;
    if (s == "h" || s == "hour") _pt = Convert.ToInt64(PT) * 3600000;
    
    if (!TonTimer.ContainsKey(keys))
    {
        TonTimer.Add(keys, ut);
    }
    
    if (!_in)
    {
        TonTimer[keys].q = false;
        TonTimer[keys].flag = false;
        TonTimer[keys].et = 0L;
    }
    else
    {
        if (!TonTimer[keys].flag)
    {
        TonTimer[keys].flag = true;
        TonTimer[keys].et = Ticks();
    }
     else
     {
         if (!q) ET = Ticks() - TonTimer[keys].et;
     }
     if (ET >= _pt) q = true;
     TonTimer[keys].q = q;
    }
    q = TonTimer[keys].q;
    return Convert.ToDouble(q);
    }
    // Returns the channel value relative to the current channel.
    public double ValRel(int offset)
    {
      return Val(CnlNum + offset);
    }

    And now we are setting up some other actions for the channel channel with a timer.
    When using the Automatic Control Module, you can do without these formulas, but for me it is not always convenient. Moreover, I use the timer for solving other tasks.

    manjey73
    Participant

    @isabellacog What exactly is the goal?

    for example, I make a calculation channel for the input channel of the Status Communicator and make a timer script to eliminate false alarms in case of short-term reading errors.

    You can also check some channel for status =4, if I’m not mistaken, and also make a timer to skip false alarms. Or without a timer, if the server sets this status only after a certain time.

    manjey73
    Participant

    We need to look at the logs of the Communicator and the Server, what does it say?

    manjey73
    Participant

    Show the channel settings with the Status tag again

    manjey73
    Participant

    21 – Input, data type – double or empty
    Formula (script) none
    Format – Normal-Error in table Normal; Error

Viewing 15 posts - 16 through 30 (of 924 total)