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, |br|
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 |br|
You can then choose if Ned should CONTINUE or STOP
in case he is "On failure". |br|
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, |br| 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 |br|
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 |br|
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
* - Saved pose block
- Creates an object pose with a pose saved in the robot.
- .. image:: /images/blockly_api/saved-pose.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), |br|
"Linear", the robot will follow a linear trajectory from its position to the desired position, |br|
or "Try linear", the robot will try to do a "Linear" trajectory, but if it can't compute the linear trajectory, |br|
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*. |br| You can change between "Standard" move (Point to Point),
"Linear", the robot will follow a linear trajectory |br| from its position to the desired position,
or "Try linear", the robot will try to do a "Linear" trajectory, |br| 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. |br|
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
I/O for Ned2
--------------------------------------------------------------
.. list-table::
:header-rows: 1
:widths: 25 40 35
:align: center
:class: blockly-table
* - Concept
- Explanation
- Example
* - Get Analog I/O block
- Returns the analog pin.
- .. image:: /images/blockly_api/get-analog-io-block.png
:align: center
* - Get Digital I/O block
- Returns the digital pin.
- .. image:: /images/blockly_api/get-digital-io-block.png
:align: center
* - Get Analog I/O value
- Returns the value of the selected analog pin.
- .. image:: /images/blockly_api/get-analog-io-value.png
:align: center
* - Get Digital I/O value
- Returns the value of the selected digital pin.
- .. image:: /images/blockly_api/get-digital-io-value.png
:align: center
* - Set Analog I/O value
- Sets the value of the selected analog pin.
- .. image:: /images/blockly_api/set-analog-io-value.png
:align: center
* - Set Digital I/O value
- Sets the value of the selected digital pin.
- .. image:: /images/blockly_api/set-digital-io-value.png
:align: center
* - End effector type of button press
- Detects the end effector's type of button press.
- .. image:: /images/blockly_api/end-effector-press-button.png
:align: center
* - End effector button is pressed.
- Detects the end effector button is pressed.
- .. image:: /images/blockly_api/end-effector-button-is-pressed.png
:align: center
* - End effector custom button is pressed with timeout.
- Detects the end effector custom button is pressed and sets timeout.
- .. image:: /images/blockly_api/end-effector-custom-button-press.png
:align: center
* - End effector action button is pressed with timeout.
- Detects the end effector action button is pressed and sets timeout.
- .. image:: /images/blockly_api/end-effector-action-button-press.png
:align: center
* - End effector waiting for press button.
- Waits for button press.
- .. image:: /images/blockly_api/end-effector-waiting-for.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
Sound (only for Ned2)
--------------------------------------------------------------
.. list-table::
:header-rows: 1
:widths: 25 40 35
:align: center
:class: blockly-table
* - Concept
- Explanation
- Example
* - Set sound volume
- Sets the robot sound's volume.
- .. image:: /images/blockly_api/set-sound-volume.png
:align: center
* - Play sound
- Plays sound selected to the robot. |br| Possibility of blocking the execution of the program with the "Blocking" parameter.
- .. image:: /images/blockly_api/play-sound.png
:align: center
* - Play partial sound
- Plays the selected sound to the robot from X seconds to X seconds. |br| Possibility of blocking the execution of the program with the "Blocking" parameter.
- .. image:: /images/blockly_api/play-partial-sound.png
:align: center
* - Stop sound
- Stops the current sound.
- .. image:: /images/blockly_api/stop-sound.png
:align: center
Light (only for Ned2)
--------------------------------------------------------------
.. list-table::
:header-rows: 1
:widths: 25 40 35
:align: center
:class: blockly-table
* - Concept
- Explanation
- Example
* - Set color
- Sets color with RGB parameters or color panel.
- .. image:: /images/blockly_api/set-color.png
:align: center
* - None
- No color displayed in the Led ring.
- .. image:: /images/blockly_api/led-ring-none.png
:align: center
* - Solid
- Led ring solid animation, set the whole Led Ring to a fixed color. |br| If wait is True, the blocks wait for the animation to finish.
- .. image:: /images/blockly_api/led-ring-solid.png
:align: center
* - Chase
- Led ring chase animation, movie theater light style chaser animation. |br| If wait is True and iterations not null, the blocks wait for the animation to finish.
- .. image:: /images/blockly_api/led-ring-chase.png
:align: center
* - Flashing
- Led ring flashing animation, flashes a color according to a frequency. |br| If wait is True and iterations not null, the blocks wait for the animation to finish.
- .. image:: /images/blockly_api/led-ring-flashing.png
:align: center
* - Wipe
- Led ring wipe animation, wipes a color across the Led Ring, lights a Led at a time. |br| If wait is True, the blocks wait for the animation to finish.
- .. image:: /images/blockly_api/led-ring-wipe.png
:align: center
* - Rainbow
- Led ring rainbow animation, draws a rainbow that fades across all Leds at once. |br| If wait is True and iterations not null, the blocks wait for the animation to finish.
- .. image:: /images/blockly_api/led-ring-rainbow.png
:align: center
* - Rainbow cycle
- Led ring rainbow cycle animation, draws rainbow that uniformly distributes itself across all Leds. |br| If wait is True and iterations not null, the blocks wait for the animation to finish.
- .. image:: /images/blockly_api/led-ring-rainbow-cycle.png
:align: center
* - Rainbow chase
- Led ring rainbow chase animation, like the chase animation. |br| If wait is True and iterations not null, the blocks wait for the animation to finish.
- .. image:: /images/blockly_api/led-ring-rainbow-chase.png
:align: center
* - Go up
- Led ring go up animation, Leds turn on like a loading circle, and are then all turned off at once. |br| If wait is True and iterations not null, the blocks wait for the animation to finish.
- .. image:: /images/blockly_api/led-ring-go-up.png
:align: center
* - Go down
- Led ring go down animation, Leds turn on like a loading circle, and are turned off the same way. |br| If wait is True and iterations not null, the blocks wait for the animation to finish.
- .. image:: /images/blockly_api/led-ring-go-down.png
:align: center
* - Set individual led
- Choose the Led ID and the displayed color
- .. image:: /images/blockly_api/led-ring-set-led-id.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 <>`.
.. |br| raw:: html