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 - JanVanDerZijden

Pages: [1]
1
Support Questions / Re: Advanced HMI Subscribe is not working
« on: August 07, 2014, 11:18:57 AM »
Hé, this is some good code, I have replaced it and I do not have the error anymore. There is only problem left: The eventhandler is only triggered once. Besides it is triggered again when a new subscription is added.

Here is the code where I think it not going good:

If SubscriptionThread Is Nothing Then
            SubscriptionThread = New System.ComponentModel.BackgroundWorker
            AddHandler SubscriptionThread.DoWork, AddressOf SubscriptionUpdate
            SubscriptionThread.RunWorkerAsync()
        End If

SubscriptionThread is not nothing here, so the handler is not added.

Thanks in advance!

2
Support Questions / Advanced HMI Subscribe is not working
« on: August 05, 2014, 03:56:10 AM »
Hi guys,

I am getting a error when trying to subscribe. The m_Plc.Read functions is working perfectly, but is going too slow for my application.

this is my code:

    private AdvancedHMIDrivers.EthernetIPforCLXCom m_Plc;
   
    public MainPageViewModel()
    {
       m_Plc = new EthernetIPforCLXCom();
   
       m_Plc.IPAddress = m_IPAddress;
       m_Plc.ProcessorSlot = Convert.ToInt32(m_ProcessorSlot);
       m_Plc.ComError += DoOnCommError;
       m_Plc.SubscriptionError += DoOnCommError;
   
       string testString = m_Plc.Read("MyTag"); 
       int index = m_Plc.Subscribe("MyTag", 1, 2000, testPlcReaded);
    }
   
     private void testPlcReaded(object sender, MfgControl.AdvancedHMI.Drivers.Common.PlcComEventArgs e)
     {
         try
         {
             Console.WriteLine(e.Values[0]);
         }
         catch (Exception ex)
         {
             Console.WriteLine(ex);
         }
     }

and this is the error I am getting:

    m_SynchronizingObject.BeginInvoke(SubscriptionList(i).dlgCallBack, z)
wich is in the folder: EthernetIPforCLXCom.vb.

there is a null-pointer to m_SynchronizingObject.

Error-details: System.NullReferenceException was unhandled by user code
  HResult=-2147467261
  Message=Object reference not set to an instance of an object.
  Source=AdvancedHMIDrivers
  StackTrace:
       at AdvancedHMIDrivers.EthernetIPforCLXCom.DataLinkLayer_DataReceived(Object sender, PlcComEventArgs e) in C:\prj\TLLAB\TLLAB\AdvancedHMIBeta363 (1)\AdvancedHMIDrivers\EthernetIPforCLXCom.vb:line 1269
       at MfgControl.AdvancedHMI.Drivers.CIP.OnDataReceived(PlcComEventArgs e)
       at MfgControl.AdvancedHMI.Drivers.CIP.DataReceivedEIP(Object sender, PlcComEventArgs e)

Pages: [1]