Conditional object recognition
pablon from Poland  [11 posts]
9 years
I have a robotic arm connected with roborealm through RS232C. I want to send COG_X and COG_Y to robot arm via RS232. In this topic I found very useful samples in this forum.
My problem is that I want send object coordinates only, if I receive notification from robot, that arm has finished previous task and is ready for the next task with new coordinates. Objects are moving on low speed conveyor and are recognized by Roborealm according to pattern. How can I do this? Could I use VBScript? Does any one know tips or tricks?

RS-232C data specifications:
Data bit 8
Stop bit 2
Parity No
Baud rate 9600
Asynchronous communication

All help will be appreciated,
Anonymous 9 years

Check the documentation on the Serial module (click on the search tab in the upper left corner and type in Serial. When you see the module double click to edit and insert into the pipeline.)

You will have to configure the send and receive parts to use the right protocol. For example, if your robot is sending back a signal when ready the receive sequence might be


which would then be used to determine if you will send anything to the robot. In your send sequence you would place something like


which would either contain the values for the COG_X and COG_Y or be blank. If blank nothing is sent. You will then need a VBSCript module to provide this logic in something like the following:

if GetVariable("ready") = "1" then
  SetVariable "Send_Text", GetVariable("COG_X") & ", " & GetVaraible("COG_Y") & LF
  SetVariable "Send_Text", ""
end if

which based on the value of "ready" i.e. the value sent back from the robot will set the variable "Send_Text" to be either the next X,Y coordinates or blank. When the pipeline reexecutes its next iteration the serial module will then either send the X,Y or nothing and then check again for the ready signal.

See the serial docs for more examples:


Hope this helps ..

pablon from Poland  [11 posts] 9 years
Thank you. It was very helpful.
Evaluating first sample, I have second question.
Is there any possibility to send in loop all blobs from blob array through serial if GetVariable("ready") = "1" ?
Sequence will be as follows:
1.    Check if serial device is ready
2.    If ready, capture image
3.    Identify Blobs create n-th element array of blobs with Shape_Match
4.    Send 1-th element of blobs array to serial. Serial port (robot) will send back info that 1-th blob element has been processed. Send second, third . n-th blob from step 3. Placement of blob objects can change in meantime but this is not important. Only the first one location of blobs is valid.

Anonymous 9 years
Yes this is possible but you will not be able to "wait" on the serial connection in order to send the next blob. Assuming that the serial protocol is correct on the robot side RR will pump all the data on the serial line as long as it gets an ACK from the other side. Thus it will attempt to push all data down the serial line and then wait for the final response.

It is possible to send one blob, wait for a programmable ack and then send the next ...but that would be much easier to do in a programming mode, i.e. use an external program that requests data from RR and then makes a serial connection directly to the robot.

pablon from Poland  [11 posts] 9 years
Thanks for the explanation. I will try to do this with third part program.

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