VBXC3.0 Process Scripting

Last Updated: 11 April 2019

Overview

The VBXC3.0 process scripting is designed to be a simple to use way of creating machining scripts controlling the actions of the robot and CNC machine. It's intention is to allow for advanced users to create and modify scripts to add and remove functionality or optimize processes.

Script Format

Process scripts are written using standard JSON (JavaScript Object Notation) format that must be adhered to.

Process scripts follow the following format:

Why JSON?

Parameters

Parameters are what is shown to the user in the part configuration that allows them to enter custom values. These consist of values such as shelf entry height, jaws, table load program, milling program, etc.

Standard parameters consist of a type, id, label, and an optional default.

Example parameter: { "type": "string", "id": "washProgram", "label": "CNC Wash Program" "default": "81004" }

Types

There are several different types of parameters. Simple parameters such as string or number which are used to pass values to process commands. And advanced parameters such as if and group which are used to extend the functionality of parameters for the user.

String

String parameters are like they sound, strings. They are expected to be a mix of letters and numbers. Used for inputs such as milling program.

Example:

{ "type": "string", "id": "op1Program", "label": "Op 1 Milling Program Number" }

Number

Number parameters expect a number. Used for inputs such as clamping pressure.

Example:

{ "type": "number", "id": "op1pressure", "label": "Op 1 Clamping Pressure" }

Boolean

Boolean parameters are an advanced parameters that allow the user enable functionality. Boolean parameters are displayed to the user as a checkbox. These are used to enable inputs for pick offsets or enabling robot or vise settling. See if for an example of how one of these parameters are used.

Example:

{ "type": "boolean", "id": "op1RobotSettle", "label": "Op 1 Robot Settle" }

Millimeters

Millimeter parameters are parameters for an input of a particular unit. These parameters will display either (Millimeters) or (Inches) depending on the units selected in the VBXC.

Example:

{ "type": "millimeters", "id": "entryHeight", "label": "Shelf Entry Height" }

Jaws

Jaws parameter is a special parameter that displays a dropdown for the user with all of the jaws in the VBXC.

Example:

{ "type": "Jaws", "id": "op1Jaws", "label": "Op 1 Jaws" }

If

If parameters are an advanced parameter used for enabling additional functionality. For example, if there is an optional input value such as a different table load program for vise 2 from vise 1.

Example: The following example uses a boolean value to determine whether or not to show the parameter of id "vise2TableProgram".

{ "type": "boolean", "id": "vise2different", "label": "Different Vise 2 Table Program" },
{
    "type": "If",
    "condition": "vise2different",
    "parameters": [ { "type": "string", "id": "vise2TableProgram", "label": "Vise 2 Table Program Number" } ]
}

Group

Group parameters are advanced parameters that are used only for display purposes. If there are two related inputs, you can group those parameters together. In the user interface, these inputs will be displayed side by side on the same row.

Example:

{
    "type": "Group",
    "parameters": [
    { "type": "millimeters", "id": "pickXOffset", "label": "Pick X Offset", "default": 0 },
    { "type": "millimeters", "id": "pickYOffset", "label": "Pick Y Offset", "default": 0 }
    ]
}

Divider

Dividers are special parameters that are not used for input. They are specifically used for display purposes only. They create a divider wherever you place then in the list of parameters with the label in the middle. They are typically used for separating unrelated parameters or grouping like parameters like Op1.

Example:

{ "type": "Divider", "label": "Op 1" }

Process Commands

Process commands are used to control the vbxc, robot, CNC, vises, and used to implement advanced features within the script.

Process commands follow the following format:

{ 
    "cmd": "CommandName",
    "parameter1": "value",
    "parameter2": { "param": "ParameterName" }
}

All process commands have a cmd parameter. Process commands have 0 or more additional parameters that are either required or optional. If a process command parameter is intended to use a parameters specified by the user, it can be referenced with the following syntax as shown in the example above:

