Integrate values from WinCC OA to any webpage OR HowTo do a dpConnect via Websockets

Find and share HowTos to various installations / configurations!
1 post • Page 1 of 1
agruber
Posts:147
Joined: Tue Sep 07, 2010 2:52 pm

Integrate values from WinCC OA to any webpage OR HowTo do a dpConnect via Websockets

Post by agruber »

Starting in WinCC OA 3.15 the http server supports websockets.

Maybe you wonder what you can do with that. Of course you can query data from a client browser via javascript, but the huge benefit of websockets is the open connection from the server to the client. This means the server (in our case WinCC OA) can send data to a client (eg. a browser) which can react on it.

Now what does this mean for WinCC OA? ... dpConnect!

I have created a small example, just extract it to your project and start the ctl file with a CTRL manager. It will open an http server on port 2425.
Navigate to http://localhost:2425/data/winccoa_data.html . You will see a small messagebox, if you see the version "3.15" in the first field on the page, this was already read from the WinCC OA server. If that worked you can try dpConnect and dpGetPeriod. Once you have pressed the dpConnect button you will receive every value change for the connected DPE on the browser webpage. Of course the webpage can be accessed from other machines too if your firewall allows it.

Image

Serverside I have also added dpSet. It should be easy to integrate, just try it for yourself.

Note, this is far from perfect (error handling, security), but it should give an idea what can be done and maybe you can use/adapt it for your needs.

BR,
Andreas
Head of Customer Care https://www.winccoa.com/fileadmin/image ... ockets.zip
Attachments
oa_websockets.zip
(3.06 KiB) Downloaded 178 times
oa_websockets.png

1 post • Page 1 of 1