creating target in RS
Options
I am trying to create a tag in RS using C# i have used below code
Code:
Code:
Station station = Project.ActiveProject as Station;
// Add target.
station.ActiveTask.Targets.Add(P5);
Error:
Error:
System.NullReferenceException: 'Object reference not set to an instance of an object.'
station was null.
Could someone support me to fix this?
Thanks!
Sugumar V
Could someone support me to fix this?
Thanks!
Sugumar V
0
Answers
-
I am not a C# programmer - looking at what the error is you may not have a station open in RobotStudio?
The other thing is you would get a RAPID error if you created a Robtarget just called P5 - it needs to have all the data a Robtarget requires eg position (x,y,z), orientation (Q1,Q2,Q3,Q4), etc0 -
Hello,You can stop your debugger just before the line and look if your station is well initialized and your P5.0
Categories
- All Categories
- 5.4K RobotStudio
- 382 UpFeed
- 14 Tutorials
- 12 RobotApps
- 291 PowerPacs
- 406 RobotStudio S4
- 1.8K Developer Tools
- 247 ScreenMaker
- 2.7K Robot Controller
- 281 IRC5
- 48 OmniCore
- 6 RCS (Realistic Controller Simulation)
- 3 RobotStudio AR Viewer
- 739 RAPID Programming
- 16 Wizard Easy Programming
- 105 Collaborative Robots
- 3 Job listings