Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - abdala

Pages: [1]
1
Open Discussion / error modbus rtu and tcp
« on: May 03, 2018, 11:20:22 AM »
error modbus rtu and tcp

2
Why not use the protocol you CNET in PLC LS  IN Korea  FOR   protocol MODBUS RTU

From my experience to the JET program  protocol CNET
better than protocol MODBUS RTU

protocol MODBUS RTU  BAD

protocol CNET  GOOD


Please Add protocol CNET  to AdvancedHMI



3
How CreateGroupedReadList to Adress MX000 AND DW000 PX000

and max adress 16 bloek type


I,m using sours code modbus rtu the projact xgt ls


Code: [Select]
   Private Sub CreateGroupedReadList()
            SyncLock (SubscriptionLock)
                GroupedSubscriptionReads.Clear()
                SubscriptionListChanged = False

                Dim index, ItemCountToGroup, HighestElement, ElementSpan As Integer


                While index < SubscriptionList.Count
                    Try
                        '* optimize in as few reads as possible - try group reading
                        '* and perform in Async Mode
                        ItemCountToGroup = 0
                        ElementSpan = HighestElement - SubscriptionList(index).Address.Element
                        While (index + ItemCountToGroup + 1) < SubscriptionList.Count AndAlso
                            SubscriptionList(index + ItemCountToGroup).Address.ReadFunctionCode = SubscriptionList(index + ItemCountToGroup + 1).Address.ReadFunctionCode AndAlso
                            SubscriptionList(index + ItemCountToGroup).Address.BitsPerElement = SubscriptionList(index + ItemCountToGroup + 1).Address.BitsPerElement AndAlso
                            ((SubscriptionList(index + ItemCountToGroup + 1).Address.Element + SubscriptionList(index + ItemCountToGroup + 1).Address.NumberOfElements) - SubscriptionList(index).Address.Element) < m_MaxReadGroupSize AndAlso
                            SubscriptionList(index + ItemCountToGroup).Address.Address.ToUpper = SubscriptionList(index + ItemCountToGroup + 1).Address.Address.ToUpper

                            ItemCountToGroup += 1
                        End While
                    Catch ex As Exception
                        Throw
                    End Try

                    ElementSpan = (SubscriptionList(index + ItemCountToGroup).Address.Element - SubscriptionList(index).Address.Element)
                    '* Correct is the last element is a 32 bit read
                    If SubscriptionList(index + ItemCountToGroup).Address.BitsPerElement > 16 Then
                        ElementSpan += CInt(SubscriptionList(index + ItemCountToGroup).Address.BitsPerElement / 8) - 1
                    End If

                    Dim sr As New SubscriptionRead
                    sr.Address = SubscriptionList(index).Address.Address
                    '* Are we using a single bit from an integer?
                    If SubscriptionList(index).Address.BitNumber >= 0 Then
                        '* If so, then only subscribe to the word
                        If SubscriptionList(index).Address.Address.LastIndexOf(".") > 0 Then
                            sr.Address = SubscriptionList(index).Address.Address.Substring(0, SubscriptionList(index).Address.Address.LastIndexOf("."))
                        End If
                    End If
                    sr.NumberToRead = (ElementSpan + 1)

                    GroupedSubscriptionReads.Add(sr)
                    index += (1 + ItemCountToGroup)
                End While
            End SyncLock
        End Sub





plasee help

4
Support Questions / erorr ModbusRTUCom1 in plc ls xgb
« on: May 20, 2017, 12:36:58 PM »
erorr ModbusRTUCom1 in plc ls xgb

https://e.top4top.net/m_505taa0n1.wmv



this Adress     00013    MD

M00A
M00B
M00C



When you add this address, the program runs slowly


what should I do

Please Help


5
Application Showcase / AdvancedHMI v3.99w IN LS XGT
« on: May 14, 2017, 05:24:46 AM »

AdvancedHMI v3.99w IN PLC LS XGT

XgtCnetCom

Adress

%DW000

%MX000

%PX000

LINK
https://up.top4top.net/downloadf-499h7i7h1-7z.html

6
Support Questions / HOW Using SimpleWebServer the form
« on: May 12, 2017, 08:16:37 AM »
HOW Using SimpleWebServer the form

7
Support Questions / error ModbusRTU or BeginWrite
« on: February 10, 2017, 11:57:27 AM »
 error  ModbusRTU or BeginWrite in m_SwapBytes is True
 or
 error  ModbusRTU or BeginRead in m_SwapBytes is False

this AdvancedHMIv399t
Modify message

8
Additional Components / new driver conact plc ls xgb
« on: November 18, 2016, 08:51:25 AM »
XGT_Dedicated_Protocol new driver conact plc ls xgb
TO open Read and Write All

link Page plc ls

http://www.lsis.com/product/depth2.aspx?d1=A03&d2=002

Address:

inpout

PX000

Ouput

PX040

MX000


DW000


Protocol XGT Server Conect

plc Type

XGB

MK

plase add to Library to MfgControl.AdvancedHMI.Drivers.dll



link
http://gulf-up.com/do.php?id=206833

thenk  you

9
Support Questions / How Add BitFlag BasicButton ModbusRTU
« on: November 03, 2016, 01:34:21 AM »
 How Add BitFlag BasicButton ModbusRTU
PLC LS


10
Additional Components / The new ReportingD
« on: September 12, 2016, 07:44:43 AM »
Code: [Select]
Public Class ReportingD
    Inherits DataSubscriber2

    Private sw As System.IO.StreamWriter
    Private Sev As Boolean
    Private intCunt As Integer
    Private FullPaket As New List(Of String)
