From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

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,372 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,371 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,353 Views)

Thank you!

Perfect answer.

Thomas

 

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