How to start a simulation using RobotStudio API
davare
✭
Hello,
Using RobotStudio Api I would like to open an existing station and Start a smiluation. Ideally with RobotStudio UI visible, and recording.
I am using the following powershell script:
Using RobotStudio Api I would like to open an existing station and Start a smiluation. Ideally with RobotStudio UI visible, and recording.
I am using the following powershell script:
Add-Type -Path "C:\Program Files (x86)\ABB\RobotStudio 2024\bin\ABB.Robotics.RobotStudio.dll"
Add-Type -Path "C:\Program Files (x86)\ABB\RobotStudio 2024\bin\ABB.Robotics.RobotStudio.Stations.dll"
[ABB.Robotics.RobotStudio.RobotStudioAPI]::Initialize("C:\Program Files (x86)\ABB\RobotStudio 2024\Bin")
$station = [ABB.Robotics.RobotStudio.Stations.Station]::Load("D:\01_Projects\digital-twin\Station\Station.rsstnx",$false)
[ABB.Robotics.RobotStudio.Project]::ActiveProject =$station
[ABB.Robotics.RobotStudio.Stations.Simulator]::ActiveConfiguration #To check there is an active sim config
[ABB.Robotics.RobotStudio.Stations.Simulator]::StartAsync()
But in this last line i receive the following error:
I guess probably my approach is incorrect. So I would really appreciate if you could please provide me some tips.
Thank you!
But in this last line i receive the following error:
Id : 22051
Exception : System.AggregateException: One or more errors occurred. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at ABB.Robotics.RobotStudio.Stations.Simulator.<StartAsync>d__59.MoveNext()
--- End of inner exception stack trace ---
---> (Inner Exception #0) System.NullReferenceException: Object reference not set to an instance of an object.
at ABB.Robotics.RobotStudio.Stations.Simulator.<StartAsync>d__59.MoveNext()<---
I guess probably my approach is incorrect. So I would really appreciate if you could please provide me some tips.
Thank you!
0
Categories
- All Categories
- 5.5K RobotStudio
- 394 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 249 ScreenMaker
- 2.7K Robot Controller
- 309 IRC5
- 59 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 785 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 4 Job listings