Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem on Gauging example

Hello
Does anyone know how to correct the example that i attach so the camera will continue to snap accordingly and if the PART ACCEPTED, ELVIS DO1 will sent a signal (by using DIGITAL INPUT OUTPUT function) and if the PART REJECTED, ELVIS DO2 will sent a signal.
Actually i obtain this example in LabView 7.1 (Toolkits and modules--> Vision-->Applications-->Gauging example.vi) and just to modified to suit my application.
 
Below are the software and hardware that i using.
NI ELVIS 2.0 PCI-6251
Image acquisition card PCI-1409
camera
LabView 7.1
Vision Toolkit 7.1
0 Kudos
Message 1 of 4
(3,443 Views)

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

0 Kudos
Message 2 of 4
(3,416 Views)
Hi Mike T
 
Thank you very much for your valuable information and reply.
 
How to implement a vi that snap according to the push button and than image with the name assign according will store in the PC.
 
Regards
HUP
 
 
0 Kudos
Message 3 of 4
(3,385 Views)

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

0 Kudos
Message 4 of 4
(3,374 Views)