{ "param": "ParameterName" }

ClearAllSlotsButFirstLoaded

Clears all of the shelf slots except for the first loaded slot. Specifically used in testing process scripts like TestAllSlots.

Parameters Description Type Required
None

Example:

{ "cmd": "ClearAllSlotsButFirstLoaded", "id": { "param": "op1Jaws" } }

CloseVises

Close all vises

Parameters Description Type Required
None

Example:

{ "cmd": "CloseVises" }

CNCRun

Run the CNC machine with a provided program. If the CNC Door is open, this command will close the door

Parameters Description Type Required
program Program for the CNC to run string True
timeout Timeout period in seconds to wait for a response number False

Example:

{ "cmd": "CNCRun", "program": { "param": "washProgram" } }

DumpCoolant

Attempt to clean coolant off of the part before bringing it back into the enclosure

Parameters Description Type Required
count Number of times the part should be rotated to clean part number False

Example:

{ "cmd": "DumpCoolant", "count": { "param": "dumpRotations" } }

If

Advanced command used to

Parameters Description Type Required
condition True or False condition, if true will run the execute command, otherwise will run the otherwise command boolean True
execute Command to be executed if the condition is true Command True
otherwise Command to be executed if the condition is false Command False

Example:

{
    "cmd": "If",
    "condition": { "param": "clap" },
    "execute": {
        "cmd": "PlacePart",
        "jaws": { "param": "op2Jaws" },
        "entryHeight": { "param": "entryHeight" },
        "placeHeight": { "param": "placeHeight" },
        "xOffs": { "param": "placeXOffset" },
        "yOffs": { "param": "placeYOffset" },
        "clapCount": { "param": "clapCount" },
        "clapFrequency": { "param": "clapFrequency" }
    },
    "otherwise": {
        "cmd": "PlacePart",
        "jaws": { "param": "op2Jaws" },
        "entryHeight": { "param": "entryHeight" },
        "placeHeight": { "param": "placeHeight" },
        "xOffs": { "param": "placeXOffset" },
        "yOffs": { "param": "placeYOffset" }
    }
}

LoadPart

Load the part into the jaws on a vise

Parameters Description Type Required
viseJaws ID of the vise jaws string (jaws) True
gripperJaws ID of the gripper jaws string (jaws) True
vise Specifies which vise/chuck to load the part into. Use "1" to select the first vise/chuck and "2" to specify the second vise/chuck number True
height Specifies the z (length or height) of a part to be loaded number True
x This is the x offset of a part to be loaded number False
y This is the y offset of a part to be loaded number False
gripper Specifies the version of gripper to be used, only necessary if utilizing VersaBuilt DoubleHeaded Gripper number False

Example:

{
    "cmd": "LoadPart",
    "viseJaws": { "param": "op1Jaws" },
    "gripperJaws": { "param": "op2Jaws" },
    "vise": 1,
    "height": { "param": "transferHeight" }
}

LoadPipe

Load a pipe into a chuck on a lathe

Parameters Description Type Required
clamp Indicates ID or OD clamping, "true" for ID and "false" for OD boolean True
gripperJaws ID of the gripper jaws string (jaws) True
vise Specifies which vise/chuck to load the part into. Use "1" to select the first vise/chuck and "2" to specify the second vise/chuck. number True
height Specifies the z (length or height) of a part to be loaded number True
x Specifies is the x offset for loading number False
y Specifies is the y offset for loading number False
gripper Specifies the version of gripper to be used, only necessary if utilizing VersaBuilt DoubleHeaded Gripper number False

Example:

{
    "cmd": "LoadPipe",
    "clamp": { "param": "loadClamp" },
    "gripperJaws": { "param": "op2Jaws" },
    "vise": 1,
    "height": { "param": "transferHeight" }
}

LoadSlots

This command will load the specified number of parts into the available slots on the shelf. Used for testing process scripts like TestAllSlots.

