Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

how to save 8 bit images from a TCP connection with a Smart Camera

Solved!
Go to solution

Hi again and thank you very much, that's what I needed a boolean input false. Now I can save the images in the computer. The problem now is that I have to

 

be clicking the SAVE button on the window which ask me for the path where to save the images. I've tried to modify the Local.vi (PC) for an automatic saving the whole day with no success. This is an example of a VI which I made, and there appears a Feedback node (red arrow).

 

 

iteration.PNG

 

 

 

 

In other VIs I made, i get this error:

 

 

 

relative path.PNG

 

 

 

 

 With other modification the Smart Camera looks like it be acquiring because the led ACQUIRE is  turned on, but in the folder do not appears anything. When I stop the VI the next image is a high number of images, but no one is being saved:

 

 

 

 

acquiring but not saving.PNG

 

 

 

Thanks for your help.

Impossible is nothing
0 Kudos
Message 11 of 18
(2,725 Views)

You wired the file number from inside the loop to the outside, then the filename comes back inside.  This isn't a legal loop, so it inserted a feedback node.  Odds are, the file path is undefined so it asks for a file name every time through the loop.

 

What you want to do is select a folder outside the loop (one time) for all the images.  Inside the loop, create a filename with a proper extension, like "Image %d.jpg" and append it to the folder path.  It should work much better.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 12 of 18
(2,724 Views)

Hi, I haven't writed anything because I've been trying to solve the problem with your comments, but I can't.

 

Now the file number is inside the loop. So, the feedback node helps or should I find another way to wire the selected path of File Dialog VI to Write to Binary File?

 

I placed the File Dialog VI outside the loop to select the folder one time, and I created the file name Image %d.jpeg, but I don't understood how to append it to the folder path (in Write to binary file?) Because if I connect the resulting string of Format Into String VI to file (use dialog)  in Write to binary file I get these messages:

 

"You have connected two terminals of different types. The type of the source is string. The type of the sink is file path." and well, of course it's obvious. But if I connect the resulting string of Format Into String VI and I run Remote.vi and Local.vi, I get the error showed in the image above: "Path is empty or relative, you must use an absolut path".

 

This is the current Local.vi that I have:
 
 
 
suggested.PNG
 
 
 
Thank you, I appreciate very much your answers.
Impossible is nothing
0 Kudos
Message 13 of 18
(2,706 Views)
Solution
Accepted by topic author bebin

Here is an example of the file naming part:

 

 File naming snippet.png

 

Bruce

Bruce Ammons
Ammons Engineering
Message 14 of 18
(2,703 Views)

Thanks for answer, I'll try it tomorrow 'cause I only have access to smart camera from monday to friday.

 

Regards,

 

 

Bebin

Impossible is nothing
0 Kudos
Message 15 of 18
(2,667 Views)

Hello, I'm very greatful for your help. Thank you very much. I'll try to save images at a highest velocity because the images are being saved at 9 or 10 frames per second and the Smart Camera have a frame rate of 60. Perhaps 40 frames per second could be a good frame rate for this project, anyway, I'll continue trying other ways.

 

Best regards

 

Bebin.

Impossible is nothing
0 Kudos
Message 16 of 18
(2,642 Views)

Hi Bebin,

 

I had similar problems as the ones you are having with the Smart Camera but with trying to store images on cRIO using the AF-1501 Analog Frame Grabber for cRIO and an analog camera.

 

Few suggestions here and there

 

a) I typically used Shared Variables to transfer images. I do not know how do Shared Variables benchmark compared to TCP IP connection but my guess is that performance is similar (which does not really help you). You can use change detection on the Shared Variable on the HostPC side in order to make that work.

 

b) I do not know about your application but if you need to store 60 fps images but you only need that speed for a short period of time I would suggest buffering images. Say for instance that you are only interested in 2 seconds (you have an external hardware trigger to the camera). Then I would suggest saving images in an array of images and then, after the fact, send them back to the host PC.

 

c) Depending on the application it might be clever just to send part of the image (ROI), that can speed up the whole process. The SmartCamera has a utility to reduce the size of the acquired image (achieving higher framerate) than might lead to your desired framerate.

 

d) Decimation might be an option for you (vertically/horizontally). I do not know what features you are trying to achieve and if the resolution needs to be VGA, but it would definately be an option in this case.

 

e) Finally if you really want to capture 60 fps for a long period of time I would not recommend to use the SmartCamera, but a higher end vision system: framegrabber + camera + PC. CameraLink or GigE cameras would be my first choice.

 

 

 

Carlos Agell

MoviMED

 

0 Kudos
Message 17 of 18
(2,624 Views)

Hi Carlos, thanks for your comments. I'm interested in the subsections b) and c) depending of results with the current VIs wich have been created. Of course I'd like make a different post instead of discussing here.

 

 

Regards

 

Bebin

Impossible is nothing
0 Kudos
Message 18 of 18
(2,604 Views)