Accesing Time Channel Values in DIAdem

Updated Oct 14, 2022

Reported In

Software

  • DIAdem

Issue Details

I am using ChnGenTime() function in DIAdem to generate a time channel. When trying to access some elements by using dd.Data.Root.ChannelGroups(1).Channels("ChannelName")(element_index)
in the channel I am getting a "ValueError".
 

Solution

The reason behind this behavior is that DIAdem internally stores the data as numeric values and in order to get correct data you need to use the dValues() method.
The final script should look like the following:
    dd.Data.Root.ChannelGroups(1).Channels("ChannelName").dValues(element_index)

Additional Information

The maximum resolution for a date time channel in DIAdem is specified as "hh:nn:ss.fff".
If you need a higher resolution, you can change the time format value from Settings -> DIAdem Settings -> General -> Time format.