A Free HMI with Eye Catching Graphics is Now Available

Code:
Public Class Reporting
    Inherits Label
    Public Event ValueChanged As EventHandler
#Region "Basic Properties"
    Private SavedBackColor As System.Drawing.Color

    '* Remove Text from the property window so users do not attempt to use it
    <System.ComponentModel.Browsable(False)> _
    Public Overrides Property Text As String
        Get
            Return MyBase.Text
        End Get
        Set(ByVal value As String)
            MyBase.Text = value
        End Set
    End Property

    '******************************************************************************************
    '* Use the base control's text property and make it visible as a property on the designer
    '******************************************************************************************
    Private m_Value As String
    Public Property Value As String
        Get
            Return m_Value
        End Get
        Set(ByVal value As String)
            If value <> m_Value Then
                If value IsNot Nothing Then
                    m_Value = value
                    UpdateText()
                Else
                    m_Value = ""
                    MyBase.Text = ""
                End If
                '* Be sure error handler doesn't revert back to an incorrect text
                OriginalText = MyBase.Text

                OnvalueChanged(EventArgs.Empty)
            End If
        End Set
    End Property

    Private m_ValueLeftPadCharacter As Char
    Public Property ValueLeftPadCharacter() As Char
        Get
            Return m_ValueLeftPadCharacter
        End Get
        Set(ByVal value As Char)
            m_ValueLeftPadCharacter = value
            UpdateText()
            Invalidate()
        End Set
    End Property

    Private m_ValueLeftPadLength As Integer
    Public Property ValueLeftPadLength As Integer
        Get
            Return m_ValueLeftPadLength
        End Get
        Set(ByVal value As Integer)
            m_ValueLeftPadLength = value
            UpdateText()
            Invalidate()
        End Set
    End Property


    '**********************************
    '* Prefix and suffixes to text
    '**********************************
    Private m_Prefix As String
    Public Property ValuePrefix() As String
        Get
            Return m_Prefix
        End Get
        Set(ByVal value As String)
            m_Prefix = value
            UpdateText()
            Invalidate()
        End Set
    End Property

    Private m_Suffix As String
    Public Property ValueSuffix() As String
        Get
            Return m_Suffix
        End Get
        Set(ByVal value As String)
            m_Suffix = value
            UpdateText()
            Invalidate()
        End Set
    End Property


    '***************************************************************
    '* Property - Highlight Color
    '***************************************************************
    Private _Highlightcolor As Drawing.Color = Drawing.Color.Red
    <System.ComponentModel.Category("Appearance")> _
    Public Property HighlightColor() As Drawing.Color
        Get
            Return _Highlightcolor
        End Get
        Set(ByVal value As Drawing.Color)
            _Highlightcolor = value
        End Set
    End Property

    Private _HighlightKeyChar As String = "!"
    <System.ComponentModel.Category("Appearance")> _
    Public Property HighlightKeyCharacter() As String
        Get
            Return _HighlightKeyChar
        End Get
        Set(ByVal value As String)
            _HighlightKeyChar = value
        End Set
    End Property


    Private m_Format As String
    Public Property NumericFormat() As String
        Get
            Return m_Format
        End Get
        Set(ByVal value As String)
            m_Format = value
        End Set
    End Property

    Private m_ValueScaleFactor As Double = 1
    Public Property ValueScaleFactor() As Double
        Get
            Return m_ValueScaleFactor
        End Get
        Set(ByVal value As Double)
            m_ValueScaleFactor = value
            'TODO: Does not refresh in designmode
            'Text = MyBase.Text
        End Set
    End Property

    Public Enum BooleanDisplayOption
        TrueFalse
        YesNo
        OnOff
    End Enum

    Private m_BooleanDisplay As BooleanDisplayOption
    Public Property BooleanDisplay() As BooleanDisplayOption
        Get
            Return m_BooleanDisplay
        End Get
        Set(ByVal value As BooleanDisplayOption)
            m_BooleanDisplay = value
        End Set
    End Property
#End Region


