This is an old revision of the document!
Table of Contents
Screencast
In WebHMI, Screens or Dashboards are analogous to screens for HMI operator panels or graphic screens in SCADA systems.
Nowadays control and dispatching of production technological systems provide:
- Real and full current situation of all engineering systems at any time
- Quick and adequate emergency response.
- Ability to issue alarm messages on the monitor screen, printer, remote computer, mobile phone;
- Registration of all system events, which allows in many cases to establish the cause of the accident, its culprit, as well as to prevent its occurrence in the future;
- Quick and accurate response to changing environmental conditions;
- Receive objective information about the work and condition of all systems, timely inform dispatchers about the need to call service specialists in case of deviations from the standard indicators;
- Promptly make decisions in emergency, emergencies (fire, flooding, water, gas leaks);
The screencast serves to fulfil these requirements. It will provide the dispatcher with only the information it needs without having to manually switch the dispatcher part. You can create a context-sensitive environment to keep the operator focused.
Creating and managing screencast
Introduction
There a several steps to start using screencast.
- Create a role for screencast user with necessary permissions
- Check both dashboard's and role's permissions
- Create a screencast's user for an operator to login with.
- Find a special register with screencast page pointer. This is the only registry for each user who has enabled screencast mode.
- Put some page-link e.g., “/dashboard2.php?id=1” to screencast's link register to the dashboard via Lua script. At the creation moment, it would be empty. It is should start with
/
symbol. - Login with the new user credentials.
Role
Screencast user
You need to create a new user with “Screencast mode” checkbox enabled or you can edit an existing user.
Permissions check
Make sure that e.g., dashboard or screen you want to show available to a newly created role (in dashboard settings).
Link Register
To manage screencast user's casting there is a special register will be created at the same time as the user created.
The screencast's register has a _link
suffix in a name as a regular expression.
The screencast link for user “screencast1 will be wh_screencast1_link
.
Its address will be displayed as D998
for screencast1 user with id = 2, where 998 = 1000 - userId
.
In the Lua editor, you can link that register with GUI. If there are multiple screencast-mode users, make sure to select the corresponding link when editing.
While creating Lua script it would look like this:
This script will be considered further in the text.
Lua script
Lua script is a handler for screencast page, which will be cast to the user.
If you will do some research about how your system works, you will be able to create e.g., a context-sensitive system or work out the time-based rules and so on.
As the simplest example, you will see the automatic carousel.
timestamp = os.time() array = {"/dashboard2.php?id=10","/dashboard2.php?id=13","/dashboard2.php?id=30"}; index = 1 -- array = {"/dashboard2.php?id=20","/dashboard2.php?id=19","/dashboard2.php?id=8","/dashboard2.php?id=29"}; index = 1 -- Braubereich G2 Statuses DELAY = 15; change_time = timestamp + DELAY function main (userId) if os.time() >= change_time then index = index+1 ; if index > #array then index = 1 end WriteReg("wh_sc1_link", array[index]); -- sc1_link (D996@WebHMI ScreenCast) timestamp = os.time() change_time = timestamp + DELAY end DEBUG("current link in the register ="..R("wh_sc1_link")) DEBUG("change_time " .. os.date("%b %d %X",change_time) .. " /// " .. tonumber(change_time-os.time())) end
Testing
There is a video demo with a remote device's screen.
It is the screencast user just after signing in. A “Remember me” checkbox will help to avoid signing in for such devices, e.g., which have no input devices.
Screencast mode is enabled, hence homepage for the user is http://192.168.1.2/screencast.php
, where 192.168.1.2 static IP address of the WebHMI.
This page always redirects to the page, which set in the screencast register. As a Lua script changes it, reload will be initiated. As you can see there is the 15 seconds delay between the automatical switching.