gOPCClassicConnector.gRemoveOneItemFromMonitorGroup Method

Top  Previous  Next

Description

Deletes monitoring defined with monitorObject.

After this operation, if all monitorObjects are deleted in group, group is also deleted.

 

VB syntax

gOPCClassicConnector.gRemoveOneItemFromMonitorGroup(groupName As StringByRef monitorObject As gOPCClassicMonitorObject)

 

C# syntax

gOPCClassicConnector.gRemoveOneItemFromMonitorGroup(string groupName, ref gOPCClassicMonitorObject monitorObject)

 

Parameters

groupName

Name of group that MonitorObject will be removed from.

 

monitorObject

A MonitorObject that specifies what itemID will be  removed.

 

Return Type

gOPCClassicFunctionResult

 

C# code example

  try

            {

                //Step1: Create a monitor object and assign ItemID you want to remove

                GelecekCommon.gOPCClassicMonitorObject monitor_object = new GelecekCommon.gOPCClassicMonitorObject();

                monitor_object.ItemID = txtItemID1.Text;

 

                //Step2: Apply gRemoveOneItemFromMonitorGroup method

                GelecekCommon.gOPCClassicFunctionResult function_result = gOPCClassicConnector1.gRemoveOneItemFromMonitorGroup(txtGroupName.Text, ref monitor_object);

 

                txtFunctionResult.Text = function_result.ToString();

 

                //Setp3: Check Result

                //For a successfull remove, function result should be "OK" and ResultID sould be "S_OK"

                if (function_result == GelecekCommon.gOPCClassicFunctionResult.OK)

                {

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

 

                }

            }

            catch (Exception ex)

            {

                MessageBox.Show(ex.Message);

            }