RobotStudio event

Help plz! Don’t find what’s wrong!

Hello everybody!

I'm new to RAB and trying to get my code to work but have problem to find whats wrong with it. Easy to find for someone that have worked longer with RAB I guess image.

Im in hurry to get the basic to work, I will use RAB next Friday on a company show. Plz help!

Attach my project.

/Daniel

2007-08-31_184001_ModifySample.zip

Comments

  • Could you be more specific about what problem you are having?
    Russell Drown
  • The PC project is almost a copy of Read/Write example from the manual. But I have changed it to show the problem in a textbox. I just want to Read/Write to a Num or Array when the program is finished.

    The problem is that I fill in Task, Module and valuename and dubbleclick on the robot in found robots. The only answer I get is "invalid client id", whats wrong?

    ABB.Robotics.GenericControllerException: Invalid client id.

    at Adapters.Data.Get()

    at ABB.Robotics.Controllers.RapidDomain.RapidData.get_Value()

    at ModifySample.BasicControllerForm.ListView1_DoubleClick(Objec t sender, EventArgs e) in c:Visual Studio 2005ProjectsABBSamplesModifySampleModifySampleBasicCon trollerForm.vb:line 50

     

     

    Real IRC5 controller version 5.09.01
    RAB version 5.09

    I hope this is better info of the problem.

    Tedenljung2007-9-1 11:22:8
  • Now I have fixed some other stuff but the main problem is still there!
    I Can't get any value from the controller, I have now tested with both Virtual and Real Controller... Same problem, as post above.

    Can somebody help?

    Complete VB project:
    2007-09-02_133855_ModifySample-3.zip

    Tedenljung2007-9-2 13:39:30

  • Hello Daniel,
    you need to logon the controller and then request mastership. Example added to your project:

     

    Private Sub btGet_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btGet.Click

    Dim item As ListViewItem = Me.ListView1.SelectedItems(0)

    Dim CtrlInfo As ControllerInfo


    Dim myUserInfo As UserInfo = New UserInfo("Default User")

    If Not item.Tag Is Nothing Then


    CtrlInfo =
    DirectCast(item.Tag, ControllerInfo)
    If Not CtrlInfo.Availability = Availability.Available Then
    Return
    End If
    Me.Ctrl = ControllerFactory.CreateFrom(CtrlInfo)
    End If
    If Me.Ctrl Is Nothing Then Return
    ' Codesample
    Dim rd As ABB.Robotics.Controllers.RapidDomain.RapidData = Nothing
    Ctrl.Logon(myUserInfo.DefaultUser)
    Dim master As Mastership = Mastership.Request(Me.Ctrl.Rapid)

    Try


    rd = Ctrl.Rapid.GetRapidData(tbTask.Text, tbModule.Text, tbValue.Text)
    If rd = Nothing Then
    Return
    End If
    RichTextBox1.Clear()
    RichTextBox1.Text = rd.Value.ToString
    Catch ex As Exception
    RichTextBox1.Clear()
    RichTextBox1.Text = ex.ToString
    Finally
    If Not rd Is Nothing Then
    rd.Dispose()
    rd =
    Nothing
    End If
    End Try
    Ctrl.Logoff()

    End Sub

     

    /Ari.

  • Do you have to logon to the controller both for Reading and writing values to controller? In the samples in RAB 5.09 manual no login is done for reading... I think that ABB should check the samples so they really work. Couse it will be a really good help to beginners.

  • You dont need to take mastership, but you need to be logged on to the controller.