TCP Script Server Raw icon TCP Script Server Raw — TCP server for ARC accepting EZ-Script, JavaScript or Python commands, letting controllers send commands and receive line-terminated responses Try it →
 

Index

Every category of the Blockly toolbox at a glance: what each one is for, and every block in it. Click a category to open its page, where each block has a picture, an explanation, an example, tips and the JavaScript it turns into, or click a block to jump straight to it. There are 289 blocks in 24 categories, listed here in the order they appear in the toolbox.

Where to find it: the toolbox down the left side of the block area, in any script editor set to Blockly or on Top bar → Workspaces → Blockly


Categories

Category What it covers
Logic Decisions: compare values, combine conditions, and run blocks only when something is true.
Loops Repeat blocks a number of times, forever, or while something is true.
Math Numbers, arithmetic, random numbers, rounding, and converting a value from one range to another, such as a 0 to 255 sensor reading into a 1 to 180 servo position.
Text Words and sentences: join them, measure them, search them, change them, and print them to the console.
Lists Several values kept together in order, and the blocks that make, read and search lists.
Variables Values with names.
Functions Name a group of blocks and use it again from anywhere in the program, optionally handing back a result.
Movement Drive the robot through whichever movement panel robot skill the project has.
Servo Move servos, set their speed and limits, read their positions, and play Auto Position actions.
Kinematics Move robot arms by where the end of the arm should go, in millimetres, rather than joint by joint.
Ports Read and set the controller's digital ports (on or off), analog ADC ports (a voltage as 0 to 255) and PWM outputs (0 to 100 percent).
Sensor Ultrasonic distance sensors, and the EZB's own battery voltage, temperature and connection.
Camera Send commands to the camera and tracking robot skills in the project.
Vision Ask what a camera sees, one picture at a time: colours in view, counts, positions, average colour and brightness.
Audio Speak, play sounds and notes, set the volume, and wait for the robot to hear a phrase.
Gamepad Read gamepads and joysticks plugged into the computer: sticks, triggers, buttons, motion and battery, and make them rumble.
Serial & I2C Talk to other devices: serial ports on the computer ARCx runs on (COM), serial ports on an EZB (UART), and I2C devices on an EZB.
Network Check the internet connection, download web pages, post to web services and send UDP messages.
File Read and write files on the computer ARCx runs on.
Navigation Tell the navigation system where the robot is and what its sensors see, and set whether it is navigating.
UI Talk to the person at the browser: messages, questions, workspaces and Custom UI screens.
Browser Open web pages, dashboards and kiosk screens in browser windows on the computer's monitors, and control them.
Utility Waiting, control commands for any robot skill, a block for typing your own JavaScript, and the computer itself.
Debug Print messages, time parts of the program and write to the ARCx debug log, to see what a program is doing.

Blocks by category

Logic

Decisions: compare values, combine conditions, and run blocks only when something is true. Most of these blocks give back true or false, and plug into an if block or a loop.

If / Then · Compare Values · AND / OR · NOT · True / False · Null · If ? Then : Else

Loops

Repeat blocks a number of times, forever, or while something is true. A loop that runs for a long time should have a Sleep block inside it, so the robot stays responsive.

Repeat N Times · Break Out of Loop · While / Until Loop · For Loop (Count) · Loop Forever · Wait Until Stopped · Label · Continue Label (Goto)

Math

Numbers, arithmetic, random numbers, rounding, and converting a value from one range to another, such as a 0 to 255 sensor reading into a 1 to 180 servo position.

Number · Math: + − × ÷ ^ · Random (Min to Max) · Random number from … to … … · Random Integer · Random Decimal (0–1) · Math Functions · Trigonometry · Math Constant · Number Property Check · Change Variable By · Round Number · Remainder (Modulo) · Constrain · Map … from … - … to … - … · List Math · Bit … of … is set · Byte from bits 7 … 6 … 5 … 4 … 3 … 2 … 1 … 0 …

Text

Words and sentences: join them, measure them, search them, change them, and print them to the console.

Text String · Text Length · Print / Display Text · Join Text · Append to Text Variable · Is Text Empty? · Find Text Position · Get Character At · Get Part of Text · Change Text Case · Trim Spaces · String List

Lists

Several values kept together in order, and the blocks that make, read and search lists. The first item in a list is number 1.

list 1, 2, 3 · String List · Length of list … · Item # … of list … · List … contains … · Join list … with … · Split text … at …

