Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

storing images on smart camera target

I'm trying to use a Labview program to control my NI Smart Camera using Active X. This is a steep learning curve for me. I have successfully used the LV vi to start a canned tutorial on the camera and return its pass response using stored images from one of the NI Tutorials, not yet working with the camera lens. Now I want to modify one of the canned tutorials and provide ONLY a passing image so the camera will always return a pass indication, and modify the same tutorial that accesses a failing image so my vi returns a fail. I modified the original tutorial and renamed images that are located on my development pc call tut1pass.jpg and tut1fail.jpg. My intent is that that inspection on the camera will access the pass and fail images on the dev. pc (the path is hardwired into the 'acquire image' step of the inspection) and output a pass or fail accordingly, but when I run the inspection I get the error message attached. It implies I need to store my pass & fail images ON THE TARGET camera at c:\User Images\. How do I do that? I didn't know my Smart Camera had a C drive.
0 Kudos
Message 1 of 23
(5,380 Views)

Hi wb2nvy,

 

If you want to access the images on the computer from the camera, you would have to create a custom step to use FTP to access your computer.  Similarly, you can access your Smart Camera over FTP to place files on it.  These would be the ways to do this.

Stephen Meserve
National Instruments
0 Kudos
Message 2 of 23
(5,353 Views)
Stephen, I'm not trying to do something unusual or different. Currently, I can load inspections that access .jpg files into the camera, and run them from the camera. I don't know if the camera has the tutorial jpgs loaded onto it by default, or it knows where to find them on the host pc. In any event, I just want to modify slightly what it's already doing, by changing the jpg's that it normally accesses when it runs the tutorial. Also, my question had to do with the error message, that says "Save the folder of images to the "c:\User Images" folder on the target." I didn't do this to begin with when the tutorial was running normally, so I don't understand why I have to do it now if I want to change one of the jpg images. And first and foremost,  does the camera have a C: drive? I thought it just had RAM. State another way, is this error message accurate?
0 Kudos
Message 3 of 23
(5,344 Views)

HI wb2nvy,

 

The camera does have a C:\ drive and this is where you are placing all of the files that you are running.  You can FTP into the camera to place files there without using VBAI.

Stephen Meserve
National Instruments
0 Kudos
Message 4 of 23
(5,343 Views)

In case you don't know how to FTP to the smart camera, you can open a window on your development machine (i.e. go to c:\) and type in the address bar at the top ftp://<IP Address of Smart Camera> and this will take you to the C drive of the smart camera where you can navigate to the User Images folder. I would recommend coping a folder (call it "My Images" for example) of the two images to this folder on the target and having the same folder ("My Images") on windows that you use in the Simulate Acquisition step. Then when the code runs on the smart camera it will look in the User Images folder for the "My Images" folder.

 

Hope that helps,

Brad

0 Kudos
Message 5 of 23
(5,338 Views)
Stephen, I think we're dancing around the problem without getting to the heart of it. As I said, following all the directions in the VBAI Tutorial book, I succeeded in loading Tutorials into the camera and running them, and somehow they access the respective jpg files, whether they're on the camera or on the host pc, I don't know where they are because when I load the inspection onto the camera, I'm not aware of the jpgs also being loaded to the camera, so I assume when the inspection on the camera runs, it's accessing the jpgs on the host pc. OR when the tutorial inspection is loaded into the camera, it also loads the jpgs & I don't know it, but the tutorial inspection runs ok that is loaded into the camera as long as I don't try to modify the jpgs. From this it seems I should be able to change the jpgs accessed by the inspection without having to go the ftp route. Seems like if the inspection on the camera defaults to the host pc location for the jpgs, I can modify those on the host, and either it will access them on the host or it will import them onto the camera when I load the inspection onto it. Where's the flaw in my logic?
0 Kudos
Message 6 of 23
(5,337 Views)

Those two examples on the smart camera already have a folder of images on the smat camera (that's why they work without the error). The smart camera doesn't access the images on the host PC when you run the inspection on the target. Something that might be confusing is that when you press the lower button to just run the current state, the state runs on the local PC, and so it will use the images on your PC and you won't get an error about the images not being on the target. When you press the top Run button for the full inspection, it downloads the inspection to the target and that's when it will look for the images you specified on the target, so if they aren't there, you will get an error. If you put your image in c:\documents and settings\Administrator\desktop\My Images\ it will look in that directory on the smart camera and since it probably won't be there it will try c:\user images\My Images\ and if you have copied them to this location using FTP, the inspection will run on the smart camera correctly.

 

Hope that helps,

Brad

Message Edited by Brad on 01-22-2010 08:39 AM
0 Kudos
Message 7 of 23
(5,332 Views)
Thanks Brad, now I understand. That error message implies an ftp transfer. I'll try it, but do I ftp the images to where you said to put them, C:\User Images\My Images\ or where the error message said to put them, C:\User Images\ ?
0 Kudos
Message 8 of 23
(5,329 Views)
I would keep them in a seperate folder under User Images so the cycle through folder option in the Simulate Acq step works as you expect and you can keep folders of images for other inspections in that same location without interfering with each other. If you put all your images in the same root directory of User Images, you won't have a good way to cycle through just the images you want. 
0 Kudos
Message 9 of 23
(5,314 Views)
Understood. Thanks.
0 Kudos
Message 10 of 23
(5,311 Views)