Example Script: Creating User Interface:
'This script assigns a value to Tag by using graphical interface.
Imports System 'Importing necessary classes
Imports System.IO
Imports System.Windows.Forms
Imports Microsoft.VisualBasic
Namespace WinTr
Public Class MainClass
'Button is defined. Because of button's click event
'will be used it is defined with "Withevents" keyword.
Private Withevents btn as New Button
Private Textbox1 as new Textbox 'Textbox defined
Public Tag_1 as Uint16 'WinTr tag which will be
'accessed is defined in same
'name and Public type.
Public Sub Load 'Load procedure is defining.
'Script starts working within this procedure.
'WinTr tags should be accessed from this procedure.
'When this procedure finished working,
'WinTr tags can not be reached anymore from this script.
'------- Script Start Line -------
Dim frm as new form 'Form object defined which holds the interface.
textbox1.top=70 'textbox's location specified
textbox1.left=100
btn.top= 100 'button's location specified
btn.left=100
btn.text="Ok" 'buton's text specified
frm.controls.add(btn) 'button is added to form.
frm.controls.add(textbox1) 'textbox is added to form.
frm.showdialog 'form showed
'------- Script End Line -------
End Sub
'button's click handler is defined
Sub btnhandler(sender as object,e as system.eventargs) handles btn.click
Tag_1=val(textbox1.text) 'Textbox's value is assigned to Tag.
End sub
End Class
End Namespace