Variables

Values with names. The first three blocks are this script's own variables: pick one from the drop-down, or choose Rename variable to name it. A name that starts with $ makes it a global variable instead. The global variable blocks below them read and write the values every script and robot skill in ARCx shares.

Get Variable · Set Variable · Clear Variable · Set global variable … to … · Global variable … · Global variable … or … if missing · Global variable … exists · Delete global variable … · Set global variable … to … description … · Set global variable … to a copy of …

Functions

Name a group of blocks and use it again from anywhere in the program, optionally handing back a result. Right-click a function's block and choose Create to get a block that runs it.

Define Function · Define Function (with Return) · Call Function (Get Result) · Call Function · Return Value · If / Return

Movement

Drive the robot through whichever movement panel robot skill the project has. Movements keep going until another movement or a stop. Speeds run from 0 (stopped) to 255 (full speed).

Move Forward · Move Reverse · Stop Movement · Turn Right · Turn Left · Move … · Move … at speed … · Set … speed to … · Set speed left … right … · … speed · Move in direction named … · Move in direction named … left speed … right speed … · Wait until the robot is moving …

Servo

Move servos, set their speed and limits, read their positions, and play Auto Position actions. The Auto Position blocks list the actions of the Auto Position robot skills in the project.

Auto Position (Wait) · Auto Position (Wait, By Name) · Auto Position Loop (Duration) · Auto Position Loop (Duration, By Name) · Auto Position (Background) · Set Servo Position · Get Servo Position · Get Servo Real-Time Position · Set Servo Speed · Set Servo Acceleration · Set Max Position Limit · Set Min Position Limit · Set Servo Velocity · Release Servo · Move servo … to a random position from … to … · … servo … by … · Servo … … · Set servo … fine tune offset to … · Servo … is released · Release all servos · Wait until servo … position … … · Wait until servo … moves

Kinematics

Move robot arms by where the end of the arm should go, in millimetres, rather than joint by joint. The blocks list the kinematic chains in the project.

Move Arm To · Move Arm By · Move Arm To Pose · Move Arm By Name · Move … to X … Y … Z … at speed … … … · Move … by X … Y … Z … at speed … … · Move … to pose X … Y … Z … Roll … Pitch … Yaw … at speed … · Arm Position · … of … · Pose of … · Arm Is Moving · Wait For Arm · Wait up to … ms for … to finish moving · Last kinematics … · … of … · Kinematic chain names · Stop Arm · Stop All Arms

Ports

Read and set the controller's digital ports (on or off), analog ADC ports (a voltage as 0 to 255) and PWM outputs (0 to 100 percent).

Get Digital Port · Set Digital Port · Toggle digital … · Set digital … randomly on or off · Wait until digital … is … · Read ADC Port (8-bit) · Read ADC Port (12-bit) · Wait until ADC … is … … · Wait until ADC … is between … and … · PWM Output · PWM … · Set PWM … to a random value from … to …

Sensor

Ultrasonic distance sensors, and the EZB's own battery voltage, temperature and connection.

Get Ping Distance · Wait until ping trigger … echo … distance is … … · Wait until ping trigger … echo … distance is between … and … · Get Voltage · Get CPU Temperature · EZB … … · EZB … is connected · Report EZB … … as …

Camera

Send commands to the camera and tracking robot skills in the project. The drop-down lists what those robot skills can do.

Camera Control Command · Camera Camera Source (ezb): Start

Vision

Ask what a camera sees, one picture at a time. The camera drop-down lists the video sources in the project.

Is Colour In View · Count Colour Objects · Percent Of Picture That Is A Colour · Where Is The Largest Colour Object · Largest Colour Object · Count Objects In An HSV Range · Percent Of Picture In An HSV Range · Largest Object In An HSV Range · Average Colour · Average Colour Of Part Of The Picture · Camera Brightness · Camera Names

Audio

Speak, play sounds and notes, set the volume, and wait for the robot to hear a phrase. The sound blocks list the sounds of the audio robot skills in the project.

Play Audio · Play Audio (Wait) · Stop Audio · Say · Say (Wait) · Set volume to … percent · Volume percent · Audio output · Play note … for … ms as a … wave · Listen up to … seconds for one of … · Listen up to … seconds for anything said, prompt … · Listen up to … seconds for a number from … to … counting by …

