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.


Messages - PJonHar

Pages: 1 [2]
16
Support Questions / Cannot Separate components
« on: March 15, 2017, 12:39:20 PM »
Hi,

I have being using the AdvancedHMI CLX Driver for testing in a Visual Studio app.
My normal procedure is download the latest AdvancedHMI project, Extract to a folder, Build the solution.

I then start a new Visual Studio project and reference the Driver dll's. THis has being working until just now? I referenced the new drivers i downloaded and i get the message:

Cannot Separate components from AdvancedHMI Solution. C:\Users\user\Projects\weld\LinearWelder\Linear Welder\bin\Debug\ - Please refer to the licensing agreement.

Any Ideas?

Thanks.

17
Many thanks for confirming, I look forward to the release.

18
The limit is 124, at 125 it does not get into the DataReceived event.

Is it because they are REAL data types?

19
So, setting the value as 10 worked.

Just to clarify the actual size of the array is set as 10000. The samples value for testing purposes is only ever between 500-1000. So it should not read beyond?

Thanks

Paul

20
I do get an error, but it doesn't state what?

21
Hi,

Have looked at the following thread:
http://advancedhmi.com/forum/index.php?topic=940.msg4986#msg4986

I have changed my program to the following:

Code: [Select]
PLCConnection.BeginRead("WeldData.ChannelData[0].Data[0]", Samples)
Code: [Select]
Private Sub PLCConnection_DataReceived(sender As System.Object, e As MfgControl.AdvancedHMI.Drivers.Common.PlcComEventArgs) Handles PLCConnection.DataReceived
        If e.PlcAddress.Contains("WeldData.ChannelData[") Then
            Dim id As Integer
            Dim stemp As String = e.PlcAddress.Replace("WeldData.ChannelData[", "")
            stemp = stemp.Replace("].Data[0]", "")
            id = Convert.ToInt16(stemp)

            Dim NewChannelData As New ChannelData
            NewChannelData.Name = PLCConnection.Read("WeldData.ChannelData[" & id & "].Name")
            NewChannelData.Unit = PLCConnection.Read("WeldData.ChannelData[" & id & "].Unit")

            For i = 0 To Samples
                NewChannelData.Data.Add(Convert.ToDouble(e.Values(i)))
            Next

            NewWeldData.Data.Add(NewChannelData)
            If id = 2 Then
                SQLDataAccess.InsertWeldData(NewWeldData)

                PLCConnection.Write("WeldTransferComplete", 1)
            End If
        End If
    End Sub

I have placed a break point in the in If statement of the DataReceived event, but it never gets inside it?

22
Support Questions / EthernetIPforCLXCom Reading 5000+ array of REAL
« on: April 18, 2016, 07:17:17 AM »
Hi All,

I am using a PLC to log data (5000+ points of REAL values).

Currently I am reading in the data like below, a For Loop for each index in the array. This stops my application from being used as the GUI can't be updated.

Code: [Select]
            Dim NewWeldData As New WeldData

            For i = 0 To 2
                Dim NewChannelData As New ChannelData
                NewChannelData.Name = PLCConnection.Read("WeldData.ChannelData[" & i & "].Name")
                NewChannelData.Unit = PLCConnection.Read("WeldData.ChannelData[" & i & "].Unit")
                For j = 0 To NewWeld.Samples
                    StatusUpdate("Retrieving Weld Information [" & i & "],[" & j & "]")
                    Dim value As Double = 0.0
                    Try
                        value = Convert.ToDouble(PLCConnection.Read("WeldData.ChannelData[" & i & "].Data[" & j & "]"))
                    Catch ex As Exception
                        StatusUpdate("Retrieving Weld Information Error, Trying Again...")
                        value = Convert.ToDouble(PLCConnection.Read("WeldData.ChannelData[" & i & "].Data[" & j & "]"))
                    End Try
                    NewChannelData.Data.Add(value)
                    'Sleep(20)
                Next
                NewWeldData.Data.Add(NewChannelData)
            Next

Is there a better way to read in an array of 5000+ REAL values?
Should I perform the same code in a separate thread that I could start in the background?

Thanks,

Paul

23
Support Questions / Re: DataSubscriber - Heavy CPU Load??
« on: April 18, 2016, 07:07:48 AM »
Just to let you know, the issue with the ever appearing message:

0F    Privilege violation    A permission/privilege check failed

Was actually that I was trying to access a tag that didn't exist.
Would it be possible to the Data Subscriber to check that the tag exists before adding it to its subscription thread, thus eliminating the need to keep checking for it?

24
Support Questions / Re: DataSubscriber - Heavy CPU Load??
« on: April 17, 2016, 03:05:31 PM »
Have done that, Is the attached of any meaningful information?

25
Support Questions / Re: DataSubscriber - Heavy CPU Load??
« on: April 17, 2016, 02:28:34 PM »
Thanks Archie,

That is looking better (see picture).

When running in debug with the newly patched driver, the immediate window is still populating with the error:

Code: [Select]
'A first chance exception of type 'MfgControl.AdvancedHMI.Drivers.Common.PLCDriverException' occurred in MfgControl.AdvancedHMI.Drivers.dll'
Cheers,

Paul

26
Support Questions / Re: DataSubscriber - Heavy CPU Load??
« on: April 17, 2016, 12:13:33 PM »
Hi,

I have referenced the newly patched library but there is no BeginInit and EndInit?

Thanks

Paul

27
Support Questions / Re: DataSubscriber - Heavy CPU Load??
« on: April 16, 2016, 08:06:10 PM »
Hi,

Thanks for the prompt reply!

So I added a DataSubscriber2 from the ToolWindow. I still populate the PLCAddress List via code. The threads are reduced greatly! (See picture 'threads').
However, The Immediate Window of Visual Studio when debugging is constantly populating with:

Code: [Select]
'A first chance exception of type 'MfgControl.AdvancedHMI.Drivers.Common.PLCDriverException' occurred in MfgControl.AdvancedHMI.Drivers.dll'
See picture 'immediate window'.

Any Ideas?

28
Support Questions / DataSubscriber - Heavy CPU Load??
« on: April 15, 2016, 08:11:45 PM »
Hi,

First of all thanks for the great library!

I have started a project and I am using the DataSubscriber in order to get notified of when a Tag changes value:
Code: [Select]
  Private ds As New AdvancedHMIControls.DataSubscriber

With ds
                .CommComponent = PLCConnection

                AddHandler .DataChanged, AddressOf DataChangedCallback
                .PLCAddressValue = "Value1"
                .PLCAddressValue = "Value2"
                .PLCAddressValue = "Value3"
                .PLCAddressValue = "Value4"

End With

However, When i run the project, all of my cpu cores pretty much max out and if i profile the application running there seems to be a thread for each of the subscriptions on the data subscriber, but they don't seem to be taking a great percentage of processing (see picture 1). The profile application also notices that 30+ other threads (see picture 2) have been created and running?

I am doing this the wrong way or is something not right?

Thanks,

Paul

Pages: 1 [2]