C# read var exception
Laro88
✭
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...
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...
0
Comments
-
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:18Russell Drown0
-
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..
0
Categories
- All Categories
- 5.5K RobotStudio
- 394 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 249 ScreenMaker
- 2.7K Robot Controller
- 309 IRC5
- 59 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 785 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 4 Job listings