#Region "Properties"

    Private m_FileFolder As String = "C:"
    <BrowsableAttribute(True), EditorAttribute(GetType(FileFolderEditor), GetType(System.Drawing.Design.UITypeEditor))> _
    Public Property FileFolder As String
        Get
            Return m_FileFolder
        End Get
        Set(ByVal value As String)
            If value.Length > 0 Then
                '* Remove the last back slash if it is there
                If value.Substring(value.Length - 1, 1) = "\" Then value = value.Substring(0, value.Length - 1)
                m_FileFolder = value
            End If
        End Set
    End Property

    Private m_FileName As String = "PLCDataLog.log"
    Public Property FileName As String
        Get
            Return m_FileName
        End Get
        Set(ByVal value As String)
            If m_FileName <> value Then
                m_FileName = value
                If sw IsNot Nothing Then
                    sw.Dispose()
                    sw = New System.IO.StreamWriter(m_FileFolder & "\" & m_FileName, True)
                End If
            End If
        End Set
    End Property

    Public Enum TriggerType

        DataChange


    End Enum
    Private m_LogTriggerType As TriggerType
    Public Property LogTriggerType As TriggerType
        Get
            Return m_LogTriggerType
        End Get
        Set(ByVal value As TriggerType)
            m_LogTriggerType = value
        End Set
    End Property


    Private m_MaximumPoints As Integer
    Public Property MaximumPoints As Integer
        Get
            Return m_MaximumPoints
        End Get
        Set(ByVal value As Integer)
            m_MaximumPoints = value
        End Set
    End Property
#End Region

#Region "Constructor/Destructor"
    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
       
        MyBase.Dispose(disposing)
    End Sub
#End Region

#Region "Events"
    Private PointCount As Integer
    Protected Overrides Sub onDataChanged(ByVal e As MfgControl.AdvancedHMI.Drivers.Common.PlcComEventArgs)
        MyBase.OnDataChanged(e)
        If e.PlcAddress = "00001" Then
            Sev = CBool(e.Values(0))
           
        End If
 
        If m_LogTriggerType = TriggerType.DataChange Then
            If m_MaximumPoints = 0 OrElse PointCount < m_MaximumPoints And Sev = True Then
                StoreValue()
                PointCount += 1
            End If
        End If
    End Sub

   

   
    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(FullPaket(0).ToString), CDbl(FullPaket(1).ToString), CDbl(FullPaket(2).ToString), CDbl(FullPaket(3).ToString), CDbl(FullPaket(4).ToString), CDbl(FullPaket(5).ToString), CDbl(FullPaket(6).ToString), CDbl(FullPaket(7).ToString), CDbl(FullPaket(8).ToString), CStr(1), StringToWrite2)
    End Sub
    Dim StringToWrite2 As String
    Private Sub StoreValue()
        Try


            StringToWrite2 = Date.Now

            FullPaket.Clear()


            For Each item In PLCAddressValueItems
                If item.ScaleFactor = 1 Then

                    FullPaket.Add(item.LastValue)
                Else
                    Try

                    Catch ex As Exception

                    End Try
                End If
            Next

            If Sev = True Then
                intCunt = 1
                If intCunt = 1 Then
                    insert_DateBase()
                    FullPaket.Clear()
                End If
                Sev = False
                intCunt = 0
            Else
                Sev = False
                intCunt = 0
            End If


        Catch
        End Try
    End Sub
#End Region

Public Sub InsertBatchFinal(ByVal BatchID As Integer, ByVal BatchName As String, ByVal Tank1 As Double, ByVal Tank2 As Double, ByVal Tank3 As Double, ByVal Tank4 As Double, ByVal Tank5 As Double, ByVal Tank6 As Double, ByVal Tank7 As Double, ByVal Tank8 As Double, ByVal Works As String, ByVal Dates As String)
        Dim sqlstr As String = "INSERT INTO BatchFinal (BatchID, BatchName, Tank1, Tank2, Tank3, Tank4, Tank5, Tank6, Tank7, Tank8, [Work], [Date])VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?,?)"
        Dim cmd As New OleDbCommand(sqlstr, conn)
        cmd.Parameters.AddWithValue("@BatchID", OleDbType.VarChar).Value = BatchID
        cmd.Parameters.AddWithValue("@BatchName", OleDbType.VarChar).Value = BatchName
        cmd.Parameters.AddWithValue("@Tank1", OleDbType.Double).Value = Tank1
        cmd.Parameters.AddWithValue("@Tank2", OleDbType.Double).Value = Tank2
        cmd.Parameters.AddWithValue("@Tank3", OleDbType.Double).Value = Tank3
        cmd.Parameters.AddWithValue("@Tank4", OleDbType.Double).Value = Tank4
        cmd.Parameters.AddWithValue("@Tank5", OleDbType.Double).Value = Tank5
        cmd.Parameters.AddWithValue("@Tank6", OleDbType.Double).Value = Tank6
        cmd.Parameters.AddWithValue("@Tank7", OleDbType.Double).Value = Tank7
        cmd.Parameters.AddWithValue("@Tank8", OleDbType.Double).Value = Tank8
        cmd.Parameters.AddWithValue("@[Work]", OleDbType.VarChar).Value = Works
        cmd.Parameters.AddWithValue("@[Date]", OleDbType.VarChar).Value = Dates

        conn.Open()
        cmd.ExecuteNonQuery()
        conn.Close()
    End Sub

End Class




11
please can you up load source code modbus rtu new 2016_7

thank you

Pages: [1]