I have an automatically generated RAPID file, which I need to test for collisions using RobotStudio. I can load and run the program file on the virtual controller using the RAB API. The problem is that the program runs on the virtual controller in real time - because I have many RAPID files to test, running in real time significantly increases simulation time of my application.
For this reason I would like to synchronize to the station and run the simulation in RS.
The way I was going to try this is as follows:
read RAPID file (StreamReader)
extract jointtarget values/names and path name from file
create RSJointTargets and MoveAbsJ objects, with extracted values/names
Add objects to Station.ActiveTask
Call Start() method in Simulator class
Is it neccessary to program all of these steps or is there a faster method available using the RS API?
None of the methods in the ABB.Robotics.RobotStudio.Stations.Simulator class are available (start, stop, pause etc.) after creating an instance. When I try to build, I get the error:
“The type ‘ABB.Robotics.RobotStudio.Stations.Simulator’ has no constructors defined”
Is this class available?
Are there any methods within the RS API to synchronize to station?
Are there any methods within the RS API to play the simulation in RS (not Robotics.Controllers.RapidDomain.Task.Start())?
The virtual controller is the core technology that is driving the simulation in RobotStudio. Running the simulation from RobotStudio will not be faster than running the virtual controller outside RobotStudio. There may be a minor difference in execution time if you use the “Free Run” mode of RS, but only marginally.
The static Simulator.Start() method works as you said.
I’ve also tried 2 different ways of running the robot program in RS:
RS API:
Simulator.Start()
RAB API
Task tasks = null;
//controller object created from Scan() method
tasks = controller.Rapid.GetTasks();
using (Mastership m = Mastership.Request(controller.Rapid))
{
tasks[0].ResetProgramPointer();
tasks[0].Start(RegainMode.Continue, ExecutionMode.Continuous, ExecutionCycle.Once);
}
The program is executed much faster than real time (total execution time is approximately 2s)
The program appears to execute in real time (total execution time is approximately 12s)
Both methods are running the same RAPID program on the same virtual controller, but the Simulator.Start() will significantly decrease the execution time of my application.