Web Server Page Display


Recommended Posts

I am currently using the DF web server function with great success. However one of the pages I have has been setup as a template. The reason for this is that it displays a lot of data that is repeated for 30 different remote sites with 20 data points each. So when a user selects the option to view the page for a specific site a variable which acts like an array offset is passed on and the page then displays only data for the requested site.

This means I didn't have to set up 30 different pages! The problem is that I can't use the web server to show any on of the 30 remote units as it will only show the most recent one read by the operator. I understand why this is as there is only 1 page.

Is there a way that I can display these 30 pages for web server use. There must be some way by perhaps using the page.capture function. But I want the operator to be none the wiser that this is happening.

Link to comment
Share on other sites

The only way you could do this is to, as you suggest, use the Page.Capture() function on each of the 30 "pages" then FTP them to an offsite server (or I suppose let DAQFactory serve them). To do this, you'd need to create a second template that is a duplicate of the first, but that uses a different variable to select which of the 30 sites is displayed. The operator will only see the original template. Then, in script, you would step through the sites, changing this hidden template only, and capturing after each. Something like:

hiddensitenum = 0

delay(0.5)

page.capture("hiddentemplate","c:\web\site0.jpg")

hiddensitenum = 1

delay(0.5)

page.capture("hiddentemplate","c:\web\site1.jpg")

etc.

If you don't create the second template, then the local user is going to see you changing the site selection.

This has the added advantage that the web pages can look slightly different than then local display, for example, without local navigation buttons, etc.

Link to comment
Share on other sites

Thanks Guru.

It wouldn't be too hard for me to create a second page and perform the function as you describe.

I had another thought which may mean I wouldn't need the second page. Couldn't I just use a condition that uses the Page.strCurrentPage command. If the template page isn't active then perform the update for web purposes?

Link to comment
Share on other sites

I guess, but then the local user couldn't really switch to that page for the 30 seconds or so it will take to write 30 screen shots, or worse, if the local user leaves the local system on the template page then the web would never be updated.

Link to comment
Share on other sites

Does it actually take 1s to capture the screen? If so I may need to rethink how often I perform the update. Regardless, can your first concern be overcome by adding say a 0.1s delay between screen captures therefor allowing the an update if the user selects the template page?

Regarding your other concern, there is a login time out which returns the screen back to the homepage so the worst case scenario would be that the web pages wouldn't update for 15 mins.

Link to comment
Share on other sites

The required delay depends on how long it takes to render any graphs. I'd try delay(0.01) first, then increase if the captures aren't reasonable. I believe actually the captures all run in a single thread, so you may not need any delay, but remember that it still takes a finite amount of time to render the graphs, so even the capture() may take 0.2 or more seconds each.

As for the rest, its really an application specific issue. I just wanted to point out the areas of concern.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.