Click or drag to resize

ModuleSearchRapidSymbol Method

General RapidSymbol search method.

Namespace:  ABB.Robotics.Controllers.RapidDomain
Assembly:  ABB.Robotics.Controllers (in ABB.Robotics.Controllers.dll) Version: 6.5.129.0
Syntax
C#
public override RapidSymbol[] SearchRapidSymbol(
	RapidSymbolSearchProperties sProps,
	string stDataType,
	string stRegex
)

Parameters

sProps
Type: ABB.Robotics.Controllers.RapidDomainRapidSymbolSearchProperties
Instance of RapidSymbolSearchProperties with the search properties
stDataType
Type: SystemString
Name of the datatype to search for. Use string.Empty if not of interest.
stRegex
Type: SystemString
The regular expression to search after. Use string.Empty if not of interest.

Return Value

Type: RapidSymbol
An array of RapidSymbol. If no RapidSymbol an array of lenght zero is returned.
Exceptions
ExceptionCondition
GeneralExceptionA General Exception has occurred.
Examples
This example retrieves all RapidData instances in the module that are used and declared on Module level. The name, datatype and value are added to a listview.
private void GetModuleData(Module m)
{
    try
    {
        RapidSymbolSearchProperties sProp = RapidSymbolSearchProperties.CreateDefault();
        sProp.SymbolType = SymbolTypes.Function | SymbolTypes.RapidData;
        sProp.IsInUse = true;
        sProp.Recursive = false;
        sProp.SearchMethod = SymbolSearchMethod.Block;

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

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

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

                // add datatype
                li.SubItems.Add(rd.DataType);

                // Get and add value
                IRapidData iVal = rd.Value;
                li.SubItems.Add(iVal.ToString());

                // Add item to listview
                listView1.Items.Add(li);
            }
        }
    }
    catch (System.Exception ee)
    {
        // Any error handling here
    }
}
See Also