Ok, then I understand. There have been several discussions about similiar objectives before, and if you wish to read more broadly about it check out http://developercenter.robotstudio.com/Index.aspx?DevCenter=RobotCommunication&OpenDocument&Url=../RobotCommunicationAppManual/doc30.html .
For your problem I can provide the following example, given you have a RAPID module which has the variable you wish to manipulate. As far as I know there is no data type called “vector” in RAPID, but I could be wrong. This example manipulates a robot target variable, you can change the data type to fit with your application.
// Get a reference to the controller. This example simply picks the first controller available, you probably want to swap this for something more elegant
robotCont = new Controller(ABB.Robotics.RobotStudio.Controllers.ControllerManager.ControllerReferences[0].SystemId);
//find the task the vector variable is in
ABB.Robotics.Controllers.RapidDomain.Task tRob1 = robotCont.Rapid.GetTask(“T_ROB1”);
//get the data of the variable, NOTE: change “theMod” to your module and “myVar” to the name of your variable
ABB.Robotics.Controllers.RapidDomain.RapidData rd = tRob1.GetRapidData(“theMod”, “myVar”);
//This example modifes a robot target, not a vector
ABB.Robotics.Controllers.RapidDomain.RobTarget newTarget = new ABB.Robotics.Controllers.RapidDomain.RobTarget();
if (rd.Value is ABB.Robotics.Controllers.RapidDomain.RobTarget)
{
//Request mastership of Rapid before writing to the controller
using (Mastership.Request(robotCont.Rapid))
{
newTarget.FillFromString2(“[ [1800, 1000, 1600”], [1, 0, 0, 0], [1, 1, 0, 0], [ 9E9, 9E9, 9E9, 9E9, 9E9, 9E9] ]");
rd.Value = newTarget;
}
}
Hope this helps.