DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Absolute Start Time of Waveform Signals

Solved!
Go to solution

Hello,

 

I have two waveform signals and want to calculate the difference (in seconds and milliseconds) of their absolute start times.

 

 

Waveform x Start times:

  • First Signal: 01.01.2000 00:00:00.000100000
  • Second Signal: 01.01.2000 00:00:00.000000000

The difference shoud be 0.0001 seconds.

 

To calculate this value:

I made a textbox in a report and wrote the following:

Difference: @@Str(Data.GetChannel("[2]/Schall_1").Properties("wf_start_time").Value-Data.GetChannel("[2]/Schall_2").Properties("wf_start_time").Value, timeformat)@@

 

The problem is: The textbox shows 0.0000 as the result. Why?

 

Thank you in advance

 

 

0 Kudos
Message 1 of 3
(1,338 Views)
Solution
Accepted by topic author Mark1978

Hi Mark1978,

 

The problem is that VBS supports time up to seconds, DIAdem in normal format up to milliseconds and in extended format (USI Time) micro and nanosecond.

So you can access the individual time components:

 

dim oTV, oGroup

call Data.Root.Clear
set oGroup = Data.Root.ChannelGroups.Add("Date")

call oGroup.Properties.Add("Timetest", CreateTime(2022,3,9,10,11,12,123,456), DataTypeDate)

set oTV = Data.Root.ChannelGroups(1).Properties("Timetest").oValue

msgbox str(oTV.Day) & "." & str(oTV.Month) & "." & str(oTV.Year) & " " & str(oTV.Hour) & ":" & str(oTV.Minute) & ":" & str(oTV.Second) & "." & str(oTV.Millisecond) & str(oTV.Microsecond)

 

Greetings

Walter

0 Kudos
Message 2 of 3
(1,242 Views)

Thank you, Walter.

0 Kudos
Message 3 of 3
(1,236 Views)