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

{
  "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

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

Axial pose

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

Cartesian pose

{
    "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

{
    "Type" : "bool",
    "Name" : "b1",
    "Value" : "true"
}

Number

{
    "Type": "number",
    "Name": "layerIndex",
    "Value": "1"
}

Decimal

Example for the number 3.141:

{
    "Type": "decimal",
    "Name": "blend1",
    "Value": "3141"
}

Text

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

Label

{
    "Type" : "label",
    "Name" : "label1"
}

Signal

{
    "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

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

Expression

{
    "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

{
    "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

{
    "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

{
    "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

{
    "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

{
    "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

{
    "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

{
    "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

{
    "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.

{
    "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

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

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

Waitsignal

{
    "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

{
    "MethodName": "Waitinplace",
    "Params": []
}

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

Pause

{
      "MethodName": "Pause",
      "Params": []
    }

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

Robot constants

Tool

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

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

Frame

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

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

Setspeedj

{
    "MethodName": "Setspeedj",
    "Params": [
        {
            "Type": "number",
            "Value": "90"
        }
    ]
}

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

Setspeedl

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

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

Setaccelj

{
    "MethodName": "Setaccelj",
    "Params": [
        {
            "Type": "number",
            "Value": "50"
        }
    ]
}

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

Setaccell

{
    "MethodName": "Setaccell",
    "Params": [
        {
            "Type": "number",
            "Value": "25"
        }
    ]
}

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

Setblendj

{
    "MethodName": "Setblendj",
    "Params": [
        {
        "Type": "number",
        "Value": "100"
        }
    ]
}

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

Setblendl

{
    "MethodName": "Setblendl",
    "Params": [
        {
        "Type": "number",
        "Value": "5"
        }
    ]
}

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

Variables

Assign

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

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

Assigncurrentpose

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

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

Assigncomponent

{
    "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

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

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

Copycomponent

{
    "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

 {
    "MethodName": "Abort",
    "Params": []
}

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

End

 {
    "MethodName": "End",
    "Params": []
}

End() Ends the current program.

If

{
    "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.

Else

{
    "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

{
    "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

{
    "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"
                        }
                    ]
                }
            ]
        }
    ]
}

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

Label

{
    "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

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

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

Call

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

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

Extra code lines

Comment

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

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

EmptyLine

{
      "MethodName": "EmptyLine",
      "Params": []
}

EmptyLine() Writes an empty line in the program.

Math

Add and Addto

{
    "MethodName": "Add",
    "Params": [
        {
        "Type": "number",
        "Name": "a",
        "Value": "1"
        },
        {
        "Type": "number",
        "Name": "b",
        "Value": "2"
        },
        {
        "Type": "number",
        "Name": "result"
        }
    ]
}
{
    "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

{
    "MethodName": "Sub",
    "Params": [
        {
        "Type": "number",
        "Name": "a",
        "Value": "1"
        },
        {
        "Type": "number",
        "Name": "b",
        "Value": "2"
        },
        {
        "Type": "number",
        "Name": "r"
        }
    ]
}
{
    "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

{
    "MethodName": "Div",
    "Params": [
        {
        "Type": "number",
        "Name": "a",
        "Value": "1"
        },
        {
        "Type": "number",
        "Name": "b",
        "Value": "2"
        },
        {
        "Type": "number",
        "Name": "r"
        }
    ]
}
{
    "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

{
    "MethodName": "Mult",
    "Params": [
        {
        "Type": "number",
        "Name": "a",
        "Value": "1"
        },
        {
        "Type": "number",
        "Name": "b",
        "Value": "2"
        },
        {
        "Type": "number",
        "Name": "r"
        }
    ]
}
{
    "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.

Errors

The Wepall API uses the following error codes:

Error Code Meaning
400 Bad Request -- Your request is invalid.
401 Unauthorized -- Your API key is wrong.
403 Forbidden -- Restricted language.
404 Not Found -- The robot or controller does not exist.
405 Method Not Allowed -- It is possible that the method you are asking for does not exist or does not have all its parameters.
406 Not Acceptable -- You requested a format that isn't json.
410 Gone -- The language has been removed from the server.
429 Too Many Requests -- You're requesting too many translations.
500 Internal Server Error -- We had a problem with our server. Try again later.
503 Service Unavailable -- We're temporarily offline for maintenance. Please try again later.