DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Error received: Invalid use of Null: data.Root.ChannelGroups(...).Channels(...).Maximum

Solved!
Go to solution

Hi there,

 

since DIAdem 2018 I get this error when using the Maximum property. It works if I load in .tdms files (second run through the script), which I saved previously in the script (after first run).

If I stop the script right before the error, the channel exists and does have a Maximum value... (see picture attached)

 

I want to use it for scaling a y-Axis.

myCurrGraph.YAxisList.Item(1).Scaling.End = (Trunc(data.Root.ChannelGroups("TraceLoadChart").Channels("ALTERNATOR").Maximum*1.6/50) + 1) * 50

 

Thanks in advance.

Adek

 

0 Kudos
Message 1 of 5
(2,920 Views)

Hi there Adek

try this. 

 

(Trunc(data.Root.ChannelGroups("TraceLoadChart").Channels("ALTERNATOR").Properties("Maximum").Value*1.6/50) + 1) * 50)

0 Kudos
Message 2 of 5
(2,911 Views)

Thanks for your reply RomanKoleno,

I tried you solution within a message box as it is still not working. Now I am getting this error:
Invalid use of Null: 'Value'

If I use it in the original context I get (as before):
Invalid parameter.

 

Thanks in advance.

Adek

0 Kudos
Message 3 of 5
(2,897 Views)
Solution
Accepted by topic author adek

Since DIAdem 2018 the Minimum, Maximum, ... are not automatically calculated on load by default.

This was done to speed up load, which does not matter if the values are not accessed.

 

In script the calculation can be done by one of the following methods

' Change the behavior globally, which will affect any following load
ChnCharacteristicsUpdate= "Automatic"
' calculate a single channel Call ChnCharacter("[4]/Temperature_1")
' all loaded channels Call ChnCharacterAll()

Or you can switch it back on by picking it in the Settings

Settings->DIAdem Settings->Navigator->Loading Behavior

   Automatically calculate charateristic values

 

This line should help in your script:

Call ChnCharacter(data.Root.ChannelGroups("TraceLoadChart").Channels("ALTERNATOR"))
Message 4 of 5
(2,896 Views)

Hello AndreasK,

 

thanks for your reply. I tried to bulk load option, but it did not seem to work. But the method for calculating it for a single channel does.

 

So thank you for your help.

Regards

Adek

 

 

0 Kudos
Message 5 of 5
(2,876 Views)