RobotStudio event

C# read var exception

Options
I constantly get an exception when reading from a dummy controller...

My code looks like this ( boiled down to the very basics )
var bDirect = c.Rapid.GetRapidData("T_ROB1", "MainModule", "aBool");
string sDirect = bDirect.StringValue;

I have tried using IRapidData as well, but I keep getting
"Can not evaluate because thread is not at a safe point"

I have a feeling that it is related to developing inside SharpDevelop, however, I have NEVER seen this exception before.

Is the ABB library doing something that breaks some thread safe rule in the .NET environment?

The stacktrace points to the exception originating from inside the ABB domain:
ABB.Robotics.GenericControllerException
   at Adapters.Data.Get
   at ABB.Robotics.Controllers.RapidDomain.RapidData.get_StringValue
   at -> HERE MY CODE COMES with its callstack

Any ideas about the origin of the problem...


Comments

  • RussD
    Options
    You should post any future questions related to RAB in the RAB forum instead, but Visual Studio is the only supported development environment.
     

    Also try using explicit type RapidData instead of var for bDirect. Isn't var only supported in Framewrok 3.0 and higher? You need to target 2.0 as your environment as well.
    RussD2009-04-14 22:27:18
    Russell Drown
  • Laro88
    Options
    I turned out to be a missing Logon that caused the problem. The exception that I got was misleading me, for some reason either ABB or Sharpdevelop obfuscates the true exception...

    But:
    SharpDevelop works and targeting 3.5 works as well. So hello again to Linq and EF from the windows application..