04-20-2023 10:18 AM
Hi all,
I have been looking high and low for code that will allow me to get I2C information from DS1682 Total Elapsed Time Recorder. I am using NI USB-8452 I2C and I can read the address of 8 bit data from the 4 registers in 05h to 08h . These increment from 0-255 then restarts at 0 , address 05h has tick time of 250 milliseconds. every time register 05h turns over upper register 06h is increased by 1 count . I want to know the best way to read the elapsed time counter, read the counter value, convert it to seconds, and display the result in a numeric indicator. in Day,Hours, Minutes and seconds format.
Not sure if 4 registers should be concatenated , or put in array ? Disappointed Chip manufacture has no info on this as it is a standard use for this chip
Thanks
04-21-2023 02:46 AM - edited 04-21-2023 02:47 AM
Hi b,
@b_powaschuk wrote:
I can read the address of 8 bit data from the 4 registers in 05h to 08h . These increment from 0-255 then restarts at 0 , address 05h has tick time of 250 milliseconds. every time register 05h turns over upper register 06h is increased by 1 count . I want to know the best way to read the elapsed time counter, read the counter value, convert it to seconds, and display the result in a numeric indicator. in Day,Hours, Minutes and seconds format.
So there are 4 bytes, which form an U32 value. And then you need to scale that U32 value into a DBL value, which gives the number of elapsed seconds (since powerup):
The formatting of the result is not (yet) in your desired format, but that's your task now! 😄
04-21-2023 06:03 AM
Thank you very much for your assistance GerdW, This is very helpful . What are the merging modules in the VI called. I have never used them.
I haven't used LabVIEW in a few year and I am still rusty .
Thanks
04-21-2023 06:16 AM
@b_powaschuk wrote:
Thank you very much for your assistance GerdW, This is very helpful . What are the merging modules in the VI called. I have never used them.
I haven't used LabVIEW in a few year and I am still rusty .
Thanks
Those are callled Join Numbers, Part of Data Manipulation.
04-21-2023 06:21 AM
Thanks 🙂