Trying to write a floating number to a tag (value settings = memory & float).
Script works when the result is an integer, but will not work for a decimal. Just as trials, the division numerator/denominator will be varying tags when working, but the following will just move a zero in the tag.
dayPercTime = 3/22
system.tag.write("[.]..Perc_Of_Day/Perc_24hr_33", dayPercTime)
Have been unable to find anything relating to this problem or how to define i need the result as a floating number.
I should have written that question better:
How to make this work: the tag as the denominator is a floating value
dayPercTime = 1440.0/"[.]..Entry_Time_diff/Time_Diff_33"
system.tag.write("[.]..Perc_Of_Day/Perc_24hr_33", dayPercTime)
I have tried some variations, with no results:
dayPercTime = 1440.0/("[.]..Entry_Time_diff/Time_Diff_33")
system.tag.write("[.]..Perc_Of_Day/Perc_24hr_33", dayPercTime)
You RULE!!!
This is what I changed the script to:
difference = system.tag.read("[.]..Entry_Time_diff/Time_Diff_33").value
dayPercTime = 1440.0/difference
system.tag.write("[.]..Perc_Of_Day/Perc_24hr_33", dayPercTime)