0 Replies Latest reply on Dec 3, 2016 6:26 AM by vr-2 RSS
    vr-2 Explorer

    Multiple Data Logging in Value Stream

    Hi,

    I'm using two service to store data of same property to my value stream.

     

    Service 1:

    me.Die_Status = Die_S

    me.Mould_Status = Mld_S

    me.Mode = Sw_S

    /////////////////////////////////////////////////////////

    if ( me.Die_Status == 1)

    {

        me.Die_Temp = 1

    }

    /////////////////////////////////////////////////////////////

    if( me.Die_Status == 0 && me.Die_Temp == 1)

    {

        me.Cycle = "I"

        ////////////////////////////////

        me.DieCloseTime = dateAddHours(me.DieCloseTime, 5);

        me.DieCloseTime = dateAddMinutes(me.DieCloseTime, 30);

        ////////////////////////////////

        me.DieOpenTime = dateAddHours(me.DieOpenTime, 5);

        me.DieOpenTime = dateAddMinutes(me.DieOpenTime, 30);

        ///////////////////////////////

        me.StartTime = dateFormat(me.DieCloseTime,"HH:mm:ss")

        me.EndTime = dateFormat(me.DieOpenTime,"HH:mm:ss")

        //////////////////////////////

        me.CycleDuration = me.DieOpenTime - me.DieCloseTime

        var Cmin = dateFormat(me.CycleDuration,"mm")

        var Csec = dateFormat(me.CycleDuration,"ss")

        me.CMin = Cmin

        me.CMin = me.CMin * 60

        me.CSec = Csec

        me.CSec = me.CSec + me.CMin

       me.Cycle_Duration = me.CSec

        me.Shift = "F"

        me.Die_Temp = 0

    }

     

    Service 2:

    me.Die_Status = Die_S

    me.Mould_Status = Mld_S

    me.Mode = Sw_S

     

    var milliseconds = pause(15000); //Delay

    if (me.Mould_Status == 1 )

    {

        me.Mld_Temp = 1

    }

    if ( me.Mould_Status == 0 && me.Mld_Temp == 1)

    {

        me.Cycle = "A"

        ////////////////////////////////

        me.MldFillTime = dateAddHours(me.MldFillTime, 5);

        me.MldFillTime = dateAddMinutes(me.MldFillTime, 30);

        ////////////////////////////////

        me.MldNFilTime = dateAddHours(me.MldNFilTime, 5);

        me.MldNFilTime = dateAddMinutes(me.MldNFilTime, 30);

        ///////////////////////////////

        me.StartTime = dateFormat(me.MldFillTime,"HH:mm:ss")

        me.EndTime = dateFormat(me.MldNFilTime,"HH:mm:ss")

        me.CycleDuration = (me.MldNFilTime - me.MldFillTime)

        var Cmin = dateFormat(me.CycleDuration,"mm")

        var Csec = dateFormat(me.CycleDuration,"ss")

        me.CMin = Cmin

        me.CMin = me.CMin * 60

        me.CSec = Csec

        me.CSec = me.CSec + me.CMin

        me.Cycle_Duration = me.CSec

     

        me.Mld_Temp = 0

    }

     

    Below are data from hardware device

    me.Die_Status = Die_S

    me.Mould_Status = Mld_S


     

    1. If Die_S value changes from 1 to 0 service 1 to be executed. Likely if Mld_S changes from 1 to 0 Service 2 to be executed.

     

    The Problem is when this happens data logged multiple time in my ValueStream. I have set all my Datachange to Value.

     

    PFA the png for my logged values.

     

    Help me to fix this. Thanks in advance.

     

    Regards,

    Vel