How can you read/write to a large array of robtargets in the PCSDK?
Whenever I try to access an array of > 6 robtargets, the following exception gets thrown:
ABB.Robotics.Controllers.ControllerBufferOverflowException: The amount of data is to large to fulfill the request. Here an example of my code (if I change the testRobs array to {7} and add two more positions, the exception will be thrown):
==Rapid Variable===
PERS robtarget testRobs{5}:=[ [[0,0,0],[0.218963,0.314159,2.75,-0.0510062],[-1,0,-1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],
[[1,0,0],[0.218963,0.314159,2.75,-0.0510062],[-1,0,-1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],
[[2,0,0],[0.218963,0.314159,2.75,-0.0510062],[-1,0,-1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],
[[3,0,0],[0.218963,0.314159,2.75,-0.0510062],[-1,0,-1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],
[[4,0,0],[0.218963,0.314159,2.75,-0.0510062],[-1,0,-1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]]];
==C# Code===
ABB.Robotics.Controllers.RapidDomain.RapidData arr = controller.Rapid.GetRapidData(“T_ROB1”, “sVars”, “testRobs”);
if (arr.IsArray)
{
ArrayData ad = (ArrayData)arr.Value;
int aRank = ad.Rank; int len1 = ad.Length;
ArrayModes am = ad.Mode;
Debug.WriteLine("Rank: " + aRank);
Debug.WriteLine("Len: " + len1);
Debug.WriteLine("Mode: " + am.ToString());
int i = 0; for (i = 0; i < len1; i++)
{
string a = “[[” + i + “,0,0],[0.218963,0.314159,2.75,-0.0510062],[-1,0,-1,0],[8.999999E+09,8.999999E+09,8.999999E+09,8.999999E+09,8.999999E+09,8.999999E+09]]”;
ad[i].FillFromString(a); Debug.WriteLine(a);
}
using (Mastership.Request(controller.Rapid))
{
arr.Value = ad;
}
}