Zeclark Posted November 5, 2007 Report Share Posted November 5, 2007 Hello, it is my first message, I need to display JPEG images in LabVIEW 7.1 from a smart-camera using its IP address: When I use "Read JPEG File.vi" without path, I can paste the http address in the dialogbox to successfully display the image.. However, if I use the same address as a path or string constant in the block diagram, the program corrupts the link by adding a "\" and can't access the image: http:\//192.168.1.128/484833/productXX.jpg I know that I can display the image with the http address, but how can I use it in the block diagram without having it corrupted. Thanks! (I suppose it's the same with any image from internet) Quote Link to comment
Ton Plomp Posted November 5, 2007 Report Share Posted November 5, 2007 QUOTE(Zeclark @ Nov 4 2007, 09:31 PM) Hello, it is my first message, I need to display JPEG images in LabVIEW 7.1 from a smart-camera using its IP address: http://192.168.1.128/484833/productXX.jpg When I use "Read JPEG File.vi" without path, I can paste the http address in the dialogbox to successfully display the image.. However, if I use the same address as a path or string constant in the block diagram, the program corrupts the link by adding a "\" and can't access the image: http:\//192.168.1.128/484833/productXX.jpg I know that I can display the image with the http address, but how can I use it in the block diagram without having it corrupted. Thanks! (I suppose it's the same with any image from internet) Maybe you can set the path to relative (an absolute path will add the '\') or look at this post. This requires you to download the file to your HD (temp or whatever) and than load it into your VI. Ton Quote Link to comment
Zeclark Posted November 6, 2007 Author Report Share Posted November 6, 2007 I had no problem to use the code you suggested me, but it is too slow (800ms) for the real-time application (70ms) I program. How can I make a path relative for "Read JPEG File.vi", that .vi has no parameter for that. Thanks! Quote Link to comment
Justin Goeres Posted November 6, 2007 Report Share Posted November 6, 2007 QUOTE(Zeclark @ Nov 4 2007, 01:31 PM) When I use "Read JPEG File.vi" without path, I can paste the http address in the dialogbox to successfully display the image.. However, if I use the same address as a path or string constant in the block diagram, the program corrupts the link by adding a "\" and can't access the image: http:\//192.168.1.128/484833/productXX.jpg I know that I can display the image with the http address, but how can I use it in the block diagram without having it corrupted. The reason that you can paste the URL into the file browser when you leave the path input unwired is because Windows understands what a URL means in the file browser. In fact, I would bet that what's actually happening is that Windows (probably through IE?) is downloading the image from the URL to a temp file, then returning the path to that temp file to the Read JPEG File.vi VI. You just never see any of this happening because it's buried inside the VI and hidden by Windows. But that's different from passing a URL into a subVI via a path control. So Ton is right about the '\' character being added, but it actually doesn't matter because Read JPEG File.vi doesn't take a URL at its path input to begin with. The bottom line is that I don't think you can use Read JPEG File.vi to do what you want to do, unless you download the source image to your computer first and load it from there. But it sounds like that poses a speed problem for you . Maybe you could streamline the process by implementing the communications manually, i.e. manage a single TCP/IP connection in your program, do the transactions in raw form (so the data comes straight to your app rather than to the disk), and then convert the raw data you receive to something suitable for your picture control. But that's a fair bit of trouble to go through. You might also be able to display the picture in some sort of special ActiveX control, but I'm the wrong person to ask about that . Quote Link to comment
crelf Posted November 6, 2007 Report Share Posted November 6, 2007 QUOTE(Zeclark @ Nov 5 2007, 06:31 AM) I need to display JPEG images in LabVIEW 7.1 from a smart-camera using its IP address: http://192.168.1.128/484833/productXX.jpg Have you tried something like \\192.168.1.128\484833\productXX.jpg as the path? I don't know anything about the smartcam that you're using, but can you share the directory that the files are in and then just map the directory as a drive? Quote Link to comment
Zeclark Posted November 6, 2007 Author Report Share Posted November 6, 2007 Thanks Justin for the explication of why we can paste an URL in a dialogbox, but not directly in the .vi. Map the directory as a drive is a good idea, I contacted the camera company to know if it is possible. I also asked them if pictures can be directly uploaded on the computer HD. I hope those solutions will be fast enough. Quote Link to comment
MikaelH Posted November 6, 2007 Report Share Posted November 6, 2007 You could also use datasocket. //Mikael Quote Link to comment
Justin Goeres Posted November 6, 2007 Report Share Posted November 6, 2007 QUOTE(Zeclark @ Nov 5 2007, 12:32 PM) Thanks Justin for the explication of why we can paste an URL in a dialogbox, but not directly in the .vi. No problem. Just to be completely pedantic about it, here's a screenshot that demonstrates what I suspected: http://lavag.org/old_files/monthly_11_2007/post-2992-1194295069.png' target="_blank"> Quote Link to comment
crelf Posted November 6, 2007 Report Share Posted November 6, 2007 QUOTE(MikaelH @ Nov 6 2007, 06:35 AM) You could also use datasocket. Right - that's what tcplomp suggested above. QUOTE(Justin Goeres @ Nov 6 2007, 06:38 AM) Just to be completely pedantic about it... We've come to expect nothing less Quote Link to comment
Justin Goeres Posted November 7, 2007 Report Share Posted November 7, 2007 QUOTE(crelf @ Nov 5 2007, 03:23 PM) We've come to expect nothing less And you'll get nothing less! And you will like it. Quote Link to comment
Zeclark Posted November 7, 2007 Author Report Share Posted November 7, 2007 I found that I can't map the camera as a drive, but I will work to find a software to automatically download new images from the camera in a local folder. If I found a way, I will inform you. Thanks for help your mates! Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.