BotWay Getting Started Level 3: Using the Job Queue, Setting up Dynamic Staging, Triggers, and Cycles. - ResgreenGroup/Botway-Documentation GitHub Wiki
Current Location: Home-> Getting Started Level 3
The next level of modification to BotWay includes several tools that increase Botway's participation in a task. The job queue allows automatic distribution of jobs to robots, Dynamic staging allows BotWay to intelligently guide robots into a staging area that has an open or full cell, Triggers allow peripheral devices to supplement robot operation, and Cycles allow collection of data for performance metric analysis.
The creation of the job queue was covered in the Getting Started level 2 section of this introduction. To use the job queue, jobs need to be added into the queue. Jobs must be created in the "Buttons" dialog window. When creating a button, assign the "Job Add" type to the button command. An example of the creation of a "Job Add" button is shown below.
![](https://private-user-images.githubusercontent.com/138793687/268974624-15943bce-09c2-4c70-b6a7-2a20d5d2291e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyODY5MzksIm5iZiI6MTczOTI4NjYzOSwicGF0aCI6Ii8xMzg3OTM2ODcvMjY4OTc0NjI0LTE1OTQzYmNlLTA5YzItNGM3MC1iNmE3LTJhMjBkNWQyMjkxZS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjExJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxMVQxNTEwMzlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0wMjdjN2ZhMjc5YzY2YmZjYTAyZTZlZmFhYzM4YTJjYTA4ZjA2ZGUwYjg5OTE4Y2JiMTdhNGY3ZDYxM2ZhMGY2JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.HKo80EQleh7fLWj6M6oeXoSedSglBVDJ2KWV1tAtfu4)
Image: Job Add button command creation in the Buttons dialog window.
A full description of each line in the Job Add button creation window is given on the Buttons Page. Making a "Job Add" button requires a physical or virtual button present in the devices tab of the robot tiles section on the dashboard. When filling in the fields to create the button, the ID field is to be filled with the device ID and the number field is to be filled in with the button number; each device may have more than one button so this field specifies which button on the device is used to add the job. When the fields are all filled, add the button, then save changes in edit mode. Now click the add button in the Job Queue section of the dashboard. This opens a window that allows the user to add one or more jobs to the queue. Pressing the button that was just created will also add a job to the queue.
Jobs in the queue will be automatically distributed to the first acceptable robot that arrives at one of the queue's stations. The inclusivity of a job determines whether a robot may take the job or not; concurrent jobs will always be taken immediately, consecutive jobs will only be taken when the consecutive job before them is completed, and exclusive jobs will only allow one robot to take them at a time.
When a job is created, the user must specify the start status and end status of the job. Jobs may be started as active or staged, and they may be ended as completed or staged. Jobs with the start status set to "Active" will be embarked upon the instant the robot is assigned the job from the queue. Jobs that have a start status of "Staged" will be assigned to a robot, but the robot will not embark on the job until a release button is pressed. Release buttons are a specific type of button command that can be made in the Buttons menu. When creating these buttons, the user must specify a tag to act on and a route to release the robot to. The signal for BotWay to end a job is when the robot passes over the tag specified by the "End Tag" field while the robot is on the job's "End Route." When this happens, the job will be ended and its status will change to what the user specified in the "Status at end" field of the job creation window. An end status of "Completed" will immediately complete the job when the job is ended and the robot will embark on the return route of the station where it received the job. An end status of "Staged" means that the job will not be immediately completed when it is ended; instead, the robot will wait for a "Job Complete" button to be pressed before the job status is changed to "Complete." The button that completes a staged job must be specified in the "Completer ID" field in the job creation window and an associated "Job Complete" Button command must be created for this to work.
When a robot's job includes picking up or dropping off an LHF, then dynamic staging can be used to expedite the process. To begin setting up dynamic staging, open the stagingData.xml file in the "Data" folder of BotWay into a text editor like Notepad++. This file should look like the image below.
![](https://private-user-images.githubusercontent.com/138793687/268737608-dc796f06-918e-4f53-8681-e087b7964e4b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyODY5MzksIm5iZiI6MTczOTI4NjYzOSwicGF0aCI6Ii8xMzg3OTM2ODcvMjY4NzM3NjA4LWRjNzk2ZjA2LTkxOGUtNGY1My04NjgxLWUwODdiNzk2NGU0Yi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjExJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxMVQxNTEwMzlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT04NWU5NDhhZmI4NDc4ZmE0Y2VhMGMwMzlmODJhYzA0Y2VhNDg4N2U3YWU4Mjk5M2NjOThiZjdiNDM0ODk1ZDVjJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.cfFuZvKv22kaXMu72DNjFa8HT8ndliQvLBxoweIukSI)
Image: Brand new stagingData.xml file in Notepad ++.
On line 3 replace the "false" with "true." This will enable dynamic staging, creation of the staging area in BotWay, and reveal the staging area management window in the BotWay Dashboard. A full description of each line in stagingData.xml can be Found Here. To get dynamic staging working, create cells. An example set of cells is shown below
![](https://private-user-images.githubusercontent.com/138793687/268737413-45a97067-fac4-404a-a85e-6364c254c9c2.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyODY5MzksIm5iZiI6MTczOTI4NjYzOSwicGF0aCI6Ii8xMzg3OTM2ODcvMjY4NzM3NDEzLTQ1YTk3MDY3LWZhYzQtNDA0YS1hODVlLTYzNjRjMjU0YzljMi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjExJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxMVQxNTEwMzlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT00NDcwNWIxZWRlMjhlMmIyYmE1ZjFkMjk1MDExY2VhMDU3NGMwZGRjOTUzMzE0MzUxYTA0YzczMjdmMDQ3YTE0JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.1tL16Or6UzMqsTYFEJiyq9ay5OyziTPe9vlNPPF4_NI)
Image: Brand new stagingData.xml file in Notepad++.
Each cell declaration contains a row index, a column index, and a cell ID. The row and column indices specify a cell's location in the Dynamic Staging Management panel and the ID is what the cell is called. Lines 18, 26, and 33 contain examples of cell declaration statements. Each declaration needs an accompanying termination statement like on line 25. Inside each cell, declare a tag, a put route, a get route, a completer ID, and a staging status; an example of this can be seen on lines 20-24. The tag line specifies which tag is to be assigned this staging status, put route specifies which route will take the robot to this tag when BotWay receives a stagePut command, get route specifies which route will take the robot to this tag when BotWay receives a stageGet command, completerId is the assigned button that completes a job in the staging area, and status is used to set the staging status of each cell. Staging status can be only one of the five following conditions: "NONE," "EMPTY," "LHF," "LHF_PALLET," or "LHF_FULL."
Once all the cells are created, Dynamic staging can be used. There needs to be a tag before the staging area with 2 commands: a command with an action of "H0" for the robot types that travel through the staging area, and a command with a recipient type set to "BotWay," an action of "stagePut" or "stageGet," and a value of one of the five acceptable staging status labels. When a robot arrives at this staging tag, it will stop and BotWay will inspect the staging area for cells with a staging status that matches the staging status of the Botway command value at this tag. StagePut sends the robot on the putRoute of the first cell found to match and stageGet sends the robot on the getRoute of the first cell found to match.
Each putRoute and getRoute must be created in the route editor in order to use dynamic staging without causing delays. When a robot reaches the staging tag, BotWay changes the route that the robot is on like a jump in the route editor. The route to be jumped to must exist in BotWay and be a valid path to the cell that it is assigned to. Each putRoute and each getRoute should go from the staging tag to the tag in the cell where they are declared. Furthermore, each putRoute and eachgetRoute must contain an additional command at the staging cell. Shown below is an example of this additional command. This command must have the recipient type set to "BotWay," the action set to "stageSet," the value set to the cell ID associated with the tag, and the data1 section set to one of the five acceptable staging status labels. This instructs BotWay to update a cell's staging status when a robot drops an LHF off or picks one up from a cell. The staging status will be changed to whatever is entered for data1.
![](https://private-user-images.githubusercontent.com/138793687/268755917-56bfb5e5-5ec5-431a-8d41-08f9f188c3c5.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyODY5MzksIm5iZiI6MTczOTI4NjYzOSwicGF0aCI6Ii8xMzg3OTM2ODcvMjY4NzU1OTE3LTU2YmZiNWU1LTVlYzUtNDMxYS04ZDQxLTA4ZjlmMTg4YzNjNS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjExJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxMVQxNTEwMzlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0zMzYwYzgyODliZGI5NzViZmU4NGNkNjc0Yjk5NGYxNmUwYmY3OWVhM2VkM2NhYTA5OGRiOTA0MWE0YjlhYzViJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.zhIm_1pRnoo19pL_BRFQjWt1s_ouovIQt3i14N0r8rs)
Image: BotWay staging status set command example.
Triggers allow peripheral devices to interact with the robots' workflow. Click Here for a full discussion of triggers, their use, and the appropriate way to initialize one. This page will attempt to give a barebones introduction. Enter edit mode as Admin and click the "Triggers" button to open the trigger creation dialog window. An example dialog window is shown below.
![](https://private-user-images.githubusercontent.com/138793687/268759059-e2367ca0-2986-4973-afba-1b5e8efa9dd4.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyODY5MzksIm5iZiI6MTczOTI4NjYzOSwicGF0aCI6Ii8xMzg3OTM2ODcvMjY4NzU5MDU5LWUyMzY3Y2EwLTI5ODYtNDk3My1hZmJhLTFiNWU4ZWZhOWRkNC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjExJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxMVQxNTEwMzlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0xYTIwMjE1YzhhOTUxODcyZTFiNTAzM2ZmZDI5ZGJlNTA2ZjE5MjlkNzE3ZjcxODNmMGFmYWQ0ZWQ5NTI2M2E5JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.0QEM8vMnGXRWCRKLJNWFZ07w2VdDvHglH-DV4GC07bA)
Image: Triggers dialog window.
Triggers are written in Javascript. Each trigger needs a condition and an output. To create a new trigger, click the "Add" button in the trigger dialog window, then type a Boolean condition in the empty line below the condition box. Refer to the Triggers Page for information about creating conditions. Input for conditions can vary across a large range of possible logic, but each condition will only evaluate to "true" or "false." When a condition evaluates to "true," BotWay will initialize that trigger's output actions.
The "Actions" section of the triggers dialog window allows for modification of the responses to trigger conditions. When a trigger condition is created and saved, it may be selected in the "Conditions" box and an action may be assigned to it. With the condition selected, click the "Add" button in the actions section. Then, Fill in the Target #, value, and data fields. The Target # field specifies the device ID that the action will target. The data fields can only be filled in with numbers and these fields do different things depending on the device being targeted. For example: with RGGI's wireless stacklight, data 1, 2, and 3 specify RGB values and data 4 specifies a blinking pattern.
Cycles are tools used to gather information on how long it takes robots to get from one point to another. This information can be used to diagnose problems in the process of a robot completing a task. To create a cycle, click the "Edit" button while signed in as Admin to enter edit mode, then click the "Cycles" button in the map display toolbar to open the cycles dialog window. Shown below is an example of the cycles dialog window.
![](https://private-user-images.githubusercontent.com/138793687/269981712-68e348ab-94c2-4476-a082-16aec0e6b174.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyODY5MzksIm5iZiI6MTczOTI4NjYzOSwicGF0aCI6Ii8xMzg3OTM2ODcvMjY5OTgxNzEyLTY4ZTM0OGFiLTk0YzItNDQ3Ni1hMDgyLTE2YWVjMGU2YjE3NC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjExJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxMVQxNTEwMzlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1lZWJkYjcwYWYwZDAyZTU2ZWYwOTcwM2ZmN2U0MjVlZmFkMTc5YzkwNzFlYTYxNmEwN2E4NmM0ZWIxMmYwYWYyJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.S9TOFpbd-_G8zC7LwlF7kaDy5T8ngYd1vkYdjb4sUco)
Image: Cycles dialog window.
Click the "Add" button in the upper left of the window to make a new cycle. Then, fill in the five fields on the right side of the window. The cycle ID must be an integer. Start route and start tag specify the combination of route and tag that the robot must travel to begin the cycle. End route and end tag specify the combination of route and tag that will register completion of a cycle. Robots track their cycle information individually. When a cycle is created, any robot that travels over the start tag on the start route of a cycle will begin updating its cycle metrics.
Robots track cycle information individually. To reveal this information, right click on a robot tile while signed in as Admin and click the "Show Logs" option from the menu that appears. The cycle information will be in the top right of the window and it shows the minimum time to complete a cycle, maximum time to complete a cycle, average time to complete a cycle, and total time taken to complete all recorded cycles. Shown below is an example of a robot's cycle information.