LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Get associated avi file from avi file reference

For normal bytestream files, there is a "refum to path" function (under File I/O -> Advanced File Functions) that will give the associated file path for the input file reference.  This does not seem to work when an AVI file reference (opened using IMAQ's AVI functions) is wired ("refnum to path" returns <Not a Path>).  Is there a way to extract the AVI file path from an AVI file reference?
0 Kudos
Message 1 of 7
(2,739 Views)
Hi Yuri33,

I have attached a file that should accomplish what you are attempting to do. Please let me know if this works for you. Thanks Yuri33 and have a great day!

Best regards,

Steven
0 Kudos
Message 2 of 7
(2,720 Views)
Your file is version 8.2.  I only have LV 8.0.1.  I would appreciate it if you could save your VI in my version, or provide an image of the block diagram.

Thanks.
0 Kudos
Message 3 of 7
(2,710 Views)
Hi Yuri33,

Here is the file saved in LabVIEW 8 format. Have a great day!

Best regards,

Steven
0 Kudos
Message 4 of 7
(2,699 Views)
Thank you for your VI, but this doesn't represent the solution that I wanted.  I need to create a subVI that takes in an IMAQ AVI file reference and outputs the associated path.  Do to the nature of the existing program, I only have access to the IMAQ AVI file reference.

Is there any other way to get this?
0 Kudos
Message 5 of 7
(2,691 Views)

Yuri33,

There is currently no way to obtain the file path from the avi reference.  I tried putting together some sort of workaround, and after checking with R&D, verified that there is no way to do this.

I will submit this as a product suggestion for R&D to take a look at in the future.

In addressing your current situation, my first question is, how does the architecture of your vi prevent you from getting the path from the point earlier in the vi when the avi is opened?

Regards,
Luke H

0 Kudos
Message 6 of 7
(2,663 Views)
Thanks for your help.  The design of my program involves streaming video to disk (along with multiple other parallel functions, including DAQ interfacing and collection, playing back AVIs in mediaplayer, etc.).  Because of this, I have multiple "engine" loops running in parallel to the user interface loop.  In the UI loop, the target of the streaming video can be changed or even turned off, so I have a LV2 functional global holding the AVI file reference, which the video streaming engine checks for validity before proceeding through a loop iteration.  However, in the engine, certain decisions about extra data that needs to be saved with the streaming video is made by checking the directory of the file it is instructed to write to.  Therefore, a way to extract that file name from the reference in the LV2 global would be usefull.  The workaround I have to use now is to store the file path as well as the AVI file reference in the LV2 global and pass them around together.  This isn't that bad, but in the intrest of keeping block diagrams uncluttered with data I shouldn't need, I posted the question. 
0 Kudos
Message 7 of 7
(2,656 Views)