Parameters Description Type Required
count Specifies the number of parts to be loaded into the slots on the shelf number True

Example:

{
    "cmd": "LoadSlots",
    "count": { "param": "slotCount" }
}

LoadVise

This command will place the soft jaws in the specified vise

Parameters Description Type Required
vise Specifies which vise to place the soft jaws into. Use "1" to select the first operation vise and "2" to specify the second operation vise. number True
jaws ID of the jaws string (jaws) True
gripper Specifies the version of gripper to be used, only necessary if utilizing VersaBuilt DoubleHeaded Gripper number False

Example:

{ "cmd": "LoadVise", "vise": 1, "jaws": { "param": "op1Jaws" } }

MoveHome

This command will move to the home position

Parameters Description Type Required
home This argument specifies which home position to move to string ("InCNC" | "CNC" | "Rack1" | "Rack2" | "WashBucket") True
mode Determines the mode of the gripper. Use "Part" for upside down and "Pallet" for right side up string ("Part" | "Pallet") True

Example:

{ "cmd": "MoveHome", "home": "CNC", "mode": "Pallet" }

OpenVises

Opens all available vises

Parameters Description Type Required
None

Example:

{ "cmd": "OpenVises" }

OpStop

Stop Operation

Parameters Description Type Required
None

Example:

{ "cmd": "OpStop" }

Parallel

This command will let you run multiple commands in parallel

Parameters Description Type Required
commands Commands that will be run simultaneously Array True

Example:

{
    "cmd": "Parallel",
    "commands": [
        { "cmd": "SetPressure", "pressure": { "param": "op1pressure" } },
        { "cmd": "CNCRun", "program": { "param": "washProgram" } },
        { "cmd": "MoveHome", "home": "CNC", "mode": "Pallet" }
    ]
}

PartStart

This command will tell the VBXC that a part has been started

Parameters Description Type Required
None

Example:

{ "cmd": "PartStart" }

PartComplete

This command will tell the VBXC that a part has been completed

Parameters Description Type Required
None

Example:

{ "cmd": "PartComplete" }

PickJaws

This command will control the robot movement to pick the set of jaws off of the shelf

Parameters Description Type Required
id ID of the jaws to place on the shelf string (jaws) True
gripper Specifies the version of gripper to be used, only necessary if utilizing VersaBuilt DoubleHeaded Gripper number False

Example:

{ "cmd": "PickJaws", "id": { "param": "op1Jaws" } }

PlaceJaws

This command will control the robot movement to a specific shelf location and place a set of jaws on the shelf

Parameters Description Type Required
id ID of the jaws to place on the shelf string True
gripper Specifies the version of gripper to be used, only necessary if utilizing VersaBuilt DoubleHeaded Gripper number False

Example:

{ "cmd": "PlaceJaws", "id": { "param": "op1Jaws" } }

PickPart

This command picks a part up off of the shelf

Parameters Description Type Required
pickHeight This argument specifies the height at which the robot will attempt to pick up the part number True
entryHeight This argument specifies the height at which the robot will enter and exit the shelf number True
maxTries Maximum number of tries to pick up a part before throwing an error number False
xOffs The offset value in the X direction number False
yOffs The offset value in the Y direction number False
jaws ID of the jaws string False
gripper Specifies the version of gripper to be used number False
ySafeOut Y distance when exiting number False

Example:

{
    "cmd": "PickPart",
    "jaws": { "param": "op1Jaws" },
    "entryHeight": { "param": "entryHeight" },
    "pickHeight": { "param": "pickHeight" },
    "xOffs": { "param": "pickXOffset" },
    "yOffs": { "param": "pickYOffset" }
}

PlacePart

This command will control the robot movement to a specific shelf location and drop the part directly onto the shelf

