RobotStudio event

Value property problem

Options
Hi all,



The following code throws a generalException:



IRapidData iRD;

RapidData robTemp1;



robTemp1 = controller.Rapid.GetRapidData("T_ROB1","FORMATDEF1","myTest");

try

{

    iRD = robTemp1.Value;

}

catch (ABB.Robotics.GeneralException e)

{

...





From what I've been experimenting, it throws an exception only when "myTest" variable is too large.

This, when declared in FORMATDEF1.sys does not work:



Local PERS robtarget myTest{4,2}:=[[[[1731.77,-200,884.06],[2.69318E-05,-0.707507,0.706698,-0.00347952],[0,-1,-1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[1731.77,-200,884.06],[2.69318E-05,-0.707507,0.706698,-0.00347952],[0,-1,-1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]]],[[[1731.77,-200,884.06],[2.69318E-05,-0.707507,0.706698,-0.00347952],[0,-1,-1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[1731.77,-200,884.06],[2.69318E-05,-0.707507,0.706698,-0.00347952],[0,-1,-1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]]],[[[1731.77,-200,884.06],[2.69318E-05,-0.707507,0.706698,-0.00347952],[0,-1,-1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[1731.77,-200,884.06],[2.69318E-05,-0.707507,0.706698,-0.00347952],[0,-1,-1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]]],[[[1731.77,-200,884.06],[2.69318E-05,-0.707507,0.706698,-0.00347952],[0,-1,-1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[1731.77,-200,884.06],[2.69318E-05,-0.707507,0.706698,-0.00347952],[0,-1,-1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]]]];





but this works:



Local PERS robtarget myTest{3,2}:=[[[[1731.77,-200,884.06],[2.69318E-05,-0.707507,0.706698,-0.00347952],[0,-1,-1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[1731.77,-200,884.06],[2.69318E-05,-0.707507,0.706698,-0.00347952],[0,-1,-1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]]],[[[1731.77,-200,884.06],[2.69318E-05,-0.707507,0.706698,-0.00347952],[0,-1,-1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[1731.77,-200,884.06],[2.69318E-05,-0.707507,0.706698,-0.00347952],[0,-1,-1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]]],[[[1731.77,-200,884.06],[2.69318E-05,-0.707507,0.706698,-0.00347952],[0,-1,-1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[1731.77,-200,884.06],[2.69318E-05,-0.707507,0.706698,-0.00347952],[0,-1,-1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]]]];





Using robTemp1.ReadItem(1,1) works fine (but I'm not supposed to know the dimension of my arrays @ runtime so i'm in trouble !!!)



And here is the content of the General Exception thrown:



Name      "ABB.Robotics.GeneralException"



IsHResultValid     true



HResult     -1073445865



ExtendedErrorInformation     "Get in ABB.Robotics.Dcl.Internal.CmdServer
<-- ReadCurrentValue in ABB.Robotics.Dcl.Rapid.RapidDataBrowser [Dcl.RapidDataBrowser] Error: reading the current value of the data '/{45C85090-7199-4D62-AFDA-1613140ADD26}/RAPID/T_ROB1/FORMATDEF1/pPckTable' failed.
<-- Read in ABB.Robotics.Controllers.RapidDomain.RapidData
<-- get_Value in ABB.Robotics.Controllers.RapidDomain.RapidData "     string





1- Does that mean we shall avoid using the Value property in RapidData ?

2- Should we start a post for advising some way of programming for developers to earn a bit of time and energy ?



Example

- Use methods within try catch blocks instead of properties for setting signals because in case of failure methods fire exception

- Use ReadItem and WriteItem because they always work

...



3- When will Dimensions property be available for ArrayData ? I saw them in debug in _rapidinfo.Dimensions but they are not yet accessible as properties



Best Regards

Antoine