NAV
JSON

Wepall API 🤖

The Wepall API is an advanced robotic language translation tool. In the world of robotics, there exists a vast collection of robots that communicate in different languages, depending on their brand or controller version. Typically, programming these robots requires understanding and working with specific languages, necessitating prior learning and knowledge. However, Wepall API offers a solution by abstracting these languages, streamlining the robot programming process.

With Wepall API, you can use a standard programming language to write code, and the tool will automatically translate the commands into the appropriate language for the specified robot brand.

On this page, we will focus on explaining how to effectively use the API and how to create programs in specific robot languages. The API requests are made through a JSON file that contains objects represented by tags. You can choose to interact with the API using an editor or a programming language, whichever method suits you best.

Current available languages include: ABB, Comau, Doosan, Fanuc, Hyundai, Kassow, Kawasaki, Kuka, Motoman, Staubli and Universal Robots.

Access to the API

To access the Wepall API, you can make a POST request to the following endpoints:

You can test the endpoints here or use some other REST application. It's important to note that the /many endpoint requires a list of program objects.

Program Object

Copy to Clipboard
{ "RobotBrand": "BrandName", "RobotModel": "ModelXYZ", "RobotLanguage": "RobotLang1", "RobotDoF": 6, "Instructions": […], "ProgramName": "MyProgram", "ExtraData": "Some extra information" }

The root of the JSON used to write the sequence is the Program. This object is made up of the following fields:

These are the available brands and languagues to generate specify robot code:

RobotBrand RobotLanguage
Fanuc tpe 9.x | tpe 8.x | tpe 4.x | none
Motoman informii | informiii
Hyundai hrscript | hr-basic
ABB none
Comau none
Doosan none
Kassow none
Kawasaki none
Kassow none
Kuka none
Staubli none
Universal Robots none

Parameter Object

A parameter is the base object used to represent all the possible parameters of a method.

Variable Object

This object is used to create a variable in the robot laguaje. Objects of this subtype must have these fields:

Each type of variable has to follow the next formats:

Pose

Copy to Clipboard
{ "Type" : "pose", "Name" : "pose1", "Value" : "c;-11111;-887723;835920;-136265;179381;-89263;nuf000" }

Axial pose

Copy to Clipboard
{ "Type" : "pose", "Name" : "poseAxial", "Value" : "a;-11111;-887723;835920;-136265;179381;-89263" }

Cartesian pose

Copy to Clipboard
{ "Type" : "pose", "Name" : "poseCartesian", "Value" : "c;-11111;-887723;835920;-136265;179381;-89263;nuf000" }
Cartesian configuration

When we talk about the configuration of the body each value represents is as follows:

  1. No Flip and Flip (n|f):
    • Flip: Wrist turned, TPC positioned upwards relative to the arm.
    • No Flip: Wrist not rotated, TCP positioned downward relative to the arm.
  2. Up and Down (u|l):
    • Up: Elbow of the robot is up.
    • Down: Elbow of the robot is down.
  3. Front and Back (f|b):
    • Front: TCP in the front of the robot.
    • Back: TCP behind the robot.
  4. Limitation of rotation in the fourth axis (-1|0|1): ⇩
  5. Limitation of rotation in the fifth axis (-1|0|1): ⇩
  6. Limitation of rotation in the sixth axis (-1|0|1):
    • -1: -539º → -180º
    • 0: -179º → 179º
    • 1: 180 → 539º

Boolean

Copy to Clipboard
{ "Type" : "bool", "Name" : "b1", "Value" : "true" }

Number

Copy to Clipboard
{ "Type": "number", "Name": "layerIndex", "Value": "1" }

Decimal

Example for the number 3.141:

Copy to Clipboard
{ "Type": "decimal", "Name": "blend1", "Value": "3141" }

Text

Copy to Clipboard
{ "Type": "text", "Name": "myText", "Value": "Hello World!" }

Label

Copy to Clipboard
{ "Type" : "label", "Name" : "label1" }

