04-20-2017 03:43 AM
Ooops! Didn't realise (although it makes sense) that the express dialogs didn't work in subVIs. Have moved them out to the main VI in the hope it will work now (they pop up when I ran the VI, but then I got a bunch of errors because I had no camera).
I also added an error handler in the loop which might help you track down the source of problems, and an event for the stop button, since I realised if you started the VI and wanted to stop it with the old version, you had to go through the Acquire section first. Now it should stop when you click stop.
I'm sorry, I don't know what the problem with the picture box might be. Perhaps if it still doesn't work in this attached version, you could delete the picture box, and re-add it on your computer? It should only need reconnecting to the 'Handle' Invoke Node.
04-20-2017 03:59 AM
The picture box is there now! I didn't need to change anything to do with that. I made a small edit to the 'init timing' vi to include a control so that the 'set frame rate' dialog box could be connected (there was just a broken wire there).
As of now, your vi seems to work exactly as mine does with the addition of stopping correctly. Unfortunately, as before, the video that is captured cannot be played back.
Thanks,
Emma
04-20-2017 04:39 AM
04-20-2017 04:47 AM
I'm about as lost as you are! The FPS wire was connected when I opened this example . I don't see where the file opening issue could be coming from, from a Labview perspective. Thanks for giving it a go anyway.
04-20-2017 04:53 AM
Update: Just tried opening the files that I acquired with VLC player rather than Windows Media Player. Both the .wmv file and .avi file will open but are mostly empty. It appears to me that there's lots of dropped frames. The files only consist of 2/3 images rather than a video feed. Do we maybe need to incorporate something to do with a pixelclock to control the dropped frames?
04-20-2017 05:25 AM
Now I'm really guessing, but perhaps you can wire "DontWait" to the Capture node (in the main VI) and then use a case statement around IsFinished during acquisition? I can't quite tell what's supposed to happen with the 'Capture' method when you set it to wait, but it seems likely given what you said about missing frames that the problem might lie in the fact that you have no waiting/time control in the acquisition case. A simple (but probably inaccurate) fix might be to place a Wait (ms) node in the Camera On case and set it to wait round(1000/FPS) ms. More accurate measurements are probably needed but would be interesting if that worked...
04-20-2017 05:42 AM
I'm not sure what the "DontWait"/"Wait" does when wired to the capture node. I haven't tried adding in extra case structure that you suggested but I did add a Wait node into the CameraOn case. I was setting my FPS as 14 so I set Wait to be 70ms. I'm happy to say that this has worked! Interesting, isn't it?
11-15-2019 11:56 AM
Thanks everyone for this thread. It seems to be exactly what I need. I downloaded the latest zip file from cbutcher's response (04-20-2017 04:39 AM). The camera and live preview work, but it's not creating a file in the chosen directory. I also tried a few versions from emmab, and only the beginning one seems to create a file (though it's empty, and I think it makes sense why).
Can you offer any guidance on how to get it to output the video file? Even an empty or corrupt file would be a good start.
Thanks!
01-05-2023 02:48 PM
Hi
can you please suggest how to change the picture box in your vi to intensity graph.
Thank you.