Remote UI and location of panels/scripts/etc.

Find and share HowTos to various installations / configurations!
Search

Post Reply
11 posts • Page 1 of 2
n_lev
Posts: 73
Joined: Tue May 28, 2013 12:24 am

Remote UI and location of panels/scripts/etc.

Post by n_lev » Tue Jul 29, 2014 4:41 am

Hi!

I'm trying to work something out and was hoping someone might shed some light for me.

When I have a remote UI and a single server I would normally configure my Remote UI to point to the server for panels, scripts, libs, pictures, etc.

I normally have something like this in the config file:

Code: Select all


[general]
proj_path = "//Server/Proj/Server"
proj_path = "C:/Proj/Client"


The local folder on the client is pretty much empty and the remote folder on the server has all the panels, scripts, etc.
This means that if I update any panel or script, the client will automatically pick this change up.

Now, how would I do this in case of a redundant servers?
I've tried something like:

Code: Select all


[general]
proj_path = "//Server1/Proj/Server"
proj_path = "//Server2/Proj/Server"
proj_path = "C:/Proj/Client"

But this only works only if both servers are actually up and running. If one of them is offline, client complains about errors in the config file.
Any other ideas/pointers?

User avatar
mkoller
Posts: 741
Joined: Fri Sep 17, 2010 7:03 am

Re: Remote UI and location of panels/scripts/etc.

Post by mkoller » Wed Jul 30, 2014 11:19 am

You could instead use the HTTP mechanism: start the UI with -server http://reduHost1
Each redu host needs to have an HTTP Server running (using the webclient_http.ctl script).
The UI will contact given server for the config file, etc. but will then download all panels/images/... from the server of the active redu host.

The only problem is the start, as you can only pass 1 server in the URL and this must be running.
If it does not run, you need to try the second one (e.g. in a shellscript in a loop)

n_lev
Posts: 73
Joined: Tue May 28, 2013 12:24 am

Re: Remote UI and location of panels/scripts/etc.

Post by n_lev » Wed Jul 30, 2014 11:36 am

I had this on my list as a fallback option. Unfortunately we do not have the web-server licence on this project

User avatar
fmulder
Posts: 308
Joined: Wed Feb 03, 2010 8:46 am

Re: Remote UI and location of panels/scripts/etc.

Post by fmulder » Wed Jul 30, 2014 7:03 pm

There are other tools (like 'Robocopy' or 'rsync' ) that will let you synchronize the folders between the server and the client. You could easily setup a batchfile to synchronize the folders. You could do this manually or schedule the batch file.

I'm quite sure you'll find many other tools

Personally, I don't always like the fact that any change on the server immediately shows on the client. Using a good old memory stick atleast lets you control the moment when you want to transfer the files.

Note that there is also a script function called 'requestFileTransfer'. You could actually write some script that synshcronizes the files between server and client. You coulkd use 'getYoungerFiles()' to find all files since the last time when you synchronized.

Should cost you a couple of days to make, but might be a beautifull way to keep your clients in sync,

n_lev
Posts: 73
Joined: Tue May 28, 2013 12:24 am

Re: Remote UI and location of panels/scripts/etc.

Post by n_lev » Wed Jul 30, 2014 10:18 pm

My current solution is a batch file with some xcopy commands. I was just thinking that maybe there is a native WinCC OA way of doing this. I agree that it is not always necessary to update a client straight away. At the same time, once you do want update it, it's really annoying to run around the site with a memory stick for hours. Plus some clients might not be accessible at the time, so there's a risk of forgetting them. On my current project it would take me two days as clients are across town

User avatar
fmulder
Posts: 308
Joined: Wed Feb 03, 2010 8:46 am

Re: Remote UI and location of panels/scripts/etc.

Post by fmulder » Thu Jul 31, 2014 5:02 pm

If I were to do it, I would:

1) do a getFileNames() on the server and store the result in a dyn_string datapoint
2) A script on the client does a local 'getFileNames()' and then does a dpGet() against the dyn_string on the server
3) Then look for files that only exist on server
4) Then look for files that are newer omn the server
5) Don't forget to lo0ok for files that excist on client only. They may have to be deleted
6) then do a requestFileTransfer() for each of the files you wan tto have

You could call of this from a panel or from a script. I gues i would prefer to :

1) Make a datapoint element per workstation so that you can 'kick' the script from the server
2) Write the amount of files you want to transfer into a dp element (for the progress bar)
3) Show the result from 'getPendingFileTransferCount()' in a datapoint element so that you can display a progress bar on the server
4) Write the names of the files you transfer into an ascii file ( for 'evidence' )

Good luck. Should be a nice programming exercise !

Frenk

Gertjan van Schijndel
Posts: 634
Joined: Mon Aug 02, 2010 8:37 am

Re: Remote UI and location of panels/scripts/etc.

Post by Gertjan van Schijndel » Fri Aug 01, 2014 6:26 am

It might be more convenient to use the 'requestFileList' or 'getYoungerFiles' function. Because they can return only newer files, then a specific time and they can also work recursive. The 'requestFileList' function returns besides the filename also the size, time and md5hash.
I believe the file transfer functions are only available in a control manager, so calling them from a panel might not work.

There is a script 'fileSync.ctl' and library 'libFileSync.ctl', which can be used as an example for usage on the file transfer functions. In the online help there is some information regarding this script under Special functions -> Redundancy -> File synchronization

User avatar
lukas.schopp
Posts: 39
Joined: Wed Nov 03, 2010 1:40 pm

Re: Remote UI and location of panels/scripts/etc.

Post by lukas.schopp » Fri Aug 01, 2014 11:09 am

You can also use a versioning tool like CVS or SVN to manage your files on the server and update the files on each client via the tool mechanism.

As you know the Gedi in WinCC OA supports also CVS & SVN.

Best wishes
Lukas Schopp

n_lev
Posts: 73
Joined: Tue May 28, 2013 12:24 am

Re: Remote UI and location of panels/scripts/etc.

Post by n_lev » Sat Aug 02, 2014 12:03 am

All WinCC OA bases solutions using script look possible. One problem would be though, if you update the library files, you'd have to re-start the client so it can update the libraries.

As for versioning tool, it sounds great but only if all the computers involved are on the same network, same SVN repository, etc. It's rarely a case in my experience. Client machines are usually all over the place and we have little control over them. Will try on the next project.

Thanks for all the advice, guys!

User avatar
fmulder
Posts: 308
Joined: Wed Feb 03, 2010 8:46 am

Re: Remote UI and location of panels/scripts/etc.

Post by fmulder » Sat Aug 02, 2014 7:33 pm

The good news about using the scripting functions is :

- You'll use the exact same network infrastructure that WinCC Oa uses for its own messages !
- So no extra ports or other fiirewall issues !

Note that there are datapoints that will let you restart a WinCC OA manager. That is : a script could download files and could then restart the script.

Frenk

Post Reply
11 posts • Page 1 of 2