Signal

Copy to Clipboard
{ "Type" : "signal", "Name" : "signal1", "SignalType" : "ao", "Port" : 108, "Size" : 16 }

d for digital, g for group and a is analog. Inputs are i and outputs are o.

Trigger

Copy to Clipboard
{ "Type": "trigger", "TriggerType": "pulse", "Distance": 0, "PulseMS": 500, "Target": { "Type": "signal", "SignalType": "do", "Port": 80, "Size": 1 }, "Source": { "Type": "bool", "Value": "true" } }

Expression

Copy to Clipboard
{ "Type": "expression", "Left": { "Type": "signal", "SignalType": "do", "Port": 80, "Size": 1 }, "Right": { "Type": "bool", "Value": "true" }, "Operator": "equal" }

<operator> can be boolean or conditional:

Method list

Copy to Clipboard
{ "Type": "methodlist", "Instructions": [ { "MethodName": "Assign", "Params": [ { "Type": "number", "Name": "vNum" }, { "Type": "signal", "Name": "GIR1", "SignalType": "Gi", "Port": 8, "Size": 16 } ] }, { "MethodName": "Call", "Params": [ { "Type": "text", "Value": "sequence" } ] } ] }

Method Object

A method corresponds to a specific Wepall API language instruction.

Signals

Setsignal

Copy to Clipboard
{ "MethodName": "Setsignal", "Params": [ { "Type": "signal", "SignalType": "Do", "Port": 80, "Size": 1 }, { "Type": "bool", "Value": "True" } ] }

Setsignal(<signal>, <value>) Sets the value of a signal.

Setsignalpulse

Copy to Clipboard
{ "MethodName": "Setsignalpulse", "Params": [ { "Type": "signal", "SignalType": "Do", "Port": 80, "Size": 1 }, { "Type": "bool", "Value": "True" }, { "Type": "number", "Value": "500" } ] }

Setsignalpulse(<signal>, <value>, <duration>) Sets the value of a signal for a given duration. Usually a digital signal set to True.

Movement

Movelinear

Copy to Clipboard
{ "MethodName": "Movelinear", "Params": [ { "Type": "pose", "Name": "LocalPosition", "Value": "c;1000000;0;500000;180000;0;90000;nuf000" } ] }

Movelinear(<pose>) Makes a linear movement to a point.

Movelinearuntil

Copy to Clipboard
{ "MethodName": "Movelinearuntil", "Params": [ { "Type": "pose", "Name": "LocalPosition", "Value": "c;1000000;0;500000;180000;0;90000;nuf000" }, { "Type": "expression", "Left": { "Type": "signal", "Name": "StopMove", "SignalType": "di", "Port": 20, "Size": 1 }, "Right": { "Type": "bool", "Value": "True" }, "Operator": "Equal" } ] }

Movelinearuntil(<pose>, <expression>) It makes a linear movement until a condition is met.

Movejoint

Copy to Clipboard
{ "MethodName": "Movejoint", "Params": [ { "Type": "pose", "Name": "LocalPosition", "Value": "c;1000000;0;500000;180000;0;90000;nuf000" } ] }

Movejoint(<pose>) Makes a joint movement to a point.

Movejointuntil

Copy to Clipboard
{ "MethodName": "Movejointuntil", "Params": [ { "Type": "pose", "Name": "LocalPosition", "Value": "c;1000000;0;500000;180000;0;90000;nuf000" }, { "Type": "expression", "Left": { "Type": "signal", "Name": "StopMove", "SignalType": "di", "Port": 20, "Size": 1 }, "Right": { "Type": "bool", "Value": "True" }, "Operator": "Equal" } ] }

Movejointuntil(<pose>, <expression>) It makes a joint movement until a condition is met.

Movecircular

Copy to Clipboard
{ "MethodName": "Movecircular", "Params": [ { "Type": "pose", "Name": "MiddlePosition", "Value": "c;1000000;0;500000;180000;0;90000;nuf000" }, { "Type": "pose", "Name": "EndPosition", "Value": "c;2000000;0;1000000;180000;0;23000;nuf000" } ] }

