Loging an readable Timeformat


Manni

Recommended Posts

Hello,

i use LabJacFactory Express with a UE9 and want to log the datas in a textfile. Now my problem is that the only timestamp i can log is in the excel-form or a time i dont understand... thats stupid to handle with in other programs. Is there a ability to log a readable timeformat like [dd.mm.jjjj hh:mm:ss - for example: 02.08.2006 12:02:01]?

MfG Manni

Link to comment
Share on other sites

Well, "stupid" is a bad choice of words I think. Its actually more difficult for most programs to deal with readable format then it is to use the numeric format DAQFactory logs with (either excel or windows format). You just need to understand what the number means and what format your application uses. This is especially true when you consider that DAQFactory is used around the world and what is considered readable to one may be backwards to another. For example, in the US its month day year, while many other places it is day month year. Unless the day is > 12, its impossible to tell which format is being used.

Human readable times are also very difficult for a computer to query. So, most likely, even if you only see a human readable time in your application, the time is actually being represented as a number internally.

That all said:

1) Create a new channel. Call it something like "TheTime". Device Type "Test", I/O type "String", Timing = 0. Channel # and D# don't matter.

2) In one of your UE9 channels, go to the Event and put the following line (assuming the channel you choose is named "MyChannel"):

theTime.AddValue(FormatDateTime("%c",MyChannel.Time[0]))

3) Now add TheTime to your logging set.

Make sure the delimiter you use in your logging set (default comma) is not used in the date / time format of your locale (which is what FormatDateTime("%c"...) will generate). If you want to log a different date format, check out the FormatDateTime() function in the help file for a list of other codes you can use to specify exactly how you want the time to look.

Link to comment
Share on other sites

Thank you for your quick solution to solve my problem! :)

And yes, you are right with your argument to have an unconverted time. But it costs a lot of time for the operator to develop a formular for an application that evaluate statistically the datas from the logfile.

Also it is so that every famous statistical software today can define what 'human readable' timeformat it uses. (like oracle or so) So there is no problem i think. It is just avoidable working time for the operator to convert the timestamp. And the computing power for your pc to have all the time the readable timeformat is negligible today.

And sorry fpr my *stupid*, i just was frustrated about the express software that day.

mfg Manni

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.