02-25-2022 12:49 AM - edited 02-25-2022 12:50 AM
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:
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
Solved! Go to Solution.
03-09-2022 04:07 AM
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
03-09-2022 05:54 AM
Thank you, Walter.