Movecircular(<pose>, <pose>) Circular motion towards a point. The waypoint to establish the circular motion and the destination point.

Trigger

Set a signal to True when the destination point is reached.

Copy to Clipboard
{ "MethodName": "Trigger", "Params": [ { "Type": "trigger", "TriggerType": "set", "Distance": 0, "Target": { "Type": "signal", "Name": "AtDestination", "SignalType": "do", "Port": 20, "Size": 1 }, "Source": { "Type": "bool", "Value": "True" } } ] }

Trigger(<trigger>) Creates a trigger for a movement.

Waits

Waittime

Copy to Clipboard
{ "MethodName": "Waittime", "Params": [ { "Type": "number", "Value": "500" } ] }

Waittime(<number>) Pauses the program execution for a number of milliseconds.

Waitsignal

Copy to Clipboard
{ "MethodName": "Waitsignal", "Params": [ { "Type": "signal", "Name": "ImportantInput", "SignalType": "Di", "Port": 1, "Size": 1 }, { "Type": "bool", "Value": "True" } ] }

Waitsignal(<signal>, <value>) Waits until a signal has been set to the specified value.

Waitinplace

Copy to Clipboard
{ "MethodName": "Waitinplace", "Params": [] }

Waitinplace() Pauses the program execution until the robot has stopped moving.

Pause

Copy to Clipboard
{ "MethodName": "Pause", "Params": [] }

Pause() Pauses program execution. Will need to be resumed manually.

Robot constants

Tool

Copy to Clipboard
{ "MethodName": "Tool", "Params": [ { "Type": "number", "Value": "1" } ] }

Tool(<number>) Changes the robot's current tool to that of the specified number.

Frame

Copy to Clipboard
{ "MethodName": "Frame", "Params": [ { "Type": "number", "Value": "2" } ] }

Frame(<number>) Changes the robot's current frame or base to that of the specified number.

Load

Copy to Clipboard
{ "MethodName": "Load", "Params": [ { "Type": "number", "Value": "1" } ] }

Load(<number>) Changes the robot's current payload to that of the specified number.

Setspeedj

Copy to Clipboard
{ "MethodName": "Setspeedj", "Params": [ { "Type": "decimal", "Value": "90000" } ] }

Setspeedj(<decimal>) Sets the speed percentage of the joint motion of the robot.

Setspeedl

Copy to Clipboard
{ "MethodName": "Setspeedl", "Params": [ { "Type": "decimal", "Value": "60000" } ] }

Setspeedl(<decimal>) Sets the speed percentage of the linear motion of the robot.

Setaccelj

Copy to Clipboard
{ "MethodName": "Setaccelj", "Params": [ { "Type": "decimal", "Value": "50000" } ] }

Setaccelj(<decimal>) Sets the acceleration percentage of the joint motion of the robot.

Setaccell

Copy to Clipboard
{ "MethodName": "Setaccell", "Params": [ { "Type": "decimal", "Value": "25000" } ] }

Setaccell(<decimal>) Sets the acceleration percentage of the linear motion of the robot.

Setblendj

Copy to Clipboard
{ "MethodName": "Setblendj", "Params": [ { "Type": "decimal", "Value": "100000" } ] }

Setblendj(<decimal>) Sets the blend percentage of the joint motion of the robot.

Setblendl

Copy to Clipboard
{ "MethodName": "Setblendl", "Params": [ { "Type": "decimal", "Value": "5000" } ] }

Setblendl(<decimal>) Sets the blend percentage of the linear motion of the robot.

Variables

Assign

Copy to Clipboard
{ "MethodName": "Assign", "Params": [ { "Type": "number", "Name": "var" }, { "Type": "number", "Value": "23" } ] }

Assign(<variable>, <variable>) Assigns a variable or value to a variable.

Assigncurrentpose

