DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

get date-time from .lvm

With Labview I've created a .lvm file with 6 colums of data. The .lvm also contains a x value (+1 for each row) so i'm saving 1 row of data every second.

If I plot the data in Diadem the X-axis shows up as relative time, but I want to see the absolute time (date+time). All the information is to do this is present in the header of the .lvm, but I cant find the setting to do this!

 

Thank in advance!

0 Kudos
Message 1 of 6
(4,069 Views)

Hello,

 

Take look at the following tutorial:

 

http://zone.ni.com/devzone/cda/epd/p/id/5230  

 

Hope this helps.

 

RikP

Applications Engineering

National Instruments

Rik Prins, CLA, CLED
Software Development Engineer
0 Kudos
Message 2 of 6
(4,057 Views)

Hi Inspectation,

 

If you see a little clock icon to the left of that first channel when it is loaded into DIAdem's Data Portal, then you know that you have successfully loaded date/time values into DIAdem.  You should double-check those values in a VIEW table in DIAdem to see if they include the absolute date/time offset you want.  If you see absolute date/time values in the first channel, then all you have to do is graph the other channels vs. that first channel in your VIEW or REPORT graphs in DIAdem.  If instead all you see in the first channel is relative date/time values, then you first need to add the absolute date/time offset to that first channel.  You can do that with the infomation in the knowledgebase link posted above.

 

Note that the automatic scaling in VIEW and REPORT graphs often gives the impression of relative-only date/time display, when sometimes you have full absolute date/time values but the graph is just zoomed into the date/time region of your actual x channel values.  You can change the date/time display in REPORT graphs but not in VIEW graphs.

 

Brad Turpin

DIAdem Product Support Engineer
National Instruments

0 Kudos
Message 3 of 6
(4,049 Views)

Thank you for your all your help...I'm a bit further solving the problem.

 

When using the toturial as supplied, splitting of the Data and Time won't work. Is it possible to give a more detailled instruction on this?

0 Kudos
Message 4 of 6
(3,954 Views)

Hi Inspectation,

 

The problem is that different *.LVM files contain different time information in different places, and I don't know which type you're dealing with.

 

Would you be able to post a few sample data sets or email them to me at brad.turpin@ni.com ?

 

Brad Turpin

DIAdem Product Support Engineer
National Instruments

0 Kudos
Message 5 of 6
(3,947 Views)

Hi Inspectation,

 

OK, I got your *.LVM file, and all is clear.  The problem in this case is that DIAdem 2010 and prior versions are hiding the absolute date/time property of the waveform from you in an attempt not to confuse you.  But since that's exacty what you want to see, this approach ends up being very confusing indeed, even though it works great for most of our customers.

 

The good news is that the LVM DataPlugin is parsing the absolute date/time property for each channel, and that property is being loaded (invisibly) into the Data Portal, so you can run a VBScript to fish out that information and create a new DateTime channel to plot the data against on the X axis:

 

OPTION EXPLICIT
Dim GroupIdx, ChanIdx

GroupIdx = GroupDefaultGet
IF GroupChnCount(GroupIdx) > 0 THEN
  ChanIdx = CNoXGet(GroupIdx, 1)
  Call WfmToDateWfm(ChanIdx, "DateTime")
  Call ChnRenumber
END IF

Function WfmToDateWfm(Channel, DateTimeChanName)
  Dim ChnStartTime, OffStartTime, ChnDeltaTime, RelStartTime, RelStopTime, DateTimeChannel
  IF ChnPropValGet(Channel, "waveform") <> "Yes" THEN Exit Function
  ChnStartTime = CDbl(CDate(ChnPropValGet(Channel, "wf_start_time")))
  OffStartTime = ChnPropValGet(Channel, "wf_start_offset")
  ChnDeltaTime = ChnPropValGet(Channel, "wf_increment") 
  RelStartTime = 24*3600*(Trunc(ChnStartTime) + 693958 + Abs(Frac(ChnStartTime))) + OffStartTime
  RelStopTime  = RelStartTime + ChnDeltaTime*(ChnLength(Channel) - 1)
  IF DateTimeChanName = "" THEN DateTimeChanName = ChnName(Channel) & " DateTime"
  Call GroupDefaultSet(ChnGroup(Channel))
  DateTimeChannel = ChnLinGen("/" & DateTimeChanName, RelStartTime, RelStopTime, ChnLength(Channel))
  ChnFormat(DateTimeChannel) = "Time"
  Call ChnMove(DateTimeChannel, ChnGroup(Channel), ChnIndex(Channel))
WfmToDateWfm = DateTimeChannel
End Function ' WfmToDateWfm()

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 6 of 6
(3,937 Views)