ramses64 Posted April 14, 2011 Report Share Posted April 14, 2011 (edited) Hi all, I've a problem using the read//write INI cluster, specially with timestamps : 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, Edited April 14, 2011 by ramses64 Quote Link to comment
jcarmody Posted April 14, 2011 Report Share Posted April 14, 2011 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: What time zone are you in? When I read your ini file, I get: Quote Link to comment
ramses64 Posted April 15, 2011 Author Report Share Posted April 15, 2011 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, Quote Link to comment
Aristos Queue Posted April 15, 2011 Report Share Posted April 15, 2011 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. Quote Link to comment
Rolf Kalbermatter Posted April 20, 2011 Report Share Posted April 20, 2011 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. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.