Copy to Clipboard
{ "MethodName": "Assigncurrentpose", "Params": [ { "Type": "pose", "Name": "MyPose" } ] }

Assigncurrentpose(<pose>) Assigns to a Pose the current pose of the robot.

Assigncomponent

Copy to Clipboard
{ "MethodName": "Assigncomponent", "Params": [ { "Type": "pose", "Name": "TPose" }, { "Type": "decimal", "Value": "500000" }, { "Type": "number", "Value": "1" } ] }

Assigncomponent(<pose>, <decimal>, <number>) Assigns a value to the specified component of a pose.

Getcomponent

Copy to Clipboard
{ "MethodName": "Getcomponent", "Params": [ { "Type": "pose", "Name": "SPose", "Value": "c;1000000;0;500000;180000;0;0;nuf000" }, { "Type": "decimal", "Name": "x" }, { "Type": "number", "Value": "1" } ] }

Getcomponent(<pose>, <decimal>, <number>) Sets the specified component of a pose to a variable.

Copycomponent

Copy to Clipboard
{ "MethodName": "Copycomponent", "Params": [ { "Type": "pose", "Name": "TPose" }, { "Type": "pose", "Name": "SPose", "Value": "c;1000000;0;500000;180000;0;0;nuf000" }, { "Type": "number", "Value": "2" } ] }

Copycomponent(<pose>, <pose>, <number>) Copies a component of one pose to another.

Flow control

Abort

Copy to Clipboard
{ "MethodName": "Abort", "Params": [] }

Abort() Aborts programs execution. This usually causes a robot error.

End

Copy to Clipboard
{ "MethodName": "End", "Params": [] }

End() Ends the current program.

If

Copy to Clipboard
{ "MethodName": "If", "Params": [ { "Type": "expression", "Left": { "Type": "expression", "Left": { "Type": "signal", "Name": "DIForceCyle", "Value": "DI0;1005" }, "Right": { "Type": "bool", "Value": "True" }, "Operator": "eq" }, "Right": { "Type": "expression", "Left": { "Type": "Decimal", "Name": "AIForceCyle", "Value": "2" }, "Right": { "Type": "signal", "Name": "GoForceCyle", "Value": "Go4;4" }, "Operator": "eq" }, "Operator": "and" }, { "Type": "methodlist", "Instructions": [ { "MethodName": "Assign", "Params": [ { "Type": "number", "Name": "layerIndex", "Value": "0" }, { "Type": "signal", "Name": "GIForcedLayer", "Value": "GI4;1007" } ] }, { "MethodName": "Assign", "Params": [ { "Type": "number", "Name": "cycleIndex", "Value": "0" }, { "Type": "signal", "Name": "GIForcedCycle", "Value": "GI4;1002" } ] }, { "MethodName": "setsignal", "Params": [ { "Type": "signal", "Name": "DOForced", "Value": "do1;101" }, { "Type": "bool", "Value": "true" } ] } ] } ] }

Creates an if command in the program with a expression and a list of commands to be executed if the condition is met.

Elseif

Copy to Clipboard
{ "MethodName": "Elseif", "Params": [ { "Type": "expression", "Left": { "Type": "expression", "Left": { "Type": "signal", "Name": "DIForceCyle", "Value": "DI0;1005" }, "Right": { "Type": "bool", "Value": "True" }, "Operator": "eq" }, "Right": { "Type": "expression", "Left": { "Type": "Decimal", "Name": "AIForceCyle", "Value": "2" }, "Right": { "Type": "signal", "Name": "GoForceCyle", "Value": "Go4;4" }, "Operator": "eq" }, "Operator": "and" }, { "Type": "methodlist", "Instructions": [ { "MethodName": "Assign", "Params": [ { "Type": "number", "Name": "layerIndex", "Value": "0" }, { "Type": "signal", "Name": "GIForcedLayer", "Value": "GI4;1007" } ] }, { "MethodName": "Assign", "Params": [ { "Type": "number", "Name": "cycleIndex", "Value": "0" }, { "Type": "signal", "Name": "GIForcedCycle", "Value": "GI4;1002" } ] }, { "MethodName": "setsignal", "Params": [ { "Type": "signal", "Name": "DOForced", "Value": "do1;101" }, { "Type": "bool", "Value": "true" } ] } ] } ] }

