09-19-2024 07:15 AM
Hi All
In my code I did : in Diadem 2017
Function ChannelIsTime(groupIndex, channelName)
Dim chnIndex
ChannelIsTime = False
For chnIndex = 1 To Data.Root.ChannelGroups(groupIndex).Channels.Count
If Data.Root.ChannelGroups(groupIndex).Channels(chnIndex).Name = channelName Then
' Check if the channel is of the type "Time"
If Data.GetChannelProperties(Data.Root.ChannelGroups(groupIndex).Channels(chnIndex)).Item("Unit").Value = "s" Then
ChannelIsTime = True
Exit For
End If
End If
Next
End Function
in order to check if the unit of a channel is time, in order to find out which one is the time channel. but I get an error that this method doe snot exist. what is the right way?
10-18-2024 04:56 AM
To access the channel unit use Data.Root.ChannelGroups(1).Channels(channelName).UnitSymbol.
To create the correct syntax you can simply drag the unit property tag from data portal into your script.