02-04-2019 06:19 AM
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
Solved! Go to Solution.
02-04-2019 06:37 AM
Hi there Adek
try this.
(Trunc(data.Root.ChannelGroups("TraceLoadChart").Channels("ALTERNATOR").Properties("Maximum").Value*1.6/50) + 1) * 50)
02-04-2019 08:00 AM
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
02-04-2019 08:03 AM - edited 02-04-2019 08:07 AM
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"))
02-06-2019 01:27 AM
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