LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

playing AVI files using invoke/property nodes

I'm trying to call 5 different AVI. files and play them all continuously (not simultaneously as I ststed in my previous ques) on the front panel. At the end of the program, I want to see the files play; 1,2,3,4,5 on Windows Media Player on the Front Panel. I saw the VI someone attached earlier, but that requires the user to hit play and stop and load and so on. I want to hardwire these into the code so that it just plays the files that the user tells it to.
I'm using invoke and property nodes to 1)load a file, 2)play the file, 3)stop the file....and then loop this 5 times.
Is this possible to instruct WMP to play these files? I've set the WMP on the front panlel to be an indicator, but the invoke & property nodes say th
ey need a reference or control. What do I have to reference it to, since I can't reference it to the same WMP?? Shouldn't I just have to give it a method such as Play, Load, or Stop and then reference the command to where I want it outputted???
I would really appreciate any help...thanks!!!

The VI I'm working on is on another comp at home, and I will attach it when I have access to it, to give insight to my problem.
0 Kudos
Message 1 of 8
(4,491 Views)
Here's one way to play an array of files sequentially. You can easily modify it to play them continuously of a set number of times.
Message 2 of 8
(4,491 Views)
Thanks for the VI Mr. Knutson, it is exactly what I am looking to do. However, an unexplained error comes up when I try to run the program. I dug into it a little and the sub VI "Load Movie" returns an error as well.

Could it be a problem with the methods of the invoke nodes? The file path is going through fine, it just seems like it's a problem with one of those methods.

I am using LabView 6.1, could I be missing an extra piece of required software apps for this application???

Thanks again!

-Dan S.
0 Kudos
Message 3 of 8
(4,491 Views)
It could be a problem with the version of media player. Offhand, I couldn't tell you what version I've got but I do have Win2K and IE 5.5. What is the error code and message that you get?
0 Kudos
Message 4 of 8
(4,491 Views)
The error occurs after the "play" command and the error code is: -2147467259, "unspecified error in Play Array of AVI Files.vi" I probed the duration wire and it returns a value of zero, which didn't seem right.

Like I said, the sub vi "Load Movie" will not run. I tried copying a version of WMP that does work and substitutied that into your VI, but when I hit the run button, it erases that WMP and opens up the original that does not work. I have Win2000, WMP 6.4.09.1109
Thanks again for the help.
0 Kudos
Message 5 of 8
(4,491 Views)
OK! Got it! I had to make a couple adjustments to the VI. The "duration" call was cutting off the length of my avi files, and I had to throw in a 50 msec delay in the play/stop while loop to get the video to play properly, but this has turned out to be a great VI for playing/modifying avi. files....Highly recommended, thanks!
0 Kudos
Message 6 of 8
(4,492 Views)
Hi! I am also facing the same problem of error -2147467259 while attempting to play my AVI files. Can you attach a copy of the vi that you have modified successfully to let me refer to ?

Thanks!
0 Kudos
Message 7 of 8
(4,095 Views)
In the event that dseaman does not reply to this post with his modified vi (it was, after all, 5 years ago when this post was originally created) I think you might try taking a look at this KnowledgeBase article. It contains resources on how you can use ActiveX commands to play your media files in LabVIEW as well as an example vi to help you get started.
If you are still experiencing the error, you might try making similar modifications to your vi that dseaman made. Try placing a timing vi in your while loop to ensure that your video file is not being truncated.
 
Cheers,
Emilie K. | Applications Engineering | National Instruments
0 Kudos
Message 8 of 8
(4,079 Views)