|
Socket Comminications Pete from United States [56 posts] |
10 year
|
Hi STeven,
Having some issues trying to communicate to RR via sockets. I have a new RR script with just the Socket server program running. I enter my computer name for Server Hostname. I'm using Agilent VEE (now KeyInsight) to read data. I use my to/from socket tool and enter the port 5050 (same as in RR), select BIND to the port. In my program I'm reading data, when I execute I get a connection timeout. Now on the RR side I select 'Connect' and get a message "Failed to connect to HCU-6MF0F12 port 5050" where HCU-6MF0F12 is my computer name. Now if I go back and run my VEE program it works with no error and I read back what looks like all the available variables and a few extra. At this point I can re-run the VEE program and all still works.
The 1st issue I seem to have to select "connect" on the RR side to get things going. Once I have RR sending all its data variables is it possible to only request a specific one? I have checked over most of the examples but have not been able to find a way to read just a single variable. Would you have an example of how to do this?
Now I try to send data to RR sending 4 bytes of binary data for the length followed by the text string with the number of characters defined in the length. I get no errors when sending but variable does not show in the Result Variables.
As for you help page for the socket server is there an error in the data format example?
5 width 4 320 6 height 240 5 image 230400 xxxxx ... 0
I see 5 defines the length for 'width', 4 for the 320, 6 for the height length, but is there a value missing to define the length for the 240??
Pretty much what I trying to do is get status from RR when the processing of my 30 2d matrix barcodes has completed. What it would do is set a variable as to how many it has decoded at this time I may be able to tweak some parameters to help decode ones it may be having issues with. Also thinking about passing the barcode results via sockets back to my VEE program.
Are they any tools / utilities to help troubleshoot the RR side?
Thanks for any help,
-pete
|
|
|
Steven Gentner from United States [1446 posts] |
10 year
|
Pete,
We've updated the Socket Plugin module and uploaded it to the site. It should allow you to select individual variables aswell as not send the image if you don't need it. Additional debugging has been added to the messages block so that should help too.
In addition, we updated the example plugin code to correct a couple things including allow for timeouts to happen. This keeps the stopping and starting to be much smoother.
http://www.roborealm.com/downloads/Plugins.zip
The text you noted in the documentation page was missing a 4 for the height value and the image length. This has been corrected. Note that the 4 for the width and height actually specifies a binary 4 byte int as apposed to ASCII text which is for all other variables. Since the image comes through as a binary array the width and height were done the same. That's the only exception.
Note that you are sending 4 chunks of info per variable. First goes a 4 byte length for the variable name, followed by the variable name in text, followed by a 4 byte value length and finished with the actual value (in text characters).
STeven.
|
|
|
Pete from United States [56 posts] |
10 year
|
Hi STeven,
After having communication issues with the socket plugin (prior to your update) I did some more research on your many communication methods. The API method looked like the better way to go. I have since been able to successfully communicate using the Agilent VEE program.
Thanks,
-pete
|
|