LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Display image in Smart camera web interface

Hi!

 

I need some assistance with LV-RT. 

 

What I have succeeded is to enalble the web server on NI 17XX camera and successfully displayed a VI with Image Display on it. I thikn I got the hang of it. 

What I would like to know is there another way to display images on the camera web page. I really do not need the whole VI up there just an image and a string with serial number. One way I know would work is to write an image file to the system memory and then embed that image to the web page, but I am not sure that is the best solution as writing process takes time and it is not recommended to write too often to the program memory (am I right?).

 

So, is there some way to assign some object to say a memory bank and display it (without having to install the runtime maybe) on the page?

 

Thank you for your attention,

Mart

0 Kudos
Message 1 of 10
(3,540 Views)

Hey Mart-

 

Are you currently using a custom web services or remote front panels? You could create your own web service that only displays the information that you are concerned about (in this case, your image and your string). Check out some of these tutorials on Web Services: Web Services in LabVIEW and LabVIEW Web Services. You might also want to take a look at the Web Publishing Tool under the Tools»Web Publishing Tool, and look at options other then Embedded.

 

Hope this helps.

 

-Ben

Hope this helps.
-Ben

WaterlooLabs
0 Kudos
Message 2 of 10
(3,525 Views)

Hi Ben,

 

I used the default web server and published the front panel with the Web Publishing Tool. With LV-RT you can only use the embedded version of it (Snapshot and Monitor are disabled as in rt-os there actually are no front panels) - wich means it will use the viewer computer run-time engine to create and embed the entire front panel object. I will check out the links you posted and reply soon.

 

 Märt

0 Kudos
Message 3 of 10
(3,497 Views)

Hi Again,

 

it seems that the web service version is just what I need. I read the material and had a look at the examples available. Then tried to get the image displayed but failed. Can anyone tell me how that should be done? I found no examles besides the xml and html ones.

 

Best regards,

Mart

 

 

0 Kudos
Message 4 of 10
(3,480 Views)

Hi i palyed around with the web services and this is what I did:

 

I used the Set HTTP response MIME Type to image/bmp.

Wired the image reference to write responce vi .

Added the Flush output vi.

 

The web service application is built to use streaming output type.

HTTP method is GET.

 

Built it, deployed no errors anymore (The camera did not have necessary software to use web services before)

Now, if I go to the web service URL I get only a blank screen. The site is there but nothing is displayed. What should I do?

 

Best regards,

Mart

0 Kudos
Message 5 of 10
(3,461 Views)

Hey Mart,

 

Are you able to display other data? It appears that you are attempting to post the images on the web server but are getting a blank screen. Are you able to get another simple example to post information to the URL? What are your settings in your Tools»Options...»Web Server: Configuration window? Could you submit a screenshot of these settings? Would it be possible to submit your code to see if something may be messed up with your code?

 

Hope this helps.

 

-Ben

 

Hope this helps.
-Ben

WaterlooLabs
0 Kudos
Message 6 of 10
(3,439 Views)

Hi Ben,

 

Thank you for answering again.

 

Yes, when I did not manage to diplay the image I tried with the web service demo with XML data and it worked fine.

 

Here is the image capturing code: Code

 

Here is the Web Server configuration: Cofiguration (note: I use port 81 because there was some sort of problem with 80, could not access it)

 

And here is the response from the client: Browser

 

As I mentioned I set up the service as in the web service exapmle for XML graph data and it worked fine (browser XML service)

 

Now, maybe the problem is that I need to create some sort of web page to display the image (as they did in Function Generator Demo)?

 

Best regards,

Mart

0 Kudos
Message 7 of 10
(3,416 Views)

Hey Mart,

 

You are correct. In the example that you are able to run, there is XML data being written by LabVIEW and then deployed using the HTTP commands. Then there is a script that reads the XML script. You will notice that the example is calling a "fcngen.swf" that then reads the data and displays it in your browser. So, to modify your code you would need to create a file or web page to display your images.

 

Hope this helps,

 

-Ben

Hope this helps.
-Ben

WaterlooLabs
0 Kudos
Message 8 of 10
(3,381 Views)

Now there is a problem. Would anyone be nice enough to supply a example how to create a site which can display the image. 🙂

What are the options anyway?

 

-Mart

0 Kudos
Message 9 of 10
(3,358 Views)

Hey Mart,

 

Going back to your original question; are you looking to stream images to a web page from your smart camera or simple see what your camera is seeing when you go to a particular site? Take a look at the sample project below. It is sort of a work around, but it posts an image to a web service. Essentially it snaps an image, saves it, and then posts the saved image to a web service. You will have to change the file path for the image, then build and deploy the webservice from the project view. Also, it would be beneficial to take a look at the webservice build specifications. The webbing to view the snapped image from your local machine would then be viewable from your web browsers at the address : "http://localhost/Stream_Service/ShowImag"
.

 

Let us know if you have trouble getting this example working. Also, perhaps another visit to what your end goal is would be helpful. What was it that you had working?

 

Hope this helps

 

-Ben

Message Edited by BCho on 04-10-2009 02:27 PM
Hope this helps.
-Ben

WaterlooLabs
0 Kudos
Message 10 of 10
(3,331 Views)