LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Not-a-Ref doesn't work with sound files?

Solved!
Go to solution

    I'm using LabVIEW 2013 32 bit on W7-64.  When I open a sound file and am writing to it, e.g. the ref is valid, the Not-a-Refnum? function returns True.  Is this a known limitation of sound files?  The same thing is true with the NI example program "Sound File to Sound Output.vi" when a sound file is opened for reading.  The VI works, but the Not-a-Refnum? is True.

 

DaveT

-------------------------------------------------------------
David Thomson Original Code Consulting
www.originalcode.com
National Instruments Alliance Program Member
Certified LabVIEW Architect
Certified Embedded Systems Developer
-------------------------------------------------------------
There are 10 kinds of people: those who understand binary, and those who don't.
0 Kudos
Message 1 of 5
(2,634 Views)

Refnum to Path also doesn't seem to work with sound files...

-------------------------------------------------------------
David Thomson Original Code Consulting
www.originalcode.com
National Instruments Alliance Program Member
Certified LabVIEW Architect
Certified Embedded Systems Developer
-------------------------------------------------------------
There are 10 kinds of people: those who understand binary, and those who don't.
0 Kudos
Message 2 of 5
(2,616 Views)
Solution
Accepted by Dave_Thomson

This is a known limitation. The Sound VIs do not use a real LabVIEW refnum, they just abuse the file refnum type to disguise their own internel reference as a LabVIEW refnum. That has the advantage that you can not accidentially wire some other refnum or integer to those VIs, but doesn't make it work with the IsNotA Refnum() primitive. The RefnumToPath node anyhow never would work, even if those VIs used a real LabVIEW refnum, since that refnum would be a specific Sound Resource refnum, not a File Refnum (either normal or datalog file), which is the only refnum type where the Refnum to Path function works on for quite obvious reasons, since other resources in LabVIEW do not have a meaningful file path.

Rolf Kalbermatter
My Blog
Message 3 of 5
(2,568 Views)

Thanks, Rolf.  Makes sense.  I would suggest that a note to this effect in the online help for the sound file VI's might be a good idea!

 

DaveT

-------------------------------------------------------------
David Thomson Original Code Consulting
www.originalcode.com
National Instruments Alliance Program Member
Certified LabVIEW Architect
Certified Embedded Systems Developer
-------------------------------------------------------------
There are 10 kinds of people: those who understand binary, and those who don't.
0 Kudos
Message 4 of 5
(2,526 Views)

Note that is also true of refnums for Config files.  I've made some VI to handle those (see attachments).

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 5 of 5
(2,507 Views)