Click or drag to resize

RapidSymbolScope Property

Gets the scope of the RapidSymbol, i.e. TASK,MODULE,ROUTINE,...

Namespace:  ABB.Robotics.Controllers.RapidDomain
Assembly:  ABB.Robotics.Controllers (in ABB.Robotics.Controllers.dll) Version: 6.5.129.0
Syntax
C#
public string[] Scope { get; }

Property Value

Type: String
Examples
This example retrieves all RAPID data of type num in task T_ROB1. The returned RapidData are added to a listview with columns for name, value and declaring module.
private void btnSearch_Click(object sender,EventArgs e)
{
    try
    {
        // Create Task if not done
        if (tT_Rob1 == null)
            tT_Rob1 = ctrl.Rapid.GetTask("T_ROB1");

        RapidSymbolSearchProperties sProp = 
            RapidSymbolSearchProperties.CreateDefault();
        sProp.SymbolType = SymbolTypes.RapidData;
        sProp.IsInUse = false;
        sProp.SearchMethod = SymbolSearchMethod.Block;

        RapidSymbol[] datas = tT_Rob1.SearchRapidSymbol(sProp,"num",string.Empty);

        RapidData rd;
        foreach (RapidSymbol rs in datas)
        {
            rd = rs as RapidData;

            if (rd != null)
            {
                ListViewItem li = new ListViewItem(rd.Name);

                try
                {
                    IRapidData iVal = rd.Value;

                    // Get value
                    li.SubItems.Add(iVal.ToString());
                }
                catch 
                {
                    li.SubItems.Add("N/A");
                }

                // [<TASK>,<MODULE>,...]
                li.SubItems.Add(rd.Scope[1]);

                // Add item
                listView1.Items.Add(li);
            }
        }
    catch (System.Exception ee)
    {
        // Handle any error here
    }
}
See Also