Determing what data is OnCurDataCalculated() fired with ?

Forum Home Forums Development and Integration Determing what data is OnCurDataCalculated() fired with ?

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #9042
    zzz
    Participant

    Hi Mik,

    I am trying to understand how can modules process formula-enabled cnldata.
    Judging from the code here: https://github.com/RapidScada/scada/blob/996cbf8ac24e8d4e1ec929f979be8f044c2a7de7/ScadaServer/ScadaServer/ScadaServerEngine/MainLogic.cs#L873

    
    if (calcDR)
        RaiseOnCurDataCalculated(drCnlNums, curSrez);
    if (calcMinDR)
        RaiseOnCurDataCalculated(drmCnlNums, curSrez);
    if (calcHrDR)
        RaiseOnCurDataCalculated(drhCnlNums, curSrez);
    

    CurDataCalculated can be raised with data snapshots for different internval, if a module use this event, what should the module do to determine which type of data snapshot is provided upon this event ?

    #9048
    MikhailMikhail
    Moderator

    Hi,

    The methods RaiseOnCurDataCalculated, RaiseOnCurDataCalculated, RaiseOnCurDataCalculated just call the appropriate method in the active modules. They don’t calculate formulas.

    Formula calculations is here, for example.

    what should the module do to determine which type of data snapshot is provided upon this event ?

    It’s always current snapshot.

    #9054
    zzz
    Participant

    Hi Mik,

    I don’t understand what you mean. My question is
    for a module that only want to process current snapshot, and ignore any per minute or per hourly averaged data,
    when it receives this event, how does it know if the data returned is for calcDR, calcMinDR, calcHrDR?

    #9057
    MikhailMikhail
    Moderator

    Hi,

    I think, you should check the channel numbers if you need to identify which exact call is now.

    If I don’t understand the question, ask follow up questions.

    #9058
    MikhailMikhail
    Moderator

    The good thing is that in v6 there are only 2 types of input channels: measured and calculated.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.