Results 1 to 3 of 3

Thread: OPC question

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    May 2004
    Location
    Granby, Qc, Canada
    Posts
    602

    OPC question

    I'm using OPCDAAuto.dll (OPC Automation 2.0) to connect to an OPC Server.

    Each time the event GlobalDataChange is raised, I change my value on the form.

    The problem I have right now is if for example there's an InputBox or a MsgBox opened when the event GlobalDataChange is supposed to be raise, it's not raise and I lose the change !

    Is there any way to avoid this ?

  2. #2
    New Member
    Join Date
    Aug 2007
    Posts
    4

    Re: OPC question

    Did you ever get this problem answered? I am having some timing issues also. I am missing some trigger bit changes while other trigger bits are running processes. My solution was to write the trigger changes to a Queue then process the queue after X number of events. This ensures I captures all trigger changes before processing any code however this isn't the best solution. I have two independent but identical processes running and while one acts on a trigger the same trigger for the second process gets missed. My queue solved this issue however I have to wait until 4 events are fired before processing any code from the triggers.

    I am now thinking that I need a second event that will fire after the queue is filled and add Application.DoEvents in that event so that other processes to capture the trigger bits can still capture the triggers.

    Now when I process code from a trigger the code is contained in different subs but it does set OPC bit while it processes and I am not sure if that is part of my problem. Also when I have two processes running and two groups with 6 items each running that the second process trigger bits generates a double bounce on changes, for example 1 and 1 for the same trigger bit then 0 and 0 for the same trigger bit where the first process trigger bits always show only a 1 then 0 trigger bit change. IF I only run one process I never see a double bounce. The double bounce will run the code twice when I only want it once. I trap the double bounce to ensure I get one 1 and one 0 before allowing another 1 to process code.

    Any ideas out there how to ensure I trap all OPC Event trigger bits and process code from those bits plus write back OPC bits in the process?

  3. #3
    New Member
    Join Date
    Aug 2007
    Posts
    4

    Re: OPC question

    Here is the reason why from Kepware tech:

    "I am not surprised. The OPC DA 2.0 Automation Wrapper is multi threading between the server and itself but single threaded to VB. Using global data change will improve performance but it is still possible that if the vb application is busy you will miss and update. Since this is occurring almost at the same time the VB app has not had a change to finish processing the first event when the second arrives. This is a legacy wrapper that was designed for use with VB 5 and 6 and the OPC foundation is not going to make any more changes to it. They have moved on to OPC 3.0 and .Net. We are not distributing and supporting the OPC Foundation .Net. We chose to develop our own .Net Development product called ClientACE. This product is completely multithreading and is a .Net Add-in. You can download a full functioning Demo of it from our Website. I would consider this rather than using the 2.0 wrapper and interop."

    So the triggers are being missed while other trigger bits are processing code due to "... single threaded to VB" This is using this opcdaauto.dll and its interop.

    I am going to switch to a direct communication addin to the PLC brand I am using.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width