Logic -------------------------------------------------------------- .. |br| raw:: html
.. list-table:: :header-rows: 1 :widths: 25 40 35 :align: center :class: blockly-table * - Concept - Explanation - Example * - If/Else If/Else block - If the first value is true, then does the first block of statements. Otherwise, if the second value is true, does the second block of statements. If none is true, does the the last block of statements. - .. image:: /images/blockly_api/if-else.png :align: center * - Mathematical comparison operator block - Compares two values with an operator [*=*, *≠*, *<*, *≤*, *>*, *≥*]. Returns true if the comparison is true. - .. image:: /images/blockly_api/mathematical-comparison.png :align: center * - Logical comparision operator block - Compares two values with an operator [*and* / *or*]. Returns true if the comparison is true. - .. image:: /images/blockly_api/logical-comparison.png :align: center * - Not block - Returns true if the input is false, and false if the input is true. - .. image:: /images/blockly_api/not.png :align: center * - True/False block - Returns either true or false. - .. image:: /images/blockly_api/true.png :align: center * - Null block - Returns null. - .. image:: /images/blockly_api/null.png :align: center * - Test block - Checks the condition in test block statement. |br| If the condition is true, returns the value of the 'if true' value. |br| Otherwise, returns the 'if false' value. - .. image:: /images/blockly_api/test.png :align: center * - Try/Except block - On the "Try" statement you can ask Ned to try to execute any type of action a certain amount of time You can then choose if Ned should CONTINUE or STOP in case he is "On failure". If not Ned will execute the next block. - .. image:: /images/blockly_api/try-except.png :align: center Loops -------------------------------------------------------------- .. list-table:: :header-rows: 1 :widths: 25 40 35 :align: center :class: blockly-table * - Concept - Explanation - Example * - Time loop block - Does one or several statements multiple times. - .. image:: /images/blockly_api/time-loop.png :align: center * - While loop block - While a value is true, then do some statements. - .. image:: /images/blockly_api/while-loop.png :align: center * - For loop block - Executes a loop based on a variable, from a starting number to an ending number with a specified interval, and executes the specified blocks. - .. image:: /images/blockly_api/for-loop.png :align: center * - For each item in list loop block - For each item in a list, sets the variable "v" to the item, and then does some statements. - .. image:: /images/blockly_api/foreach-loop.png :align: center * - Break block - Breaks out of the containing loop. Must be in a loop block. - .. image:: /images/blockly_api/breakout-loop.png :align: center Math -------------------------------------------------------------- .. list-table:: :header-rows: 1 :widths: 25 40 35 :align: center :class: blockly-table * - Concept - Explanation - Example * - Set number block - Sets a value. - .. image:: /images/blockly_api/set-number.png :align: center * - Mathematical operation block - Returns the value of the specified operation with two numbers. |br| [*+*, *-*, *x*, *÷*, *^*]. - .. image:: /images/blockly_api/mathematical-operation.png :align: center * - Check operation block - Checks if a number is even, odd, prime, whole, positive, negative or divisible. - .. image:: /images/blockly_api/check-operation.png :align: center * - Round block - Rounds a number up or down. - .. image:: /images/blockly_api/round.png :align: center * - Mathematical list operations block - Returns the mathematical operation value of all number in the list |br| [*sum*, *min*, *max*, *average*, *median*, *modes*, *standard deviation*, *random item*]. - .. image:: /images/blockly_api/mathematical-list-operation.png :align: center * - Division remainder block - Returns the remainder from the division of two numbers. - .. image:: /images/blockly_api/remainder.png :align: center * - Constrain number block - Constrains a number to be between the specified limits (inclusive). - .. image:: /images/blockly_api/constrain.png :align: center * - Random integer block - Returns a random integer between the two specified limits (inclusive). - .. image:: /images/blockly_api/random.png :align: center Lists -------------------------------------------------------------- .. list-table:: :header-rows: 1 :widths: 25 40 35 :align: center :class: blockly-table * - Concept - Explanation - Example * - Create list block - Creates an empty list. - .. image:: /images/blockly_api/create-list.png :align: center * - Create list with items block - Creates a list with a specified number of items. - .. image:: /images/blockly_api/create-list-with.png :align: center * - Create list with one item block - Creates a list consisting of the given value |br| repeated the specified number of times. - .. image:: /images/blockly_api/create-list-repeat.png :align: center * - List length block - Returns the length of a list. - .. image:: /images/blockly_api/length.png :align: center * - Is list empty block - Returns true if the list is empty. - .. image:: /images/blockly_api/empty.png :align: center * - Item index finder block - Returns the index of the *first* or the *last* occurrence of the item in the list. Returns 0 if the item is not found. - .. image:: /images/blockly_api/list-index.png :align: center * - Get item block - *Returns* / *returns and removes* / *removes* the item at the specified position in a list. #1 is the first item. - .. image:: /images/blockly_api/list-find.png :align: center * - Set item index block - *Sets* / *inserts at* the item at the specified position in a list. |br| #1 is the first item. - .. image:: /images/blockly_api/list-set.png :align: center * - Copy list-portion block - Creates a copy of the specified portion of a list. - .. image:: /images/blockly_api/list-portion.png :align: center * - Sort list block - Sorts *numeric* / *alphabetic* / *alphabetic ignore case* by *ascending* / *descending* a copy of a list. - .. image:: /images/blockly_api/list-sort.png :align: center Variables -------------------------------------------------------------- .. list-table:: :header-rows: 1 :widths: 25 40 35 :align: center :class: blockly-table * - Concept - Explanation - Example * - Create variable block - Creates a variable by its name. - .. image:: /images/blockly_api/create-variable.png :align: center * - Set variable block - Sets this variable to be equal to the input. - .. image:: /images/blockly_api/set-variable.png :align: center * - Change variable block - Changes this variable by the input. - .. image:: /images/blockly_api/change-variable.png :align: center * - Get variable block - Returns the variable. - .. image:: /images/blockly_api/get-variable.png :align: center Functions -------------------------------------------------------------- .. list-table:: :header-rows: 1 :widths: 25 40 35 :align: center :class: blockly-table * - Concept - Explanation - Example * - Create no output function block - Creates a function with no ouput. You can add input arguments. - .. image:: /images/blockly_api/no-output-function.png :align: center * - Create function with output block - Creates a function with an ouput. You can add input arguments. - .. image:: /images/blockly_api/output-function.png :align: center * - Function return block - If a value is true, then ends the function and returns the return value. |br| Must be inside a function. - .. image:: /images/blockly_api/return.png :align: center * - Call function block - Runs the function. - .. image:: /images/blockly_api/function.png :align: center Utility -------------------------------------------------------------- .. list-table:: :header-rows: 1 :widths: 25 40 35 :align: center :class: blockly-table * - Concept - Explanation - Example * - Wait time block - Creates a break time in the program. - .. image:: /images/blockly_api/wait-time.png :align: center * - Comment block - Adds comments to the code. This block will not be executed. Note: accents are not accepted (é,à,è,...). - .. image:: /images/blockly_api/comment.png :align: center * - Break Point block - Stops the execution of the program. Press the "Play" button to resume. - .. image:: /images/blockly_api/break-point.png :align: center Arm -------------------------------------------------------------- .. list-table:: :header-rows: 1 :widths: 25 40 35 :align: center :class: blockly-table * - Concept - Explanation - Example * - Learning mode block - *Activates* / *Deactivates* the learning mode. - .. image:: /images/blockly_api/learning-mode.png :align: center * - Set arm speed block - Sets the arm speed. - .. image:: /images/blockly_api/arm-speed.png :align: center Movement -------------------------------------------------------------- .. list-table:: :header-rows: 1 :widths: 25 40 35 :align: center :class: blockly-table * - Concept - Explanation - Example * - Joints block - Creates an object pose according to the robot's joints values. - .. image:: /images/blockly_api/joints.png :align: center * - Move joints block - Moves the robot according to a Joints block. - .. image:: /images/blockly_api/move-joints.png :align: center * - Pose block - Creates an object pose according to the end effector's cartesian coordinates. - .. image:: /images/blockly_api/pose.png :align: center * - Move pose block - Moves the robot according to a pose block. You can change between "Standard" move (Point to Point), "Linear", the robot will follow a linear trajectory from its position to the desired position, or "Try linear", the robot will try to do a "Linear" trajectory, but if it can't compute the linear trajectory, it will do a "Standard" move. - .. image:: /images/blockly_api/move-pose.png :align: center * - Shift block - Shifts the robot pose according to an axe *x* / *y* / *z* / *roll* / *pitch* / *yaw*. You can change between "Standard" move (Point to Point), "Linear", the robot will follow a linear trajectory from its position to the desired position, or "Try linear", the robot will try to do a "Linear" trajectory, but if it can't compute the linear trajectory, it will do a "Standard" move. - .. image:: /images/blockly_api/shift_new2.png :align: center * - Pick from pose block - Moves the robot's TCP (arm's end point + tool coordinate) |br| to a specified pose and activates the tool to pick an object. - .. image:: /images/blockly_api/pick-from-pose.png :align: center * - Place from pose block - Moves the robot's TCP (arm's end point + tool coordinate) |br| to a specified pose and deactivates the tool to place an object. - .. image:: /images/blockly_api/place-from-pose.png :align: center * - Move Trajectory block - The robot will pass through the list of goals with the desired distance smooth. The distance smooth is the radius from the goal where the robot will start to go towards the next point. - .. image:: /images/blockly_api/trajectory.png :align: center I/O -------------------------------------------------------------- .. list-table:: :header-rows: 1 :widths: 25 40 35 :align: center :class: blockly-table * - Concept - Explanation - Example * - Get I/O block - Returns the number of the pin. - .. image:: /images/blockly_api/get-io.png :align: center * - Set I/O mode block - Sets I/O pin mode to *input* or *output*. - .. image:: /images/blockly_api/set-io-mode.png :align: center * - Set output state block - Sets output pin state to *high* or *low*. - .. image:: /images/blockly_api/set-io-state.png :align: center * - Get input state block - Returns the input pin state. - .. image:: /images/blockly_api/get-io-state.png :align: center * - State block - Returns the state value *high* or *low*. - .. image:: /images/blockly_api/io-state.png :align: center * - Set Switch state block - Sets the 12V switch state to *high* or *low*. - .. image:: /images/blockly_api/set-switch-state.png :align: center Tool -------------------------------------------------------------- .. list-table:: :header-rows: 1 :widths: 25 40 35 :align: center :class: blockly-table * - Concept - Explanation - Example * - Scan tool block - Scans and updates current tool. - .. image:: /images/blockly_api/scan-tool.png :align: center * - Grasp block - Activates the *gripper* / *vacuum*. - .. image:: /images/blockly_api/grasp.png :align: center * - Release block - Deactivates the *gripper* / *vacuum*. - .. image:: /images/blockly_api/release.png :align: center * - Open gripper block - Opens the gripper at a certain speed. - .. image:: /images/blockly_api/open-gripper.png :align: center * - Close gripper block - Closes the gripper at a certain speed. - .. image:: /images/blockly_api/close-gripper.png :align: center * - Pull air block - Pulls the air in the vacuum pump. - .. image:: /images/blockly_api/pull-vacuum.png :align: center * - Push air block - Pushes the air in the vacuum pump. - .. image:: /images/blockly_api/push-vacuum.png :align: center * - Setup electromagnet block - Selects on which pin the electromagnet is connected. - .. image:: /images/blockly_api/setup-electromagnet.png :align: center * - Activate electromagnet block - Activates the electromagnet power. - .. image:: /images/blockly_api/activate-electromagnet.png :align: center * - Deactivate electromagnet block - Deactivates the electromagnet power. - .. image:: /images/blockly_api/deactivate-electromagnet.png :align: center * - Activate / Deactivate TCP block - Activates or deactives the TCP. - .. image:: /images/blockly_api/activate-tcp.png :align: center * - Set TCP block - Sets TCP frame - .. image:: /images/blockly_api/set-tcp.png :align: center Vision -------------------------------------------------------------- The Vision blocks and Vision templates are detailed in the :vision_blocks:`Vision Set Documentation<>`. Conveyor blocks -------------------------------------------------------------- The Conveyor blocks are detailed in the :conveyor_blocks:`Conveyor Belt documentation <>`.