loading
 
Using the API server
Danny Rich from United States  [6 posts]
5 year
I followed the instructions on how to setup the API.  The test example is beings with issuing the following command string while in CMD prompt.
telnet localhost 8080
Windows replies that telnet is not a recognized command.  Same is true for the PowerShell.

Do you have a new set of instructions for setting up and testing the API server?
Steven Gentner from United States  [1446 posts] 5 year
You can find telnet on a number of sites if you want to continue with that route. Otherwise, just download the examples linked to at the top of the API page and pick a language that you are familiar with. The telnet instructions are just for debugging reasons which may be needed if you have a firewall blocking RR's api server.

STeven.
Danny Rich from United States  [6 posts] 5 year
I wish that I could say this worked - it did not.  In fact I am about 100 miles further back than I was before.  TheTest programs cannot access the API.  Of course, they do not say this - but all of the variables are null or empty and the program crashes.  Now RoboRealm will no longer load.  

I am getting really frustrated with this product.  
First - it would not connect to my camera - it kept saying that some other program was using it.  But RR was the only program running, other than Windows 7

So I moved to another computer running Windows 8.  Ran the regsvr32 to register the DLLs for COM
Load and build the GUI version of the Test program (as suggested).  The program crashes because the variables are undefined - they are set to NULL and a stupid message box tries to display them and generates a subscript out of range error.  

So I try to unregister the DLLs and start over.  Will not allow me to do this.  The DLLs have corrupted the registration server.  

And, best of all RoboRealm no longer runs.  I click on it and get the little time passes icon and then it all just goes away and nothing is left.  No picture, no user interface - just Windows desktop looking blindly back at me.

Steven Gentner from United States  [1446 posts] 5 year
Danny,

Try launching RR with the CTRL key held down ... that will cause it to reset and not connect to any cameras automatically. That's most likely where the freeze is happening.

It sounds like you also have some other catastrophic issue with connecting to the API. Most likely your firewall or virus type program is interfering with the communication and registration. It was developed on Win7 for years so that should have worked the best.

What you can also attempt is to look at the problem from a different perspective. I.e. what's the need to connect via the API? There are various other ways of getting information to and from RR that might work out better for you. For example, one can transfer images into and out of RR via the clipboard. For other routes that might work check

http://www.roborealm.com/help/Integration.php

If you are not sure and can describe here what your needs are we can help recommend a route.

STeven.
Danny Rich from United States  [6 posts] 5 year
STeven - I have made some progress.  I have RR back up and running. It appears that the issues has something to do with regsvr32 of the DLLs.  I was able to register and then unregister the x86 version of the API libraries but when I tried the 64bit it corrupted my System32 distribution and I had to rebuild the communications servers so that I could register and unregister the DLLs.  

I also discovered that telnet is part of Windows it just is not enabled by default.  So if you go to Programs and Features in Control Panel there is an option to Enable more Windows Features and the telnet client is in the list but unchecked.  

So it is back to Stage 1 and make certain that the DLLs are working.  I think that they are.  But I tried to take some giant steps and forge ahead and I should have taken smaler steps.

I need the API or the denigrated direct calling of the DLL because I have a small process where the camera is identifying the incoming materials and then another program sends signals to a PLC to indicate what process should be executed.  It is the converse of typical automation control where every product is to be identical.  In my case few if any products will be the same.
Danny Rich from United States  [6 posts] 5 year
So I used the telnet method and I was able to send messages to the API server and get correct responses.  Then I loaded the VB.net demo GUI test and the program builds but crashes.  

The code that causes the problem is here:
rr.GetIntArrayVariable("BLOB_LABEL_X", myListX)            'myListX and myListY are null
    rr.GetIntArrayVariable("BLOB_LABEL_Y", myListY)


    If IsArray(myListX) Then

      MsgBox(CStr(myListX(0)))

    End If

The error occurs in the MsgBox call where the length of myListX(0) is reported to be 0

Exception thrown: 'System.IndexOutOfRangeException' in API_test.exe.  

I think that once again you have left off some instructions.  And the code has no error catching loop so if the image is not correct the analysis is not either.


 
Steven Gentner from United States  [1446 posts] 5 year
Danny,

There should have been a

Dim myListX() As Object

before that line. Plus, if you don't have that array in RR then it will error since the array will not be created. I've attached a small robofile that does create that array just for testing. We have also updated the example program download (API.zip) to include a ubound check which is needed to check if the array has actually been filled with anything which is needed in VB. Note, the examples are meant to be very simple so not all checks are done.

    Dim myListX() As Object

    rr.GetIntArrayVariable("BLOB_LABEL_X", myListX)            'myListX and myListY are null

    If IsArray(myListX) Then
      If UBound(myListX) > 0 Then
        MsgBox(CStr(myListX(0)))
      End If
    End If

STeven.


program.robo

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index