gOPCClassicConnector.gAsyncWriteOneItemCompleted Event

Top  Previous  Next

Description

Occurs when gAsyncWriteOneItem method is completed.

 

VB syntax

Private Sub gOPCClassicConnector_gAsyncWriteOneItemCompleted(sender As Object, transactionID As String, resultObject As gOPCClassicReadWriteObjectHandles gOPCClassicConnector.gAsyncWriteOneItemCompleted

 

C# syntax

private void gOPCClassicConnector_gAsyncWriteOneItemCompleted(object sender, string transactionID, gOPCClassicReadWriteObject resultObject)

 

Arguments

sender

OPC Classic Connector that raising this event.

 

transactionID

ID of asynchronous operation that caused this event.

 

resultObject

Object that holds information.

 

C# code example

  try

            {

                //Check transaction

                if (transactionID == txtTransactionID.Text)

                {

                    //Check ResultID, For writing do not care "Quality"

                    txtResultID1.Text = resultObject.ResultID.ToString();

 

                    //For a successfull write, ResultID sould be "S_OK" 

                    //For writing do not care "Quality"

                    if (resultObject.ResultID != Opc.ResultID.S_OK)

                    {

                        MessageBox.Show("OPC Classic Connector Tutorial Project: Error in asynchronous writing");

                    }

                }

            }

            catch (Exception ex)

            {

                MessageBox.Show(ex.Message);

            }