Creates an elseif command in the program with a expression and a list of commands to be executed if the condition is met. Must follow an if command.

Else

Copy to Clipboard
{ "MethodName": "Else", "Params": [ { "Type": "methodlist", "Instructions": [ { "MethodName": "Assign", "Params": [ { "Type": "number", "Name": "cycleIndex", "Value": "0" }, { "Type": "number", "Value": "1" } ] }, { "MethodName": "setsignal", "Params": [ { "Type": "signal", "Name": "GOCurrentCycle", "Value": "go1;101" }, { "Type": "number", "Value": "1" } ] } ] } ] }

Creates an else command in the program with a list of commands to execute, it is always inserted after an if command and will be executed if the if condition is not met.

While

Copy to Clipboard
{ "MethodName": "While", "Params": [ { "Type": "expression", "Left": { "Type": "bool", "Name": "isEOL", "Value": "True" }, "Right": { "Type": "bool", "Value": "True" }, "Operator": "eq" }, { "Type": "methodlist", "Instructions": [ { "MethodName": "Assign", "Params": [ { "Type": "number", "Name": "cycleIndex", "Value": "0" }, { "Type": "number", "Value": "1" } ] }, { "MethodName": "setsignal", "Params": [ { "Type": "signal", "Name": "GOCurrentCycle", "Value": "go1;101" }, { "Type": "number", "Value": "1" } ] } ] } ] }

Creates a command loop with an exit condition. It needs an expression for the output condition and a list of methods for execution.

Loop

Copy to Clipboard
{ "MethodName": "Loop", "Params": [ { "Type": "methodlist", "Instructions": [ { "MethodName": "Assign", "Params": [ { "Type": "number", "Name": "cycleIndex", "Value": "0" }, { "Type": "number", "Value": "1" } ] }, { "MethodName": "setsignal", "Params": [ { "Type": "signal", "Name": "GOCurrentCycle", "Value": "go1;101" }, { "Type": "number", "Value": "1" } ] } ] } ] }

Creates an execution loop with an execution list. It needs a list of commands as an argument.

Switch

Copy to Clipboard
{ "MethodName": "Switch", "Params": [ { "Type": "number", "Name": "cycleIndex", } ] }

Begins a switch/case code block. The parameter is the value to switch on.

Case

Copy to Clipboard
{ "MethodName": "Case", "Params": [ { "Type": "number", "Value": 0, }, { "Type": "methodlist", "Instructions": [ { "MethodName": "setsignal", "Params": [ { "Type": "signal", "Name": "GOCurrentCycle", "Value": "go1;101" }, { "Type": "number", "Value": "1" } ] } ] } ] }

A case statement in a switch/case code block. The first parameter is the value to compare to. The second parameter is the list of commands to execute.

CaseDefault

Copy to Clipboard
{ "MethodName": "CaseDefault", "Params": [ { "Type": "methodlist", "Instructions": [ { "MethodName": "setsignal", "Params": [ { "Type": "signal", "Name": "GOCurrentCycle", "Value": "go1;101" }, { "Type": "number", "Value": "2" } ] } ] } ] }

Defines the default case in a switch/case code block. The parameter is the list of commands to execute by default.

Label

Copy to Clipboard
{ "MethodName": "Label", "Params": [ { "Type": "label", "Name": "label1" } ] }

Label(<label>) Create a label tag in the target program to mark a part of the code

Goto

Copy to Clipboard
{ "MethodName": "Goto", "Params": [ { "Type": "label", "Name": "label1" } ] }

Goto(<label>) Moves the program pointer to the specified label.

Call

