RAB 5.08 questions
I'm experementing with my first project in RAB 5.08 . I'm making som small projects to experiment with the different technologies that are involved. I manage to get my applications running in VFPU 5.08. I also manage to connect an ABB Label with a Rapid data using a apidDataBindingSource.
I however get problems when I try to directly read a num data from the controller. In the top of the application I have added:
then I have an ABB Button and an ABB Label. In the button click event I have the following code:
Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
Dim MyData As RapidData
MyData = AeroController.Rapid.GetRapidData("T_ROB1", "MainMod", "nCurrHeight")
I have also tried:
MyData = AeroController.Rapid.GetTask("T_ROB1").GetModule("MainMod").GetRapidData("nCurrHeight")
TextBox3.Text = AeroController.Rapid.GetRapidData("T_ROB1", "MainMod", "nCurrHeight").ToString()
But I always get problems when running this in the VFPU. I get an error stating that:
"Object reference not set to an instance of an object"
The data I read is declared as a PERS num data.
Does anyone have an idea about this.
Have you done a debug-step-through to see on which exact row you are getting the error?
If not then I really recommend this.
What I think is happening is that you declare MyData inside the button_click sub so it is only "alive" in that sub, then you try to manipulate it outside of the sub and that is when you get the reference error.
Here you have a short example of a bool read/write that I just threw together for you on how to read/write to a bool. The principle is the same for num and strings.John
- 10.4K All Categories
- 5.3K RobotStudio
- 351 UpFeed
- 15 Tutorials
- 9 RobotApps
- 282 PowerPacs
- 404 RobotStudio S4
- 1.8K Developer Tools
- 239 ScreenMaker
- 2.6K Robot Controller
- 251 IRC5
- 36 OmniCore
- 6 RCS (Realistic Controller Simulation)
- 3 RobotStudio AR Viewer
- 702 RAPID Programming
- 14 Wizard Easy Programming
- 107 Collaborative Robots
- 3 Job listings