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.

LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
Darren

VI Analyzer Test - Not a Refnum Usage

Status: New

In this thread on LAVA, Aristos Queue points out some common usage patterns of the "Not A Number/Path/Refnum?" function that can result in performance problems and/or race conditions.  He recommends either (1) comparing a refnum against a null constant value, or (2) trying the refnum operation you were going to do anyway, and using the error output from that operation to determine if the refnum was valid.

 

I propose a VI Analyzer Toolkit test that checks for this scenario called "Not A Refnum Usage".  The test would return a failure under the following circumstances:

 

  • The input to the "Not A Number/Path/Refnum?" function is a refnum data type.
  • The refnum is any type other than Occurrence.
  • The output of the "Not A Number/Path/Refnum?" function is wired to anything other than a Boolean indicator.

If these conditions are met, the test would return a failure, and would make the two recommendations mentioned above as alternatives to using the "Not A Number/Path/Refnum?" function.

1 Comment
Mr._Jim
Active Participant

Even if I didn't use VI Analyzer, you still deserve a kudos for linking to that information from Aristos Queue.  I am now adding another practice to avoid to my long list.