4 Replies Latest reply on May 30, 2017 5:21 AM by ahawaldar RSS
    ahawaldar Apprentice

    Property with basetype as Number does not store value zero

    Hi,

     

    I have a virtual thing, which has a property whose baseType is NUMBER. When I start the client and when virtual thing is connected, if the initial values are zero for this  property for certain period of time, these zero values are displayed as null rather than zero. Once the value has some value greater than zero, the property values are logged exactly. So the problem is unless the property with baseType as NUMBER has some values greater than zero, these values will not be logged. How can I overcome this? I need property values to be zero not null if its zero.


    Thanks,

    Azim

      • Re: Property with basetype as Number does not store value zero
        supandey Collaborator

        Hi Azim,

         

        is the behaviour same when you try to set the value to 0 as default? Are you observing this on the platform side or on the edge devices?

          • Re: Property with basetype as Number does not store value zero
            ahawaldar Apprentice

            Hello Sushant Pandey,

             

            I have not set any property to have default value. This is observed on platform side in valuestream. When i execute queryPropertyHistory Service I see that unless the values for a property is one, all zero values are set to null(missing values).

             

            Note: All these properties are feeded into platform through virtual thing. Below is the property definition

             

            @ThingworxPropertyDefinitions(

              properties={

              @com.thingworx.metadata.annotations.ThingworxPropertyDefinition(name="acceleration", description="Bogie acceleration reading", baseType="NUMBER", aspects={"dataChangeType:ALWAYS", "dataChangeThreshold:0", "cacheTime:-1", "isPersistent:TRUE", "isReadOnly:TRUE","isLogged:TRUE", "pushType:VALUE"}),

              @com.thingworx.metadata.annotations.ThingworxPropertyDefinition(name="time", description="time during which readings were recorded", baseType="DATETIME", aspects={"dataChangeType:ALWAYS", "dataChangeThreshold:0", "cacheTime:-1", "isPersistent:TRUE", "isReadOnly:TRUE","isLogged:TRUE", "pushType:VALUE"}),

              @com.thingworx.metadata.annotations.ThingworxPropertyDefinition(name="start", description="indicates start point of readings", baseType="NUMBER", aspects={"dataChangeType:ALWAYS", "dataChangeThreshold:0", "cacheTime:-1", "isPersistent:TRUE", "isReadOnly:TRUE","isLogged:TRUE", "pushType:VALUE"}),

              @com.thingworx.metadata.annotations.ThingworxPropertyDefinition(name="end", description="indicates end point of readings", baseType="NUMBER", aspects={"dataChangeType:ALWAYS", "dataChangeThreshold:0", "cacheTime:-1", "isPersistent:TRUE", "isReadOnly:TRUE","isLogged:TRUE", "pushType:VALUE"})

              }

              )

              • Re: Property with basetype as Number does not store value zero
                supandey Collaborator

                @Azim could you please test by setting the property to 0 as default value, since you mentioned once the client is connected until the value changes the property value is 0.

                 

                A minor question: do you really wish to log values with property value being 0? Because as you have set that the values should always be pushed on value change and since it's 0 there is no change to push.

                  • Re: Property with basetype as Number does not store value zero
                    ahawaldar Apprentice

                    Sushant Pandey,

                     

                    I think I did not clarified you in a proper way. The values from virtual things properties are either zero or one. If the virtual thing sends zero values initially, in platform these values i.e. zero values are not stored in respective Things value stream. Once the virtual thing sends one values , the one values are stored in respective Things value stream. However after one values if there are any zero values again into the platform these values are stored in respective Things value stream. Zero values are missing only for initial readings till the values become one.


                    I tried setting default value but didnt helped.


                    Thanks,

                    Azim