LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

avi valid reference

An AVI file can created or opened via "IMAQ AVI Create" or "IMAQ AVI Open," respectively.  Each of these subVIs produce an AVI File Reference.  Is there any way to check if that reference is valid?  The "Not a NaN/Path/Ref?" primitive always returns true for this datatype, regardless of whether the AVI file reference refers to a valid open file or not.  I have also tried other methods, all unsuccessful:

1)  I saw that the AVI file reference is really just a strictly typed datalog file reference (with datatype int32), but trying to typecaste it to a datalog reference and checking that reference for validity did not work. 

2)  You can typecaste the AVI file ref to an int32 that produces the same number as the probe of the reference, but this number stays the same whether the AVI reference is open or closed, so it does not help

3)  I tried to use the "IMAQ AVI Get Info" subVI so that I can trap an error and determine if the reference was valid, but this only works for read sessions of the AVI file reference (i.e., created with "IMAQ AVI Open").  A reference created by "IMAQ AVI Create" is a write session, and cannot be checked this way.

It seems like this should have already been implemented, but I guess LabVIEW treats the AVI file refernce quite uniquely.  Many of the primitives that work on references do not work on this datatype.  Is there any way to reproduce the functionality of "Not a NaN/Path/Ref?" for an AVI file reference?
0 Kudos
Message 1 of 5
(3,478 Views)
Hi,

I experienced this a couple of months ago, and here is the work around I used :




Message Edité par TiTou le 07-05-2007 09:22 AM


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 2 of 5
(3,459 Views)
I thank you for the idea, but I'm afraid it does not work as I wanted.  The attached image shows 3 examples illustrating my point.



In the first example (untitled1), "IMAQ AVI Create" is used, and both probes remain false.

In the second example (untitled2), "IMAQ AVI Open" is used, and both probes remain false.

In the third example (untitled3), "Open\Create\Replace File" is used, and the "Not A Reference" primitive is false for probe1 and true for probe2.  Note: if I use the "equal to Not A Ref" method for the third example (like for the first two examples), I get both probes remaining false as well.

I'm looking for a way to replicate the behavior of the third example for AVI file references.

Message Edited by Yuri33 on 07-05-2007 09:59 AM

0 Kudos
Message 3 of 5
(3,455 Views)
Hi Yuri33,

I think I understand the functionality that you are looking for, but I am not 100% sure. I have posted a vi that I think will do what you are trying to do. Please let me know if this works for you. If not, could you please clarify what specific functionality you are trying to achieve? Thanks Yuri and have a great day!

Best regards,

Steven C
0 Kudos
Message 4 of 5
(3,426 Views)
Yes, through all of my experiments, I have determined (like you) that the only way to do this is by simply trapping errors.  As a product suggestion, I would like to see NI implement the AVI File reference similar to regular file references in future versions of LabVIEW (or at least make it compatible with the "Not a Reference?" primitive or provide such functionality in a subVI, like "Not a Semaphore?").
0 Kudos
Message 5 of 5
(3,402 Views)