gOPCClassicConnector.gRemoveItemsFromMonitorGroup Method

Top  Previous  Next

Description

Deletes monitoring defined with monitorObjects.

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

 

VB syntax

gOPCClassicConnector.gRemoveItemsFromMonitorGroup(groupName As StringByRef monitorObjects() As gOPCClassicMonitorObject)

 

C# syntax

gOPCClassicConnector.gRemoveItemsFromMonitorGroup(string groupName, ref gOPCClassicMonitorObject[] monitorObjects)

 

Parameters

groupName

Name of group that MonitorObjects will be removed from.

 

monitorObjects        

An array of MonitorObjects that specify what itemIDs will be  removed.

 

Return Type

gOPCClassicFunctionResult

 

C# code example

  try

            {

                //Step1: Create an array of monitor objects and assign ItemIDs you want to remove.

                GelecekCommon.gOPCClassicMonitorObject[] monitor_objects = new GelecekCommon.gOPCClassicMonitorObject[2];

 

                monitor_objects[0] = new GelecekCommon.gOPCClassicMonitorObject();

                monitor_objects[0].ItemID = txtItemID1.Text;

 

                monitor_objects[1] = new GelecekCommon.gOPCClassicMonitorObject();

                monitor_objects[1].ItemID = txtItemID2.Text;

 

                //Step2: Apply gRemoveItemsFromMonitorGroup method

                GelecekCommon.gOPCClassicFunctionResult function_result = gOPCClassicConnector1.gRemoveItemsFromMonitorGroup(txtGroupName.Text, ref monitor_objects);

 

                txtFunctionResult.Text = function_result.ToString();

 

                //Step3: Check results

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

                if (function_result == GelecekCommon.gOPCClassicFunctionResult.OK)

                {

                    txtResultID1.Text = monitor_objects[0].ResultID.ToString();

                    txtResultID2.Text = monitor_objects[1].ResultID.ToString();

 

                }

            }

            catch (Exception ex)

            {

                MessageBox.Show(ex.Message);

            }