Parameters Description Type Required
entryHeight This argument specifies the height at which the robot will enter and exit the shelf number True
placeHeight Specifies the height at which to place the part number True
jaws ID of the jaws string False
xOffs The offset value in the X direction number False
yOffs The offset value in the Y direction number False
gripper Specifies the version of gripper to be used number False
ySafeOut Y distance when exiting number False
clapCount Specifies how many times the gripper should rapidly open and close the gripper to release the part on to the shelf. Use 0 to turn this feature off. This feature is used to overcome surface tension between parts and jaws. number False
clapFrequency Specifies how quickly the gripper claps. The value is the number of claps per second. Not used if ClapCount is 0. number False

Example:

{
    "cmd": "PlacePart",
    "jaws": { "param": "op2Jaws" },
    "entryHeight": { "param": "entryHeight" },
    "placeHeight": { "param": "placeHeight" },
    "xOffs": { "param": "placeXOffset" },
    "yOffs": { "param": "placeYOffset" },
    "clapCount": { "param": "clapCount" },
    "clapFrequency": { "param": "clapFrequency" }
}

PlacePartNextSlot

Command to place the part in the gripper in the next slot on the shelf. If the last slot was just picked from, it will place on the first slot of the next shelf.

Parameters Description Type Required
entryHeight This argument specifies the height at which the robot will enter and exit the shelf number True
placeHeight Specifies the height at which to place the part number True
jaws ID of the jaws string True
xOffs The offset value in the X direction number False
yOffs The offset value in the Y direction number False
gripper Specifies the version of gripper to be used number False

Example:

{
    "cmd": "PlacePartNextSlot",
    "jaws": { "param": "op1Jaws" },
    "entryHeight": { "param": "entryHeight" },
    "placeHeight": { "param": "placeHeight" }
}

Sequence

This command allows you to ensure that the commands within are run in sequence. This is typically run within a parallel command as all commands are ran in sequence by default.

Parameters Description Type Required
commands List of commands that should be run in order array True

Example:

{
    "cmd": "Parallel",
    "commands": [
        { "cmd": "SetPressure", "pressure": { "param": "op1pressure" } },
        {
            "cmd": "Sequence",
            "commands": [
                { "cmd": "PickJaws", "id": { "param": "op1Jaws" } },
                { "cmd": "PartStart" },
                {
                    "cmd": "PickPart",
                    "jaws": { "param": "op1Jaws" },
                    "entryHeight": { "param": "entryHeight" },
                    "pickHeight": { "param": "pickHeight" },
                    "xOffs": { "param": "pickXOffset" },
                    "yOffs": { "param": "pickYOffset" }
                },
                { "cmd": "MoveHome", "home": "CNC", "mode": "Pallet" }
            ]
        }
    ]
}

SetAO

This command sets the Analog Output value

Parameters Description Type Required
id ID of the analog output number True
value Value to set the output to number True

Example:

{
    "cmd": "SetAO",
    "id": { "param": "id" },
    "value": { "param": "value" }
}

SetDO

This command sets the Digital Output value

Parameters Description Type Required
id ID of the digital output number True
value Value to set the output to boolean True

Example:

{
    "cmd": "SetDO",
    "id": { "param": "id" },
    "value": { "param": "value" }
}

SetPressure

Sets the pressure

Parameters Description Type Required
pressure number True
high number False
low number False

Example:

{ "cmd": "SetPressure", "pressure": { "param": "op1pressure" } }

SettlePart

This command settles the part in the jaws

Parameters Description Type Required
jaws ID of the jaws string True
settleAngle This argument indicates the angle (in degrees) where the part settling will occur number False
settleAxis This argument indicates the axis of rotation to settle the part number False
settleTime This argument indicates the amount of time to wait to settle the part number False
gripper Specifies the version of gripper to be used, only necessary if utilizing VersaBuilt DoubleHeaded Gripper number False

Example:

{
    "cmd": "SettlePart",
    "jaws": { "param": "op1Jaws" },
    "settleAngle": { "param": "op1RobotSettleAngle" },
    "settleTime": { "param": "op1RobotSettleTime" }
}

