locked
Measure Edge event time RRS feed

  • Question

  • Hi,
    I wrote this code, that start to return the temperature values when the production tag goes to "1".

    // Signal to monitor
    CepStream<SignalLog> l_ProductionPhaseCepStream = this.GetCepStreamFromSignalDescription("HSL.ProductionPhase");
    // Signal to log
    CepStream<SignalLog> l_HSLIntTest1CepStream = this.GetCepStreamFromSignalDescription("HSL.IntTest1");
    
    // Convert the point events from the reference stream into edge events
    CepStream<SignalLog> l_ProductionPhaseCepStreamEdged = from e in l_ProductionPhaseCepStream
                                                           .AlterEventDuration(e => TimeSpan.MaxValue)
                                                           .ClipEventDuration(l_ProductionPhaseCepStream, (e1, e2) => (e1.SignalID == e2.SignalID))
                                                           select e;
    
    return
          from Temperature in l_HSLIntTest1CepStream
          from Production in l_ProductionPhaseCepStreamEdged
          where BitConverter.ToInt32(Production.SignalsLogValue, 0) == 1
          select new SignalLog() { SignalID = this.SignalID, SignalsLogTimeStamp = DateTime.Now.Ticks, SignalsLogValue = Temperature.SignalsLogValue };

    How I can read the temperature values when the production goes to "1" from at least 2 minute?

    Thanks to everibody
    Gianluca

    Monday, April 15, 2013 7:40 AM

Answers

  • I'm not sure that I understand what you are trying to accomplish here. Do you want to know when you have the value 1, consistently, without any other value, within a 2 minute period? If so, take a look at the "Alarm Floods and Transients" sample for LinqPad - you'll do something very similar.

    DevBiker (aka J Sawyer)
    Microsoft MVP - Sql Server (StreamInsight)


    Ruminations of J.net


    If I answered your question, please mark as answer.
    If my post was helpful, please mark as helpful.

    • Marked as answer by BosePR Monday, April 22, 2013 7:43 AM
    Tuesday, April 16, 2013 4:06 PM
    Moderator

All replies

  • I'm not sure that I understand what you are trying to accomplish here. Do you want to know when you have the value 1, consistently, without any other value, within a 2 minute period? If so, take a look at the "Alarm Floods and Transients" sample for LinqPad - you'll do something very similar.

    DevBiker (aka J Sawyer)
    Microsoft MVP - Sql Server (StreamInsight)


    Ruminations of J.net


    If I answered your question, please mark as answer.
    If my post was helpful, please mark as helpful.

    • Marked as answer by BosePR Monday, April 22, 2013 7:43 AM
    Tuesday, April 16, 2013 4:06 PM
    Moderator
  • I'm not sure that I understand what you are trying to accomplish here. Do you want to know when you have the value 1, consistently, without any other value, within a 2 minute period? If so, take a look at the "Alarm Floods and Transients" sample for LinqPad - you'll do something very similar.

    you understood perfectly! the example is great!
    Thanks and good job

    Gianluca


    • Edited by BosePR Tuesday, April 23, 2013 6:59 AM
    Monday, April 22, 2013 7:45 AM