RobotStudio event

API: Get collection of Speeds and Zones

Hello,
 

how do i get access through the API to the collections of speeds and zones, from which the user can choose active speeddata and active zonedata (picture below).

 

 image
Johannes Wiesehöfer
ABB Robotics
Friedberg

Comments

  • Hello,
     

    unfortunately there is no method in the RobotStudio API that gives you exactly this information, but the information is available in PC SDK.

     

    You can find the PC SDK dcumentation under RobotStudio 5.13/SDK on the Start Menu.

     

    Here is an example on how to find variables of a certain datatype (from the documentation):

     

    [CODE]

     

    private RapidSymbol[] GetSymbols(string stDataType, bool bSystem)
    {
    RapidSymbol[] result = new RapidSymbol[0];
    Task tRob1 = null;
    try
    {
    // Create temporary controller object to get task
    using (Controller c = new Controller())
    {
    tRob1 = c.Rapid.GetTask("T_ROB1");

    if (tRob1 != null)
    {
    RapidSymbolSearchProperties sProps = RapidSymbolSearchProperties.CreateDefault();

    // Setup sProps according to parameter bSystem
    if (bSystem == true)
    {
    // Search data that the task can see in System scope, e.g. Shared data

    sProps.GlobalSymbols = true;
    sProps.InUse = false;
    sProps.LocalSymbols = false;
    sProps.Recursive = false;
    sProps.SearchMethod = SymbolSearchMethod.Scope;
    sProps.Types = SymbolTypes.Data;
    }
    else
    {
    // Search Task scope
    sProps.Types = SymbolTypes.Data;
    sProps.InUse = false;
    sProps.SearchMethod = SymbolSearchMethod.Block;
    }

    // Perform the search
    result = tRob1.SearchRapidSymbol(sProps, stDataType, string.Empty);
    }
    else
    {
    // No task to search from
    }
    }
    }
    catch (GeneralException ee)
    {
    // TODO: Add error handling
    }
    catch (System.Exception ee)
    {
    // TODO: Add error handling
    }
    finally
    {
    // Release temporary resources
    if (tRob1 != null)
    {
    tRob1.Dispose();
    tRob1 = null;
    }
    }
    return result;
    }
    [/CODE]

    Best Regards, Niklas Skoglund
    ABB Robotics

    Developer Center
    RobotStudio Blog
  • thank you,
     

    this works fine.

     

     
    Johannes Wiesehöfer
    ABB Robotics
    Friedberg