DIAdem API Reference

Command: ChnConvertTimeToNumeric

  • Updated2023-02-21
  • 2 minute(s) read

Display all  Hide all

Valid names: ChnConvertTimeToNumeric, ChnTimeToNumeric

Converts a time channel into a numeric channel. The calculated values depend on the variable ApplicationTimebaseHighResolution.

Set ChnResult = ChnConvertTimeToNumeric(Y, OffsetCorrection, CreateNewChannel)

Input Parameters

Y Specifies the data channel containing the time values.
OffsetCorrection Determines whether DIAdem subtracts the first time value as offset from the subsequent time values.
CreateNewChannel Specifies whether DIAdem saves the result in a new channel (TRUE) or whether DIAdem overwrites the input channel with the result (FALSE).

Return Parameters

ChnResult Contains the result channel as ElementList <Data>.

If the variable ApplicationTimebaseHighResolution has the value False, the numeric value 0 corresponds to the time value 1/1/000 00:00:00, otherwise it corresponds to the current DIAdem time base.

Example

The following example creates the time channel DateTime with the start time oMyDateTimeInSecs and converts this time channel into the numeric channel Numeric in the default group. The numeric channel contains the seconds counted from the first start time of the channel.

VBScriptPython

 

Dim oMyDateTimeInSecs, oMyInputChn, oMyResultChn 
oMyDateTimeInSecs = TTR("2018-12-12 12:12:12,1230", "yyyy-mm-dd hh:nn:ss,ffff") 
Set oMyInputChn = ChnGenTime("DateTime", "second", oMyDateTimeInSecs, , 1, "StartStepNo", 100) 
Set oMyResultChn = ChnTimeToNumeric(oMyInputChn(1), True, True) 
oMyResultChn(1).Name = "Numeric" 
Call MsgboxDisp("Result channel: " & oMyResultChn.Item(1).ChannelGroup.Name & "/" & oMyResultChn.Item(1).Name) 

Dialog Box Call

Call SUDDlgShow("Main", ResourceDrv & "ANAChnTimeNumericConversion")

Numeric Channels <-> Time Channels

Related Functions

Command: ChnConvertAssignmentToNumeric | Command: ChnConvertAssignmentToText | Command: ChnConvertCartesianToPolar | Command: ChnConvertNumericToAssignment | Command: ChnConvertNumericToTime | Command: ChnConvertNumericToWaveform | Command: ChnConvertPolarToCartesian | Command: ChnConvertTextToAssignment | Command: ChnConvertWaveformToNumeric