You're reading the documentation for a development version. For the latest released version, please have a look at master.
Robot Wait Node
Overview
Robot Wait node waits for a response from the Robot System for a certain amount of time until a robot response is received.
Intput and Output
Input |
Type |
Description |
---|---|---|
Robot Source |
String |
The name of the robot system to perform the wait. |
Time Out |
Int32 |
The amount of time (in millisecond) for the program to wait. |
Output |
Type |
Description |
---|---|---|
status |
int |
The status value of the robot. |
Node Settings
Data Source
Robot Source:
Follow the following steps to add a robot:
- Click on Robot Wait, and click ‘Open Platform Config’. Or you can click ‘Platform’ and click ‘Platform Configuration’ on the top menu bar.
- Select the Robots tab. Choose ‘Other’ as the Robot Type, then click ‘+’ add a robot.
- Keep everything as default, check ‘Use String’, and ‘Connect’.
- You should see the console message “Server started on port: 6969” from the robot system you created.
- Port Number (Default: 6969):
The port number used for connection. Please make sure it is the same as it is in Hercules.
- Pose Order (Default: XYZ):
The type of rotation to be performed by the robot.
- MULT Value (Default: 10000):
The multiplication factor used for multiplying pose values.
- Splitter (Default: ‘,’):
The character that separates the message into different fields.
- Ending Character (Default ‘;’):
The character that marks the end of the message.
Robot Wait Setting
Time out: (Default: 0 ms)
The amount of time (in ms) for the program to wait. The program waits indefinitely if the field is set to 0 ms.
Procedures to Use
- Right click on the flowchart and click insert node, under the Robot Operation section, and select the Robot Wait node.
- Click the Robot Wait node, and select a Robot System. If you have not added a robot already, follow the steps in Data Source section.
- Right click on the flowchart and click insert node, under the Utilities section, select the Print node.
- Click on the Print node, type ‘1’ in the Print Message.
- Right click on the flowchart and click insert node, under the Flowchart Control section, select the Halt node.
- Click on the Halt node, and select True.
- Click the Robot Wait node and run the flowchart. The program should now wait indefinitely (if the Time Out value is set to 0 ms) until a robot response is received.
- In this case, we use the Hercules program for demonstration. Open the Hercules program. Click the third tab ‘TCP Client’, input Module IP 127.0.0.1, input port number 6969, and click connect. You should see the message “Connected to 127.0.0.1” in Hercules.
- Since a robot response is received, the program resumes running, and you can see the number 1 is printed onto the console.
Exercise
In steps, explain the appropriate settings for the Robot Wait node to make the program print “123” every 8 seconds?
Answers for Exercise
- First we have to add a Print node, and one Robot Wait Node.
- Type “123” into the Print node settings.
- You will need select a robot system, and start the server from the platform configuration page. However, there is no need to connect from Hercules, as this will let the program waits for a robot respnose for the timeout time.
- Note that the timeout value is in millisecond, so we need to input 8*1000 = 8000 into the timeout field.
- You should see the console prints 123 after every Robot Wait node timeout.