#Region "date_Properties"
    Private _thnk_set_1 As BasicTextBox
    Private _thnk_set_2 As TextBox
    Private _thnk_set_3 As TextBox
    Private _thnk_set_4 As TextBox
    Private _thnk_set_5 As TextBox
    Private _thnk_set_6 As TextBox
    Private _thnk_set_7 As TextBox
    Private _BatchName As Label
    Private _Works As Label
    Private _Dates As DateTimePicker
    Private _Time As DateTimePicker
    Private _BatchID As Integer
    Public Property BatchName() As Label
        Get
            Return _BatchName
        End Get
        Set(ByVal value As Label)
            _BatchName = value
        End Set
    End Property

    Public Property thnk_set_1() As BasicTextBox
        Get
            Return _thnk_set_1
        End Get
        Set(ByVal value As BasicTextBox)
            _thnk_set_1 = value
        End Set
    End Property

    Public Property thnk_set_2 As TextBox
        Get
            Return _thnk_set_2
        End Get
        Set(ByVal value As TextBox)
            _thnk_set_2 = value
        End Set
    End Property
    Public Property thnk_set_3 As TextBox
        Get
            Return _thnk_set_3
        End Get
        Set(ByVal value As TextBox)
            _thnk_set_3 = value
        End Set
    End Property
    Public Property thnk_set_4 As TextBox
        Get
            Return _thnk_set_4
        End Get
        Set(ByVal value As TextBox)
            _thnk_set_4 = value
        End Set
    End Property
    Public Property thnk_set_5 As TextBox
        Get
            Return _thnk_set_5
        End Get
        Set(ByVal value As TextBox)
            _thnk_set_5 = value
        End Set
    End Property
    Public Property thnk_set_6 As TextBox
        Get
            Return _thnk_set_6
        End Get
        Set(ByVal value As TextBox)
            _thnk_set_6 = value
        End Set
    End Property
    Public Property thnk_set_7 As TextBox
        Get
            Return _thnk_set_7
        End Get
        Set(ByVal value As TextBox)
            _thnk_set_7 = value
        End Set
    End Property

    Public Property Works As Label
        Get
            Return _Works
        End Get
        Set(ByVal value As Label)
            _Works = value
        End Set
    End Property

    Public Property Dates As DateTimePicker
        Get
            Return _Dates
        End Get
        Set(ByVal value As DateTimePicker)
            _Dates = value
        End Set
    End Property

    Public Property Time As DateTimePicker
        Get
            Return _Time
        End Get
        Set(ByVal value As DateTimePicker)
            _Time = value
        End Set
    End Property


    Public Sub sh()
        MessageBox.Show(_thnk_set_2.Text)
    End Sub







#End Region


#Region "insert_DateBase"
    Public Sub insert_DateBase()
        Dim x As Integer

        Dim dt As DataTable = db.GetRecors("select * from BatchFinal")
        x = dt.Rows.Count + 1
        db.InsertBatchFinal(x, CStr(_BatchName.Text), CDbl(_thnk_set_1.Text), CDbl(_thnk_set_2.Text), CDbl(_thnk_set_3.Text), CDbl(_thnk_set_4.Text), CDbl(_thnk_set_5.Text), CDbl(_thnk_set_6.Text), CDbl(_thnk_set_7.Text), CStr(_Works.Text), Format(_Dates.Value, "yyyy/MM/dd"), CStr(_Time.Value))
    End Sub
#End Region









This code tool Label from your own library with the amendment when the value is enabled to be preserved
 
Dah Library of Delta plc site linking Delta Balvjul Basic
How do I write the address of the fairest numbers to letters mean instead of type 404 097 Type d0 and the like
 
This linking plc xgp On Balvjul BASIC possible way to tie pal AdvancedHMIBeta please
Imports Microsoft.VisualBasic
Public Class LS_XGB
Inherits System.ComponentModel.Component
Implements IComComponent, IDisposable






Private Const STX As Char = ChrW(&H2)
Private Const ETX As Char = ChrW(&H3) 'End Text [응답용Asc]
Private Const EOT As Char = ChrW(&H4) 'End of Text[요구용 Asc]
Private Const ENQ As Char = ChrW(&H5) 'Enquire[프레임시작코드]
Private Const ACK As Char = ChrW(&H6) 'Acknowledge[응답 시작]
Private Const NAK As Char = ChrW(&H15) 'Not Acknoledge[에러응답시작]
Private LockObject As New Object
Private SendLock As New Object

'* This is used to help problems that come from transmissions errors when using a USB converter
Private WithEvents SerialPort As New System.IO.Ports.SerialPort

Private SleepTime As Integer
Private StopThread, ThreadStarted As Boolean


Private FASONG As String = ""



Public mlNumber As Integer = 0





Public Function Read(ByVal startAddress As String) As String Implements IComComponent.Read
Dim SterCahr As String = RSet(startAddress, 1)
Dim m_ReadCoils As String = ""
Dim ReadCoils As String = ""
Dim Readvale As String = "0"
Dim Buffer As String = ""
Dim Length As Long = 0
Dim ReadHoldRegs As String = ""
Dim m_ReadHoldRegs, Regs As String
SyncLock (LockObject)


Select Case SterCahr

Case "M"
SerialPort.DiscardOutBuffer()
SerialPort.DiscardInBuffer()
'clear*the*receive*buffer*District
ReadCoils = m_StationAddress & "RSS0106%" & RSet(startAddress, 5)
m_ReadCoils = Strings.Chr(5) & ReadCoils & Strings.Chr(4)
SerialPort.WriteLine(m_ReadCoils)

Do
System.Windows.Forms.Application.DoEvents()
Buffer = Buffer & Convert.ToString(SerialPort.ReadExisting)
Length = Strings.InStr(1, Buffer, Chr(3), CompareMethod.Binary)
Loop Until Length <> 0
Readvale = Mid(Buffer, 12, 1)


