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

Pages: [1]
1
Support Questions / Re: Writing a new driver
« on: March 31, 2016, 07:18:10 AM »
Ah, yes I'm familiar with the SynchronizationContext. You could do it similar to "await" where the SynchronizationContext is captured at the time of subscription, and when the event handler is called, it posts to that context.

2
Support Questions / Re: Writing a new driver
« on: March 30, 2016, 02:00:56 PM »
Getting close.

The problem I'm running into now has to do with the event handler thread trying to update the GUI. I added the SynchronizingObject property to the driver similar to the example but it doesn't look like it's being set from anywhere.

This is what I added:

Code: [Select]
public System.ComponentModel.ISynchronizeInvoke SynchronizingObject
{
    get
    {
        if (m_SynchronizingObject == null && AppDomain.CurrentDomain.FriendlyName.IndexOf("DefaultDomain", System.StringComparison.CurrentCultureIgnoreCase) >= 0)
        {
            System.ComponentModel.Design.IDesignerHost host1;
            host1 = this.GetService(typeof(System.ComponentModel.Design.IDesignerHost)) as System.ComponentModel.Design.IDesignerHost;
            if (host1 != null)
            {
                m_SynchronizingObject = host1.RootComponent as System.ComponentModel.ISynchronizeInvoke;
            }
        }
        return m_SynchronizingObject;
    }

    set
    {
        if (value != null)
        m_SynchronizingObject = value;
    }
}

3
Support Questions / Re: Writing a new driver
« on: March 27, 2016, 08:27:48 PM »
Thanks for the quick response!

So, is any class that implements IComComponent supposed to have an event named DataReceived?

4
Support Questions / Writing a new driver
« on: March 27, 2016, 07:38:00 PM »
I've embarked on the task of writing my own driver, and I'm wondering how to implement BeginRead and BeginWrite in the IComComponent interface. Is there supposed to be a standard way of notifying the caller on completion? I don't see an event defined in the interface, just a delegate type.

Also, what do OwnerObjectID and TransactionNumber represent in PlcComEventArgs? Is TransactionNumber the same as sequenceNumber?

Thanks!

Pages: [1]