When set, the control creates the browser and loads the URL defined.
The property is intended to be used by Rockwell FactoryTalk.
To use WebKitX in HMI environments you must set Enable_HMI_IO to True.
When set, the control creates the browser and loads the URL defined.
The property is intended to be used by Rockwell FactoryTalk.
To use WebKitX in HMI environments you must set Enable_HMI_IO to True.
Visual Basic |
---|
Public Property HMI_URL As String |
WebKitX implements a specific Loading Sequence that requires handling OnCreate and OnBrowserReady events before you can load your URL using the Open method. This requires full COM programming support by the OLE container software such as handling events, setting properties and calling methods. In Rockwell FactoryTalk the Loading Sequence is orchestrated simply by setting the HMI_URL property. The property can be retained by the executable.
Detailed example can be found in Getting Started with Rockwell FactoryTalk.
Option Explicit Private Sub Form_Resize() On Error Resume Next WebKitX1.Move 0, 0, ScaleWidth, ScaleHeight Err.Clear End Sub Private Sub Form_Load() ' Load Human Machine Interface markup WebKitX1.HMI_URL = "file:///" + App.Path + "/index.html" End Sub Private Sub WebKitX1_OnCreate(ByVal Settings As WebKitXCEF3Lib.ISettings, CommandLineSwitches As String) ' Set WebKitX HMI values to flush/refresh at rate 1Hz (every 1sec). Settings.hmi_input_clock_frequency_hz = 1 End Sub Private Sub WebKitX1_OnPageComplete(ByVal url As String) ' We use a timer at 60Hz to simulate high-frequency sensors. Timer1.Interval = (1000 / 60) Timer1.Enabled = True End Sub Private Sub Timer1_Timer() ' We read values from "sensors" and pass them to six (6) different HMI I/O channels. ' We read sensor values 60 times per second (every ~16ms). WebKitX uses input latches ' to retain input values and flush them to HTML at a rate of 1Hz (every 1sec). WebKitX1.HMI_VALUE_001 = Rnd * 1560 WebKitX1.HMI_VALUE_002 = Rnd * 1560 WebKitX1.HMI_VALUE_003 = Rnd * 1560 WebKitX1.HMI_VALUE_004 = Rnd * 1560 WebKitX1.HMI_VALUE_005 = Rnd * 1560 WebKitX1.HMI_VALUE_006 = Rnd * 1560 End Sub Private Sub WebKitX1_OnHMIControlSignal(ByVal Index As Long, ByVal Data As String) Debug.Print Format(Time, "HH:MM:SS") & " > HMI_VALUE_" & Format(Index, "000") & " = " & Data End Sub