i want to create a metadatapoint the sums the accumulate hours of that binary is 1....

i don't know what to put on the script part of the metadata point for achieving this

what i need is to have a counter of working hours a day of a engine..

thanks for the help..

]]>i want to create a metadatapoint the sums the accumulate hours of that binary is 1....

i don't know what to put on the script part of the metadata point for achieving this

what i need is to have a counter of working hours a day of a engine..

thanks for the help..

]]>

The StartsAndRuntimeList object is returned by Binary and Multistate points. It contains the following properties:

realStart: (integer) the actual start time used for calculations (in case the start time precedes the point's first known value)

end: (integer) the end time used for calculations

data: (array) the list of individual StartAndRuntime objects.

Each StartAndRuntime object has the following properties:

value: (boolean for Binary, integer for Multistate) the point state to which the remaining properties apply

starts: (integer) the number of times the state was entered over the period

runtime: (integer) the amount of time in milliseconds the point was in the state over the period

proportion: (float) the proportion of the period the point was in the state (runtime / real duration)

percentage: (float) proportion * 100

To access a specific StartAndRuntime object in the list, use the get() function. For example, the following returns the proportion of time that 'b' was in state 'false' over the previous 2 months.

return b.past(MONTH, 2).get(false).proportion;

you could do

```
return 24*(b.past(HOUR, 24).get(true).proportion);
```

I think this will take the % of time it was true for the 24 hour period and then convert that to how many hours.

]]>[quote=

```
return 24*(b.past(HOUR, 24).get(true).proportion);
```

I think this will take the % of time it was true for the 24 hour period and then convert that to how many hours.[/quote]

]]>