Case "D"


SerialPort.DiscardInBuffer()
ReadHoldRegs = m_StationAddress & "RSB04%" & startAddress & "01"
m_ReadHoldRegs = Chr(5) & ReadHoldRegs & Chr(4)
SerialPort.Write(m_ReadHoldRegs)

Do
System.Windows.Forms.Application.DoEvents()
Buffer = Buffer & Convert.ToString(SerialPort.ReadExisting)
Length = Strings.InStr(1, Buffer, Chr(3), CompareMethod.Binary)
Loop Until Length <> 0
Regs = HexToDecChart(Mid(Buffer, 11, 4))
Readvale = HexNum(Regs)




End Select
End SyncLock
Return Readvale
End Function

Public Sub Write(ByVal startAddress As String, ByVal dataToWrite As String) Implements IComComponent.Write
Dim WriteCoils As String = ""
Dim m_WriteCoils As String = ""
Dim m_WriteHoldRegs As String = ""
Dim WriteHoldRegs As String = ""
Dim m_ReadCoils As String = ""
Dim Readvale As String = ""
Dim Buffer As String = ""
Dim Length As Long = 0

Dim SterCahr As String = RSet(startAddress, 1)

Select Case SterCahr

Case "M"
SerialPort.DiscardInBuffer()
SerialPort.DiscardOutBuffer()
WriteCoils = m_StationAddress & "WSS0106%" + startAddress + dataToWrite
m_WriteCoils = Chr(5) & WriteCoils & Chr(4)
SerialPort.Write(m_WriteCoils)

Case "D"
SerialPort.DiscardInBuffer()
SerialPort.DiscardOutBuffer()
WriteHoldRegs = m_StationAddress & "WSB04%" & startAddress & "0100" + Hex(dataToWrite)
m_WriteHoldRegs = Chr(5) & WriteHoldRegs & Chr(4)
SerialPort.Write(m_WriteHoldRegs)



End Select

End Sub

Private Sub SerialPort_DataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles SerialPort.DataReceived
'SyncLock (LockObject)
' Dim BytesToRead As Integer = SerialPort.BytesToRead

' Dim BytesRead(BytesToRead - 1) As Byte
' BytesToRead = SerialPort.Read(BytesRead, 0, BytesToRead)


' Dim m_Next As Boolean = False
' Dim strInData As String = String.Empty
' Dim strRetValue As String = String.Empty

' Dim start As Date = Date.Now
' Do
' Dim msg As String = SerialPort.ReadExisting()
' strInData &= msg

' Loop While Not m_Next

'End SyncLock
End Sub

Private Sub SerialPort_ErrorReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialErrorReceivedEventArgs) Handles SerialPort.ErrorReceived
If e.EventType = IO.Ports.SerialError.Frame Then
SerialPort.DiscardInBuffer()
End If
End Sub






End Class
 
This linking plc xgp On Balvjul BASIC possible way to tie pal AdvancedHMIBeta Please I am strongly in need to link Thank you very much
 
:(
I'm sorry, I'm from Egypt, we use this type frequently plc
This linking code plc xgp in AdvancedHMIBeta Please I am strongly in need to link Thank you very much
 
Last edited:
AdvancedHMI does not require writing of code. Follow the quick start on the main web site or the one included with the project.

For the driver, you will use the ModbusRTUCom
 


plc xgb

ModbusRTUCom

02- Read Input Status=p40=10065
03- Read Holding Registers=d0=40001
05- Force Single Coil=m0=00001
06 Preset Single Register=d0=40001




 


plc xgb

ModbusRTUCom

02- Read Input Status=p40=10065
03- Read Holding Registers=d0=40001
05- Force Single Coil=m0=00001
06 Preset Single Register=d0=40001

Follow these steps as explained in the Quick Start Guide

1) Download and extract AdvancedHMI
2) Open AdvancedHMI in Visual Studio
3) Build the solution
4) From the ToolBox, add a ModbusRTUCom driver to the form
5) Set the communication properties (e.g. ComPort, BauRate, etc.)
6) Add a BasicLabel to the form
7) Set PLCAddressValue to a Modbus address such as 40001
8) Run the application

 

Similar Topics

Have a GE IC200CPU002 running a alarm monitoring program All of them are inputs except for the alarm sounder Looking for a free HMI which would...
Replies
2
Views
806
The C-More remote HMI app on APP Store, Google Play and Amazon is now available free. The nominal charge has now been removed...
Replies
5
Views
2,358
Hi I have a phoenix contact installation and I'm looking for hmi software to manage my project better. It has to be as cheap as possible, free if...
Replies
3
Views
2,468
My brother recently bought a KEP HMI for a small project, he asked me to check out the software which is called EasyBuilder 8000...
Replies
1
Views
3,712
Hello, i have a data historian system it is a GE proficy historian. i need an application that can be used to display the data in a HMI format. i...
Replies
25
Views
9,526
Back
Top Bottom