LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Total Elapsed Time Recorder DS1682 VI code to read in Days, Hours, Minutes, seconds

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

 

 

0 Kudos
Message 1 of 5
(1,001 Views)

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! 😄

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(963 Views)

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

0 Kudos
Message 3 of 5
(951 Views)

@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.

 

 Join Numbers Function - NI

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 4 of 5
(946 Views)

Thanks 🙂

0 Kudos
Message 5 of 5
(943 Views)