Applies To:
  • CitectSCADA 5.xx, 6.xx
  • CitectHMI 5.xx, 6.xx

Summary:
When using HTAs to view WebClient, my licences are not released upon closing the HTA, hence other clients cannot connect.
Also, when I view 'Processes' via Task Manager, there are still MSHTA processes running, however there are no HTAs running.
 

Solution:
This is due to a known issue with the Windows operating system and the MSHTA process.
In some circumstances the MSHTA process continues running even after the HTA is closed.

When using HTAs to view Citect WebClient (as per KB Q4281) the floating licence may not be released for other users after the Webclient session has closed.

In order to workaround this, you can create a custom 'X' close button through VBScript that will sit in the top right of the screen. Pressing this button will close the HTA by killing the MSHTA task.

NOTE: This will close all instances of MSHTA, which has the ability to affect other programs if they are using HTAs, but this is not a common practice.

The Code required to create an HTA to view your WebClient session (KB Q4281) and to add this custom 'X' close button is below.

It is possible to only change the BOLD writing to the IP of your WebServer, then paste the code into notepad and saved as a *.HTA file. Then run the HTA file whenever you wish to open a WebClient Session.

Obviously you can customise the settings below to suit you application, and the 'Fullscreen HTA' tool (available on the Citect ToolBox), will eventually be updated to allow adding the 'X' Close button as an option.


<HTML>
<HEAD>
<TITLE>CitectSCADA WebClient</TITLE>
<HTA:APPLICATION ID="oCitectWebClientHTA"
APPLICATIONNAME = "Citect"
BORDERSTYLE = 0
INNERBORDER = 0
NAVIGABLE = 1
SCROLL = "No"
BORDER = 0
CAPTION = "No"
SYSMENU = "No"
SHOWINTASKBAR = "No"
SINGLEINSTANCE = 0
WINDOWSTATE="Maximize">

<SCRIPT language="vbscript">
Option Explicit
Dim objWMIService
Dim objProcess
Dim colProcess
Dim strComputer
Dim strProcessKill

sub demo()
strComputer = "."
strProcessKill = "'mshta.exe'"
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colProcess = objWMIService.ExecQuery ("Select * from Win32_Process Where Name = " & strProcessKill)
For Each objProcess in colProcess
objProcess.Terminate()
Next
end sub
//-->
</SCRIPT>

</HEAD>
<STYLE>body {margin: 0px 0px 0px 0px;}
</STYLE>

<BODY>
<input type="button" onclick="call demo()" value="X" style="position:absolute; top:0; right:0; height=25px;Width=20px;z-index:50">
<IFRAME NAME="Frame1" SRC="http:\\127.0.0.1\CitectScada" style="position:absolute; top:0; left:0; height=100%;Width=100%"></IFRAME>
</BODY>
</html>
 

Keywords:
 

Attachments