Copy to Clipboard
{ "MethodName": "Call", "Params": [ { "Type": "text", "Value": "Other" } ] }

Call(<text>) Calls a function or an other program.

Extra code lines

Comment

Copy to Clipboard
{ "MethodName": "Comment", "Params": [ { "Type": "text", "Value": "Hellow World!" } ] }

Comment(<text>) Writes a comment in program.

Code

Copy to Clipboard
{ "MethodName": "Code", "Params": [ { "Type": "text", "Value": "var a = 10;" } ] }

Code(<text>) Advanced function to manually add code to the program.

EmptyLine

Copy to Clipboard
{ "MethodName": "EmptyLine", "Params": [] }

EmptyLine() Writes an empty line in the program.

Math

Add and Addto

Copy to Clipboard
{ "MethodName": "Add", "Params": [ { "Type": "number", "Name": "a", "Value": "1" }, { "Type": "number", "Name": "b", "Value": "2" }, { "Type": "number", "Name": "result" } ] }
Copy to Clipboard
{ "MethodName": "Addto", "Params": [ { "Type": "number", "Name": "a", "Value": "1" }, { "Type": "number", "Name": "b", "Value": "2" } ] }

Add(<variable>, <variable>, <variable>) Adds first and second arguments and stores the result in the third argument. Addto(<variable>, <variable) Adds the second argument to the first, storing it in it.

Sub and Subto

Copy to Clipboard
{ "MethodName": "Sub", "Params": [ { "Type": "number", "Name": "a", "Value": "1" }, { "Type": "number", "Name": "b", "Value": "2" }, { "Type": "number", "Name": "r" } ] }
Copy to Clipboard
{ "MethodName": "Subto", "Params": [ { "Type": "number", "Name": "a", "Value": "1" }, { "Type": "number", "Name": "b", "Value": "2" } ] }

Sub(<variable>, <variable>, <variable>) Subtracts second argument from the first and stores the result in the third argument. Subto(<variable>, <variable) Subtracts the second argument from the first, storing it in it.

Div and Divto

Copy to Clipboard
{ "MethodName": "Div", "Params": [ { "Type": "number", "Name": "a", "Value": "1" }, { "Type": "number", "Name": "b", "Value": "2" }, { "Type": "number", "Name": "r" } ] }
Copy to Clipboard
{ "MethodName": "Divto", "Params": [ { "Type": "number", "Name": "a", "Value": "1" }, { "Type": "number", "Name": "b", "Value": "2" } ] }

Sub(<variable>, <variable>, <variable>) Division of the first and second argument, stores the result in the third argument. Subto(<variable>, <variable) Division of the arguments saving the result in the first one.

Mult and Multo

Copy to Clipboard
{ "MethodName": "Mult", "Params": [ { "Type": "number", "Name": "a", "Value": "1" }, { "Type": "number", "Name": "b", "Value": "2" }, { "Type": "number", "Name": "r" } ] }
Copy to Clipboard
{ "MethodName": "Multo", "Params": [ { "Type": "number", "Name": "a", "Value": "1" }, { "Type": "number", "Name": "b", "Value": "2" } ] }

Mult(<variable>, <variable>, <variable>) Multiplication of the first and second argument, stores the result in the third argument. Multo(<variable>, <variable) Multiplication of the arguments saving the result in the first one.

Program examples

WIP

Notes on languages

This section explains the possible special cases of the translator in his or her different languages.

Under construction.

ABB

Reserved variables

There are different variables that are created automatically by the api and that the user should not name in the same way.

Pose restrictions

ABB does not have different robot body configurations, only one for palletising. This configuration places the robot elbow at the top and the head parallel to the floor.

Moveuntil

There is no reasonable translation for the Movejointuntil command and it is not implemented. In the case of Movelinearuntil nested expressions are not allowed and the variable in such an expression must be a digital input signal. The expected value of the variable is negligible because the command will cause the robot to stop when the state of the signal changes, regardless of its value.

Trigger

Call triggers do not exist at ABB.