Gamepad

Read gamepads and joysticks plugged into the computer: sticks, triggers, buttons, motion and battery, and make them rumble. Controller 0 is the first one plugged in.

Gamepad … of controller … · Gamepad button … is pressed on controller … · Wait for gamepad button … on controller … for up to … ms · Gamepad button … pressed on controller … within … ms · Gamepad … is connected · Number of gamepads · … of gamepad … · Battery percent of gamepad … · Rumble gamepad … at strength … for … ms · Rumble gamepad … heavy motor … light motor … for … ms · Stop rumbling gamepad … · Set gamepad … light to red … green … blue … · Gamepad … of controller … · Controller … is a gamepad · Raw axis # … of controller … · Raw button # … is pressed on controller … · Hat # … of controller … · Number of raw … on controller … · Gamepad …

Serial & I2C

Talk to other devices: serial ports on the computer ARCx runs on (COM), serial ports on an EZB (UART), and I2C devices on an EZB.

COM port names · Open COM port … at baud … · COM port … write text … … · COM port … write bytes … · Bytes waiting on COM port … · COM port … read … · COM port … read … bytes · Discard everything waiting on COM port … · COM port … is open · Close COM port … · Start EZB UART … at baud … · EZB UART … write text … · EZB UART … write bytes … · Bytes waiting on EZB UART … · EZB UART … read everything waiting … · EZB UART … read … bytes … · Send serial text … on digital … at baud … · Send serial bytes … on digital … at baud … · I2C write bytes … to address … · I2C write text … to address … · I2C read … bytes from address … … · I2C read one byte from address … · Set I2C clock speed to … Hz

Network

Check the internet connection, download web pages, post to web services and send UDP messages.

The internet is available · Download … waiting up to … ms · Post to … data … waiting up to … ms · Post to … data … waiting up to … ms header names … header values … · Send UDP bytes … to … port …

File

Read and write files on the computer ARCx runs on.

Read … from file … · Add text … to the end of file … … · Add bytes … to the end of file … · File … exists · File … … · … of file … · Set read position of file … to … · … file …

Tell the navigation system where the robot is and what its sensors see, and set whether it is navigating.

Set navigation status to … · Navigation robot is at X … m Y … m yaw … radians · Navigation robot is at X … m Y … m yaw … radians confidence … · Navigation obstacle at … radians range … m confidence …

UI

Talk to the person at the browser: messages, questions, workspaces and Custom UI screens.

Prompt for Text Input · Prompt for Choice (Speech) · Prompt for Number Range · Prompt for Any Number · Ask for text title … description … starting with … · Ask title … message … OK button … cancel button … · Show message box title … message … · Show popup … as … · Show robot skill … · Show workspace … · Show ARCx page … · Show custom UI screen … · Custom UI … · Current custom UI screen · Custom UI screen names · A browser is connected to ARCx

Browser

Open web pages, dashboards and kiosk screens in browser windows on the computer's monitors, and control them. Each window has a name you choose.

Open Browser Window · Show Custom UI Kiosk · Browser Go To Page · Browser Action · Browser Display Mode · Browser Move To Monitor · Browser Allow Camera And Microphone · Browser Wait For Page To Load · Browser Run JavaScript In Page · Browser Send Message To Page · Browser Wait For Message From Page · Browser Get JavaScript Value · Browser Address Or Title · Browser Window Is Open · Close All Browser Windows · Open Browser Window name … address … options (JSON) … · Browser window … is loading · Browser last message from window … topic … · Browser forget messages from window … · Browser … … for window … · Browser zoom window … to … percent · Browser place window … at x … y … width … height … · Browser save screenshot of window … to file … · Browser show developer tools for window … · List of … · Number of monitors · Browser windows can open on this computer · Browser status

Utility

Waiting, control commands for any robot skill, a block for typing your own JavaScript, and the computer itself.

Sleep (Pause) · Sleep for a random time from … to … milliseconds · Wait until the time is … : … · Control Command · Template: (choose a template) ControlCommand() · Raw JavaScript · Halt Script · Open … in the system web browser · Run program … with arguments … · An ARCx update is available · Load project … · Shut down this computer

Debug

Print messages, time parts of the program and write to the ARCx debug log, to see what a program is doing.

Print / Display Text · Print as hex … · Console … … · Console timer … named … · Console count … · Add to ARCx log … as … · Write … to the ARCx log