RobotStudio event

Searching for samples in VB [WebWare SDK]

Options

I'm trying to develop an application in Visual Basic 6.0 i wonder if someone one knows how to use the in instruction S4CurrentPositionGet because it returns an error. There is any example of how to use it? I've tried the one that appears on the WebWareSDK Manual but it doesn't work.

I know that with the RobotBox control i can see the position but i want to use it on my application and i haven't been able to obtain it.

I've also tried to develop an application in C language and it seemed to work only when i ask for data defined on the OPC as RAP version or TPU version, but when i try to ask for the robot position it only returns 0.000

Thanks in advance

Juan

Comments

  • RussD
    Options

    Here is a sample of a click event handler that shows how to do this:

    Private Sub Command1_Click()
        Dim intRetVal As Integer
        Dim myPos As New S4RobPosData

        intRetVal = Helper1.S4CurrentPositionGet(myPos)
        Label1.Caption = Str(myPos.x)'write the x-coord to a label
    End Sub

    You need to verify that you are actually communicating with the controller;what error is being returned?

    Russell Drown
  • Juan
    Options

    The returned error was -504. Is there any place where i can find the meaning of the returned erros? But now i've solved it, i think it came from a wrong communication with the controller. I normally don't use VisualBasic but LabWindows/CVI so i'm trying to learn two things at the same time image.

    Thank you Russ

    Juan

  • RussD
    Options
    See the Appendices in the online help for return code values.
    Russell Drown
  • -504 means you did not connect to the controller, i think.

    "-504:InterLink Module robot interface task is dead"

    Set the Helper.Robot variable to a valid Alias and check the InterfaceState if it is connected.

     

    greets

     

    M

    --------
    01000111