API: Get collection of Speeds and Zones
in RobotStudio
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).
Johannes Wiesehöfer
ABB Robotics
Friedberg
ABB Robotics
Friedberg
0
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]
0 -
thank you,this works fine.Johannes Wiesehöfer
ABB Robotics
Friedberg0
Categories
- All Categories
- 5.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 249 ScreenMaker
- 2.7K Robot Controller
- 310 IRC5
- 59 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 786 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings