gabeirinhas

Forum Replies Created

Viewing 15 posts - 16 through 30 (of 54 total)
  • Author
    Posts
  • in reply to: Omron Fins Driver (Ethernet) #11380
    gabeirinhas
    Participant

    Hello,

    Thank you very much,

    I’ll get on it,

    I hope I get it, it would be great,

    Thanks for your help

    in reply to: Calc value from multiple device #11374
    gabeirinhas
    Participant

    Hello,

    I have incorporated the table of formulas,

    They work correctly,

    I get the average using these 2 formulas,

    MovAvg(5); AvgStat()

    TimeAvg(10, 5); AvgStat()

    >

    I have been playing with them in order to get the sum of 2 values at the change of an input channel,

    What I am trying to do is for example that, during 1 hour I get on one input channel 100.0 and after another hour I get 200.0, on the same input channel,

    I try that another input channel picks up the sum of these 100.0 + 200.0

    >

    In the first input channel (904) where I receive the values to be added,
    I put the formula

    MovAvg(2); AvgStat()

    In the second input channel (905) in order to obtain the sum, I put the formula,

    Val(904) *2

    I do not obtain the expected result,

    I hope you can help me with this, thank you

    • This reply was modified 2 years, 10 months ago by gabeirinhas.
    gabeirinhas
    Participant

    Ok,

    If I use the formula

    function double CalcSwitch(int counterCnlNum)
    {
    if (Val() <= 0 && Cnl > 0 && Stat > 0)
    {
    SetVal(counterCnlNum, Val(counterCnlNum) + 1);
    }
    return Cnl;
    }

    “error CS1519: The token ‘double’ is invalid in a class, struct, or interface member declaration.”

    >

    If I use the formula

    double CalcSwitch(int counterCnlNum)
    {
    if (Val() <= 0 && Cnl > 0 && Stat > 0)
    {
    SetVal(counterCnlNum, Val(counterCnlNum) + 1);
    }
    return Cnl;
    }

    Line 516, column 32: error CS0019: Operator ‘>’ cannot be applied to operands of type ‘method group’ and ‘int’.

    >

    Thanks in advance, best regards

    in reply to: Notification plug in (trial key vs paid registration key) #11346
    gabeirinhas
    Participant

    Its ok,

    Thanks

    gabeirinhas
    Participant

    Hello,

    I am trying to use this formula in the formula table,

    To have a counter each time it changes state 1 – 0

    I get an error on the server,

    The only way to get the server to accept it is to delete certain conditions but it still doesn’t work,

    double CalcSwitch(int counterCnlNum)
    {
    if (Val() <= 0)
    {
    SetVal(counterCnlNum, Val(counterCnlNum) + 1);
    }
    return Cnl;
    }

    Some formula available to make a counter that counts each time a channel changes state from 1 – 0, instead of using counter type, which counts both states,

    Thanks in advance

    in reply to: Calc value from multiple device #11334
    gabeirinhas
    Participant

    Hello,

    I have the following query,

    If a channel receives an actual value of 100.0 continuously and after some time the same channel receives a value of 200.0

    Is there a way to sum these specific values?

    i.e. 100.0 + 200.0?

    Thank u

    in reply to: Data History #11333
    gabeirinhas
    Participant

    Hello,

    I have made the history the way you have indicated,

    I use the automatic module to send a command when I want to make the record,

    It works correctly, but there is a blind spot,

    When 2 equal events are generated one after the other, only the first event is logged, because the logging is based on event to change,

    Is there any way to generate the event in the same way without event to change, taking advantage of the triggering of the command?

    Thanks in advance.

    in reply to: Calc value from multiple device #11319
    gabeirinhas
    Participant

    Hello,

    I want to sum two channels,

    the values keep increasing,

    Both are channels without signal,

    Both are real calculated type, one of them is based on a value with signal.

    Basically I want that when the value of one of them changes, the result will be added,

    Could you help me, thank you

    I attach pictures

    https://drive.google.com/drive/folders/1pwEn-hpt_Kkn6qjn3vjl8ZaZu2CSoL5T?usp=sharing

    in reply to: Notification plug in (trial key vs paid registration key) #11307
    gabeirinhas
    Participant

    Hello,

    would it be possible for the mute button to be activated by default, instead of having to activate it, thanks

    in reply to: Notification plug in (trial key vs paid registration key) #11300
    gabeirinhas
    Participant

    Hello,

    I have purchased the notification plugin

    I generate a notification assigned to a channel that in state 1 generates an event status.

    When this happens, it triggers a notification and a corresponding sound,

    I would like the bell to stop ringing when the channel returns to state 0 and generates a different event status,

    Would this be possible,

    Thank you

    in reply to: Time Off Timer #11292
    gabeirinhas
    Participant

    Hello,

    You were right,

    It is working correctly,

    Thank you very much

    in reply to: Time Off Timer #11289
    gabeirinhas
    Participant

    I have added the ticks formula to the formula table and it works correctly,

    When adding the formula Tp,

    I get the following error,

    https://drive.google.com/file/d/183biP4UGyLkpZVKE2CW8Y3r5WdSlOC2d/view?usp=sharing

    I hope you can help me, thank you

    • This reply was modified 2 years, 10 months ago by gabeirinhas.
    in reply to: Time Off Timer #11284
    gabeirinhas
    Participant

    Hello,

    Sorry for my ignorance,

    I am trying to implement the formula Tp, in the formula table,

    When copying the content that it indicates in the same one,

    int[] TpNum = new int[1];
    long[] TpST = new long[1];
    bool[] TpFlag = new bool[1];
    public double Tp(double TpIn, long TpPT)
    {
    long ET = 0L;
    bool q = Val(CnlNum) > 0;
    bool tp_in = TpIn > 0;

    int res = Array.IndexOf(TpNum, CnlNum);
    if (res == -1)
    {
    res = TpNum.Length;
    Array.Resize(ref TpNum, res+1);
    Array.Resize(ref TpST, res+1);
    Array.Resize(ref TpFlag, res+1);
    TpNum[res] = CnlNum;
    }

    if (!TpFlag[res])
    {
    if (tp_in)
    {
    TpFlag[res] = true;
    TpST[res] = Ticks();
    if (ET < TpPT) q = true;
    }
    }
    else
    {
    if (q)
    {
    ET = Ticks() – TpST[res];
    if (ET >= TpPT) q = false;
    }
    else
    {
    if(!tp_in)
    {
    TpFlag[res] = false;
    ET = 0L;
    }
    }
    }
    return Convert.ToDouble(q);
    }

    The server stops working correctly,

    Could you tell me how I could implement such a formula correctly,

    I attach images of the process I perform

    https://drive.google.com/file/d/1KWlFcQ5Y1vhg3GTUoQfnEbxQPMyw6Ls_/view?usp=sharing

    Thank you, best regards

    • This reply was modified 2 years, 10 months ago by gabeirinhas.
    in reply to: Retain Variable #11241
    gabeirinhas
    Participant

    Hello,

    I have already found the first formula I needed in the forum, basically the error was that it did not distinguish between 0 and null

    CnlStat > 0 ? Cnl : Val(); CnlStat > 0 ? CnlStat : Stat()

    Thanks

    in reply to: Retain Variable #11240
    gabeirinhas
    Participant

    The other formula I need is that when a discrete channel = 0

    The value of a real channel is copied,

    into another real channel,

    That is if when the discrete channel (742) == 0

    Copy, the value of the real channel (743)

    In the real channel (1033), when this happens, an event is generated with the value of the copied channel,

    What formula should I use in the real channel (1033) to perform this operation,

    Thank you very much in advance

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