Library VBScript WinCC

I´m creating an extern Library build with C# to extend the options fo WinCC and used with VBScript. Another to do the code more easy for the user.

Currently all the functions are available for WinCC and WinCC RT Professional (Tia Portal).

If you are interested you can download the library from Siemens forum, where I will update the different versions.

https://support.industry.siemens.com/tf/ww/en/posts/library-vb-net-c-com-vbscript-wincc/187312/?page=0&pageSize=10

 

string :GetUserGroup (string DataSourceRT, string CurrentUser)

string :GetMaxLimitTag (string DataSourceRT, string TagName)

string :GetMaxLimitTag (string DataSourceRT, string TagName)

string :GetDateTime() With Miliseconds

string :GetDateTimeFormat(string format)  (HH:mm:ss.fff) ; (MMMM dd, yyyy) ; (yyyyMMddHHmmss)

int :Sleep(int Miliseconds) Return 1 when the time is finished

int :GetRandom() By defaul 0-100

int :GetRandomNumber(int MinNumber, int MaxNumber)

int :StartProgram(string PathProgram, out string Message)

int :CloseProgram(string Program, out string Message) 'Program = Name of the process

void :Login()

void :Logout()

bool :LoggedInByCard()

void :SilentLogin(string login, string password)

string :GetUserGroupLogon(string DataSourceRT, string CurrentUser)

void :GetCursorPosition(out int x , out int y)

void : NormalWinCC()

void : MinimizeWinCC()

void : MaximizeWinCC()

 

Dim CurrentUser , DatasourceNameRT , Obj , return
Set CurrentUser = HMIRuntime.Tags("@CurrentUser")
Set DatasourceNameRT = HMIRuntime.Tags("@DatasourceNameRT")
Set Obj = CreateObject("VBScriptLibraryWinCC.dll")
return = Obj.GetUserGroup(DatasourceNameRT.Read , CurrentUser.Read)
HMIRuntime.Trace "Grupo Usuario: " & return & vbNewline

 

Dim Obj
Set Obj = CreateObject("VBScriptLibraryWinCC.dll")
return = Obj.StartProgram("C:\\xxx\\MyExportFile.csv",msg)
If return = -1 Then
HMIRuntime.Trace msg & vbNewline
End If

 

Dim Obj
Set Obj = CreateObject("VBScriptLibraryWinCC.dll")
return = Obj.CloseProgram("firefox",msg)
If return = -1 Then
HMIRuntime.Trace msg & vbNewline
End If

 

Dim Obj
Set Obj = CreateObject("VBScriptLibraryWinCC.dll")
Obj.Login()

 

Dim Obj
Set Obj = CreateObject("VBScriptLibraryWinCC.dll")
Obj.Logout()

 

Dim Obj , x , y
Set Obj = CreateObject("VBScriptLibraryWinCC.dll")
Obj.GetCursorPosition x , y
HMIRuntime.Trace "X : " & x & vbNewline
HMIRuntime.Trace "Y : " & y & vbNewline

 

Dim Obj
Set Obj = CreateObject("VBScriptLibraryWinCC.dll")
Obj.NormalWinCC() 

 

Dim Obj
Set Obj = CreateObject("VBScriptLibraryWinCC.dll")
Obj.MinimizeWinCC() 

 

Dim Obj
Set Obj = CreateObject("VBScriptLibraryWinCC.dll")
Obj.MaximizeWinCC() 

 

08 de Marzo del 2017

"La gratitud en silencio no sirve a nadie". Gladys Bronwyn Stern