Problem when modify robtarget through C#
                
                    ctkhai                
                
                     ✭                
            
                        
            
                    Dear All,
                
                     I'm doing a project which using C# to communicate with robot. I need to change the coordinate of the robot according of the input from customer. This is my first project with the pc sdk. Now I can read robtarget value and change "pos" value. But when I write back to rapid data it come out "An argument specified by the client is not valid for this type of operation."  Please advice. Thanks
Here is my code:
scanner.Scan();
ControllerInfoCollection controllers = scanner.Controllers;
controller = new Controller(controllers[0]);
RobTarget rt = new RobTarget();
RapidData rp = controller.Rapid.GetRapidData("T_ROB1", "MainModule", "pA2");
if (controller.OperatingMode == ControllerOperatingMode.Auto)
                {
                    using (Mastership m = Mastership.Request(controller.Rapid))
                    {                      
                        rt = (RobTarget)rp.Value;
                        rt.FillFromString2("[[342.7,120,289.71],[0.593903,-0.243372,-0.657579,-0.394511],[0,-1,2,0],[8.999999E+09,8.999999E+09,8.999999E+09,8.999999E+09,8.999999E+09,8.999999E+09]]");                 
                        rp.Value = rt;			//Error here
                  }                    
                }
                else
                {
                    MessageBox.Show("Automatic mode is required.");
                }
            }
            catch (System.InvalidOperationException ex)
            {
                MessageBox.Show("Mastership is held by another client. " + ex.Message);
            }
            catch (System.Exception ex)
            {
                MessageBox.Show("Unexpected error occurred: " + ex.Message);
            }
0  
            Answers
- 
            De RobTarget "pA2" has to be PERS and not CONST, is that the case?1
 
Categories
- All Categories
 - 5.6K RobotStudio
 - 401 UpFeed
 - 21 Tutorials
 - 15 RobotApps
 - 306 PowerPacs
 - 407 RobotStudio S4
 - 1.8K Developer Tools
 - 250 ScreenMaker
 - 2.9K Robot Controller
 - 363 IRC5
 - 81 OmniCore
 - 8 RCS (Realistic Controller Simulation)
 - 853 RAPID Programming
 - 31 AppStudio
 - 4 RobotStudio AR Viewer
 - 19 Wizard Easy Programming
 - 110 Collaborative Robots
 - 5 Job listings
 
