DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

How to reference a Channel Property whose value is NOVALUE

Solved!
Go to solution

I have a file where sometimes a custom channel property has a value of NOVALUE.  I want to change these NOVALUES to zeros.  However, I cannot find a way to reference the NOVALUES.  These lines don't work (no error message either):-

Current_LowLimit = Data.Root.ChannelGroups(20).Channels(2).Properties("Current_LowLimit").Value

if Current_LowLimit = "novaluekey" then

Current_LowLimit = 0

end if

 

This line gives an 'Invalid use of Null ' error:-

msgbox Current_LowLimit

 

Is the script name for NOVALUE different?  I have tried using Null, NaN, "", novaluekey without success. 

Any help would be appreciated.  Thank you.

Thomas.

0 Kudos
Message 1 of 4
(2,385 Views)

Correction to my last post

the line :-

if Current_LowLimit = "novaluekey" then

should read :-

if Current_LowLimit = NOVALUE then

Sorry for the confusion.

Thomas

 

 

0 Kudos
Message 2 of 4
(2,384 Views)
Solution
Accepted by topic author mrme
If IsNull(Data.Root.ChannelGroups(1).Properties("Custom_Property").Value) Then
  Call LogFileWrite(Data.Root.ChannelGroups(1).Properties("Custom_Property").Value)
End If

So, try IsNull(property value)

0 Kudos
Message 3 of 4
(2,366 Views)

Thank you!

Perfect answer.

Thomas

 

0 Kudos
Message 4 of 4
(2,350 Views)