08-01-2018 12:13 PM
Hello
I have run into a really wired situation but I am trying to access the max & min channel properties in a script and I get a null value as a result
So I am using the following function to gain access to the channel group in a for loop and it returns a null value after the first iteration of the loop. However when I use the debugger, the function below return the correct values.
Data.Root.ActiveChannelGroup.Channels(i).Properties.Item("Maximum").Value or Data.Root.ActiveChannelGroup.Channels(i).Maximum
I am using 2017 SP1
Anyone else come across this?
Solved! Go to Solution.
08-02-2018 09:32 AM
08-02-2018 09:57 AM
Depending on how the data was brought in before you called this function, it's most likely that the characteristic values of the channel have yet to be calculated. You have multiple options:
Call ChnCharacter(ChnArg1) - This will calculate characteristics for one channel.
Call ChnCharacterAll() - Does it for all channels, could take a long time depending on how many channels.
I personally like the CCh command. Function: CCh
ReturnValue = CCh(Channel,StatValueIndex)
Function: CCh
ChannelName | Specifies the data channel. | |||||||||||
StatValueIndex | Specifies the index of the characteristic value to be calculated. | |||||||||||
|
08-02-2018 10:02 AM
Awesome thanks for the input
I ended up using the ChnCharacter() function for each individual channel in an active channel group.
Call ChnCharacter(Data.Root.ActiveChannelGroup.Channels(i))
08-06-2018 04:42 AM
Some explanations:
ChnCharacteristicsUpdate="Automatic"
ChnCharacter ChnCharacterAllis used to calculate them.