LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

can't check FGPA reference with "Not a Number/Path/Refnum?"

Solved!
Go to solution

How do I check if a FPGA interface refnum is valid?  It appears (LabVIEW 2009) that "Not a Number/Path/Refnum?" always returns true when wired to the output of Open FPGA VI Reference.  I'm writing code that needs to be able to run without an FPGA for testing purposes so I wrapped all calls to the FPGA in a case structure that I thought would execute only if the FPGA reference is valid.  Turns out they never execute, even when the FPGA reference is valid (probe shows it has a numeric value, and the FPGA VI is running).  I assume this is somehow similar to semaphore and rendezvous references that have their own special function to check validity, but I don't see any such function for FPGA.  Do I have to typecast to an int and check if not equal to zero?

0 Kudos
Message 1 of 16
(3,350 Views)

Hi Nathan,

 

I believe what you're seeing is expected behavior as the "Not a Number/Path/Refnum?" function doesn't integrate seamlessly with references. I did a quick mock-up with a FPGA Open Reference VI and an FPGA Interface Dynamic Refnum, my code/result is below.

 

fpgarefnum.png

 

As shown, the refnums behave as you'd expect giving us true values, however the type-cast reference and refnum both result in false values. Since there doesn't appear to be a straightforward way to check validity (as you can do with semaphores), it looks like you will probably need to do a bit of extra coding to get the behavior you want. I would be interested to see what you've come up with as this would be a useful feature.

 

Tim W.

Applications Engineering

National Instruments

http://www.ni.com/support 

 

0 Kudos
Message 2 of 16
(3,341 Views)

Thanks for looking at this.  Try something: uncheck the "Dynamic Mode" checkbox, and the behavior changes.  The output of "Not a Refnum?" will always be true.  After seeing your message I checked this in LabVIEW 2011.  The project in which I discovered the behavior is in LabVIEW 2009 (as mentioned in my original post) which did not have dynamic mode.  This seems like a bug, or at least weird behavior, especially the mismatch between dynamic mode and not dynamic mode.

0 Kudos
Message 3 of 16
(3,336 Views)

I'm still playing around with this behavior a bit more. In 2011, I switched between dyanamic mode and not-dynamic mode and got the same behavior in both modes (that is, neither one caused the Not a Refnum boolean to light up). In your Open FPGA VI Reference, how do you have it configured? Is it pointing to a VI, Build Spec, or Bitfile?

 

Tim W.

Applications Engineering

National Instruments

http://www.ni.com/support 

0 Kudos
Message 4 of 16
(3,325 Views)

It's pointing at a VI.  Here's the simplest project I can generate that demonstrates this.  When I run Host.vi, I get a false output when the Open FPGA Reference is in Dynamic mode, and a true output when it's not.

0 Kudos
Message 5 of 16
(3,323 Views)

Things are getting a bit stranger. I ran your example on my cRIO 9075 and got false values on the boolean for both dynamic and not-dynamic modes. I'm going to track down an R Series card to test it with something closer to your set up.

 

Tim W.

Applications Engineering

National Instruments

http://www.ni.com/support 

0 Kudos
Message 6 of 16
(3,316 Views)

That's strange, sounds like it's doing exactly what it should do for you, and not for me.  I see this behavior even without any hardware attached - just running the FPGA on the development computer with simulated IO.

0 Kudos
Message 7 of 16
(3,313 Views)

In case it helps, here are screenshots from running it in both dynamic mode (top), and not dynamic mode (bottom).  There's an oddity in the probe in not-dynamic mode as well, as you can see: in the tree the probe has a value, but in the display it's shown as 0.

Dynamic Mode.PNG

 

Not Dynamic Mode.PNG

0 Kudos
Message 8 of 16
(3,310 Views)

Hi Tim - just wondering, any update on this?  Is there any more information I can provide that would be useful?  Were you able to duplicate the behavior I'm seeing, or do you only get the expected behavior?

0 Kudos
Message 9 of 16
(3,298 Views)

Hi Nathan,

 

I've gotten busy with a  few other things, but am still working on this, I will update you once I get it figured out.

 

Tim W.

Applications Engineering

National Instruments

http://www.ni.com/support 

0 Kudos
Message 10 of 16
(3,296 Views)