PlantLogic: Starting From Scratch - ResgreenGroup/Botway-Documentation GitHub Wiki
Current Location: RGR Products->PlantLogic-> Starting From Scratch
This page describes how to start up a new project in PlantLogic for first-time users. It includes directions for installing PlantLogic, what to do when the app is first opened, what each of the buttons do, how to make a root, branch, and leaf, all about the datastore, and example use cases.
When the application is received and launched for the first time, it will look like the image shown below.

Figure 1: Blank PlantLogic Window. Version numbers may differ.
In the menu bar on the top left of the window, there are two options: settings and help. Help contains an information window about PlantLogic. The settings menu contains project management tools: "new project," "open project," "save," "save as," "close project," and "exit application." PlantLogic uses files with the extension .plt (PlantLogic Template), a form of XML. Open the file menu and click on "new project." Specify the save location and project name. The file extension will populate with .plt by default. Save the project. When a new project has been created a trunk will be created, a section for roots will form under the trunk, and the system time will appear in the datastore. The PLantLogic window will look like the following figure:

Figure 2: New PlantLogic Project.
There is a row of buttons beneath the settings and help menus.
- Run: Starts the project. Switches to "stop" after it is pressed. Continuously runs the trigger logic. Data store will update, and branches will fire when their logic evaluates to true. Disables editing once pressed.
- Stop: Stops project. Ceases trigger logic checking and enables editing.
- Save: Saves the project. Function is identical to the "save" button in the file menu.
- Add new branch: Creates a new branch. Enabled when not running and either main trunk, roots, or any branch is selected. Disabled otherwise.
- Add new root: Begins creation of a new root. Opens a window that allows for selection of root type. Can select MQTT, API, OPC, MySQL, File Write, or File Read root types. A description of the root may be added to explain what device or resource it interacts with. Press the "add" button to create the new root, or press "cancel" to abort root creation. Disabled when running or when a leaf is selected in the tree structure. Enabled otherwise.
- Add new leaf: Creates a new leaf. Enabled when not running and a branch or leaf is selected. Disabled otherwise.
- Show monitor: Opens a separate window that shows an event log for PlantLogic. Shows all datastore updates, error messages, and any important notifications for debugging or event handling.
The left side of the window has two sections. The top section shows the plant structure, and the bottom section shows the datastore. The plant structure section shows the structure of any created trigger logic. Roots are kept at the bottom, and leafs are associated with branches above the roots. Roots are the data input and output structures. Branches are the trigger logic; They contain the boolean condition statements that trigger entry into the branch when true. Leafs are output functions. Each leaf is associated with a root. When the trigger logic of a branch fires, all the leafs in a branch execute. This section is the directory for all created roots, branches and leafs. While PlantLogic is in the "run" state, any root, branch, or leaf that is updated will flash blue.
The datastore is a section that holds label-value pairs. Any resource that roots interact with will appear here. While PlantLogic is in the "run" state, any row that is updated will flash blue. The datastore cannot be directly interacted with.
The right side of the window is reserved for modifications of roots, branches, and leafs. When one is created or edited, the right side of the window fills with appropriate information and allows for creation, editing, or deletion of its properties. This section will have different formats depending on what is selected.
- For all leafs, MQTT roots, and OPC roots, this section will have Settings, Items, and details. See figures 3,4, and 5 below.
- For all branches, this section will have two halves. The left half allows the user to name the branch, describe the branch's function, make trigger logic for the branch, test the trigger logic, toggle rising edge triggering, and toggle "continue-on-fail" for the branch's leafs. The right half shows the trigger logic with any data store calls replaced by their appropriate values. To reference something in the datastore in the trigger logic, enclose its label in "DS[""]". For example, to reference system time, which populates by default, the trigger logic should contain "DS["Sys.Time"]". In the right half, it will be replaced by the actual time. See figure 6 below.
- For API roots and File Read roots, this section will have settings and details, but no items. See figures 7 and 8 below.
- For SQL roots, this section will have only settings. See figure 9 below.
- For File Write roots, this section will have only details. See figure 10 below.

Figure 3: New Leaf creation in sample PlantLogic project.

Figure 4: New MQTT root in sample PlantLogic project.

Figure 5: New OPC root in sample PlantLogic project.

Figure 6: New Branch creation in sample PlantLogic Project.

Figure 7: New API root creation in sample PlantLogic Project.

Figure 8: New File Read root creation in sample PlantLogic Project.

Figure 9: New SQL root creation in sample PlantLogic Project.

Figure 10: New File Write root in sample PlantLogic Project.