10-13-2006 04:24 AM
10-16-2006 03:09 PM
Hello hup,
Thank you for contacting National Instruments. I am assuming that you want the application to repeat itself with new images once the picture is displayed. To repeat the image acquisition, move the IMAQ Snap VI inside the while loop. Keep all the other IMAQ related VIs outside the while loop on the left and right sides. You can also delete the IMAQ Close VI. To ensure that the Snap VI is executed at the right time in the loop, pass the Error cluster to both edges of the while loop. Tiny squares called tunnels should appear at the edges of the loop when you do this. Right-click on any of the two tunnels, and select Replace with Shift Register. This will help to remember any errors that have occured as the loop iterates, and help coordinate the execution fo the Snap VI.
To get a better picture of what your application is doing, I would highly recommend that you flatten the sequence structure. Right-click on the edge of the sequence structure, and select Replace >> Replace with Flat Sequence. This will display all of your code on the block diagram at once, and illustrate the sequence of events that are occurring.
Unfortunately, I am unfamiliar with the API associated with NI-ELVIS to be of any help for the DO questions. Perhaps someone else in the forums can help out with this.
Regards,
Mike T
National Instruments
10-19-2006 11:27 PM
10-20-2006 12:33 PM
Hello HUP,
It sounds like you want to Snap an image upon command on a front panel control, and then have that image immediately saved to a file on disk. There is a shipping example that demonstrates how to acquire and save an image. In the Example Finder, browse by task to Hardware Input and Output >> IMAQ >> File Input and Output >> Snap and Save to File.VI.
To snap an image upon command of a front panel control, simply place an Event structure around the IMAQ Snap VI assuming that you are working with any package of LabVIEW other than Base. Make sure that the event structure only contains the IMAQ Snap VI and nothing else. Right-click on the edge of the Event Structure, and go to Edit Events Handled By This Case. In the Event Sources section of the Edit Events dialog window, select the boolean control that is on the front panel that you wish to use to snap the image. Select Value Change for the event in the Events section. Select OK, and run the code. The code will ask for the filepath of where you want the image to be saved, and then it will wait for you to push that front panel control. Once you push the control, the image will be taken and then saved to the location you specified.
Regards,
Mike T
National Instruments