Jump to content

TimeStamp in Write ini cluster


Recommended Posts

Hi all,

I've a problem using the read//write INI cluster, specially with timestamps :

post-23390-0-28728400-1302776984_thumb.png

With this code, the ini created is :

[My beautiful cluster]

Start = "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"

End = "\00\00\00\00ÉÌvÉ\06,@\00\00\00\00\00"

And as you can see, the read ini cluster won't be able to decode the ini to restore datas !

Any idea ?

Best regards,

post-23390-0-28728400-1302776984_thumb.p

Edited by ramses64
Link to comment

Have you tried to read your ini file? It's not human-readable but it's correct.

My file looks like:

[Cluster]

Start = "\00\00\00\00ÉË$ \00\00\00\00\00\00\00\00"

End = "\00\00\00\00É̃L\0FÙ\00\00\00\00\00"

My vi reads it like:

post-7534-0-70514800-1302779021_thumb.pn

What time zone are you in? When I read your ini file, I get:

post-7534-0-91494900-1302779193_thumb.pn

Link to comment

If you want to use it elsewhere, I suggest you'll need to use the "Seconds To Date/Time" primitive and then write that cluster to the config file. I think that's the only way to get a portable version of the data. Even if you knew the encoding, you'd still have to have that other system know the epoch.

Link to comment

Hi jcarmody,

I apologize, it works, I can use the read ini cluster, and the timestamp is well decoded.

Do you have any idea how the time stamp is coded ? I would like to be able to use this ini file in other language like C++...

Best regards,

A LabVIEW timestamp is a 128 bit fixed point number. The first 64 bits are a signed 64 bit value indicating the seconds since Jan 1, 1904 GMT, while the second 64 bit are the fractional seconds. So it's possible to treat the timestamp as raw data but VERY error prone since it is easy to make errors with signed/unsigned integer and 64 bit integer arithmentic math, and getting the time difference between your epoch and the LabVIEW epoch wrong.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.