TestDelay

This command will add a delay between process script steps. Needed for simulation testing mostly in process scripts like TestAllSlots.

Parameters Description Type Required
milliseconds This argument indicates the amount of time in milliseconds to delay number True

Example:

{ "cmd": "TestDelay", "milliseconds": { "param": "delay" } }

TestVises

This command will test the vises by first opening them and then closing them. This command is deprecated. Use OpenVises and CloseVises instead.

Parameters Description Type Required
None

Example:

{ "cmd": "TestVises" }

UnloadPart

Unloads a part from a vise/chuck

Parameters Description Type Required
viseJaws ID of the vise jaws string True
gripperJaws ID of the gripper jaws string True
vise This argument specifies which vise to place the soft jaws into. Use "1" to select the first operation vise and "2" to specify the second operation vise. number True
height This argument specifies the height at which the robot will enter and exit the shelf number True
gripper Specifies the version of gripper to be used number False
x This is the X coordinate offset to unload from number False
y This is the Y coordinate offset to unload from number False

Example:

{
    "cmd": "UnloadPart",
    "viseJaws": { "param": "op1Jaws" },
    "gripperJaws": { "param": "op2Jaws" },
    "vise": 1,
    "height": { "param": "transferHeight" }
}

UnloadPipe

Unloads a pipe from the vise onto the shelf

Parameters Description Type Required
clamp Indicates ID or OD clamping, "true" for ID and "false" for OD boolean True
gripperJaws ID of the gripper jaws string True
vise This argument specifies which vise to place the soft jaws into. Use "1" to select the first operation vise and "2" to specify the second operation vise. number True
height This argument specifies the height at which the robot will enter and exit the shelf number True
gripper Specifies the version of gripper to be used number False
x This is the X coordinate to unload from number False
y This is the Y coordinate to unload from number False

Example:

{
    "cmd": "UnloadPipe",
    "clamp": { "param": "loadClamp" },
    "gripperJaws": { "param": "op2Jaws" },
    "vise": 1,
    "height": { "param": "transferHeight" }
}

UnloadVise

Unload the gripper from the given vise.

Parameters Description Type Required
vise This argument specifies which vise to place the soft jaws into. Use "1" to select the first operation vise and "2" to specify the second operation vise. number True
jaws ID of the jaws being used number True
gripper Specifies the version of gripper to be used number False

Example:

{ "cmd": "UnloadVise", "vise": 1, "jaws": { "param": "op1Jaws" } }

ViseSettle

Open the vise to let the part settle in the gripper and close it again.

Parameters Description Type Required
vise This argument specifies which vise to place the soft jaws into. Use "1" to select the first operation vise and "2" to specify the second operation vise. number True
jaws ID of the jaws being used string True

Example:

{ "cmd": "ViseSettle", "vise": 2, "jaws": { "param": "op2Jaws" } }

WaitForDI

Wait for a digital input to match passed value. Resolves when the value matches. If timeout is passed, the promise will reject if it has not resolved within past time in ms.

Parameters Description Type Required
id ID of the digital input device number True
value Value expected from the digital input boolean True
timeout Timeout in milliseconds to wait for response number False

Example:

{ 
    "cmd": "WaitForDI",
    "id": { "param": "id" },
    "value": { "param": "inputVal" },
    "timeout": { "param": "timeout" } 
}

WashBucket

Wash bucket operation

Parameters Description Type Required
type Type of operation to perform in the wash bucket, the options are "RinseThenDry", "Rinse", or "Dry" string ("RinseThenDry" | "Rinse" | "Dry") True
jawOpen Tells whether or not the jaws should be open boolean True
speed Robot speed while moving through rinse and dry number False

Example:

{
    "cmd": "WashBucket",
    "type": "RinseThenDry",
    "speed": { "param": "speed" },
    "jawOpen": true
}