User Command Guide
Change Note
Type | Changes | Compatible Task Editor Module Version | |
---|---|---|---|
1 | NEW | First created. Interface design for ‘User Commands’ function. | v1.0.0
|
2 | NEW |
| v1.4.0
|
3 | REMOVED |
| v1.4.0
|
4 | NEW |
![]() | v2.0.5
|
5 | NEW | Release UserCommand V2
| v4.0.18 |
Overview
Task Editor is a default module included in Dart-Platform and User Command is one of the functions in this module.
What is the User Command?
The User Command module is ideal for adding new command blocks in the Task Editor module.
Advantages
Peripheral device vendors can provide user commands, allowing users to use peripheral devices directly in the task editor, in addition to connection and configuration functionalities (equivalent to skills in Dart-Platform 2.x).
A single module can offer multiple user commands.
![]()
| ![]() |
1. Interface call relationship diagram

Interface version
Interface Version | Action | Channel Events |
---|---|---|
V1 (Dart-Platform v3.2.0 or later & TaskEditor v2.x.x or before) | com.dart.module.taskeditor.action.USER_COMMAND
|
|
V2 (Dart-Platform v3.4.0 or later & TaskEditor v4.0.18 or later) | com.dart.module.taskeditor.action.USER_COMMAND_V2
|
Note. When migrating to V2, simply replacing Supports the following interfaces in addition to V1.
|
The Interface that User Command type module supports are following below.
Use Case | Description | |
---|---|---|
1 | List-up |
|
2 | Start a PiP Screen with/without saved data |
|
3 | Get data from the PiP Screen |
|
4 | Request save DRL Function Definition for the User Command to the Controller |
CODE
|
5 | Generate Function Call of the User Command |
CODE
|
2. Detailed Definition on the Interface and its Example codes
Task Editor module considers defined component ‘com.dart.module.taskeditor.action.USER_COMMAND’ as module component that provides interface for ‘User Command’.
2-1) List-up
When: entering into Task writing screen of Task Editor module.
Purpose: To display User Command module block which is installed in Dart-Platform within the ‘User Commands’ Category.
Method: IModulePackageManager & Message
Type | Value | Description / Mandatory | |
---|---|---|---|
action | Interface version V1
TYPESCRIPT
| Action and Category info for Task Editor components. The interface version and how it works (data structure) change based on the Action name. | O |
Interface version V2 RECOMMENDED
TYPESCRIPT
| O | ||
category |
TYPESCRIPT
| O | |
data |
TYPESCRIPT
| Declare when a Start–End command structure is required, as shown below. ![]()
| X |
2-2) Start a PiP Screen with/without saved data
When: selecting ‘User Command’ block which is added within the task of Task Editor module
Purpose: To displaying the PRoperty of selected User Command (PiP Screen) and initialize data.
Method : IModuleScreenManager & Message
Type | Value | Description/Mandatory | |
---|---|---|---|
componentId | componentId | Component ID information of the target PIP Screen | O |
data |
TYPESCRIPT
|
| O |
TYPESCRIPT
|
| O | |
TYPESCRIPT
|
| O |
2-3) Get data from PiP Screen
When: saving the task of Task Editor module
Purpose: To transmit and receive data in order to save the user’s entered value within Property (PiP Screen) of User command module into Task Editor DB.
Method: ModuleScreen & IModuleChannel
Type | Value | Description/Mandatory | ||
---|---|---|---|---|
Event Name | Parameter | |||
Request: Task Editor |
CODE
| - |
| O |
Response: User Command |
CODE
|
| ||
Request: Task Editor V2 |
CODE
| - |
| O |
Response: User Command V2 |
TYPESCRIPT
|
| ||
Send: User Command |
TYPESCRIPT
| - |
| O |
Recevie: Task Editor |
CODE
| |||
Send: User Command V2 |
TYPESCRIPT
| - | O | |
Recevie: Task Editor V2 |
TYPESCRIPT
|
2-4) Request to save Commands Definition as sub program / Generate Command Call through ModuleService
When: generating DRL syntax for task execution in Task Editor module
Purpose : To transmit and receive the DRL syntax information on User Command used in Task.
Method : ModuleService & IModuleChannel
Sort | Value | Description/Mandatory | ||
---|---|---|---|---|
Event Name | Parameter | |||
Request: Task Editor |
CODE
|
TYPESCRIPT
|
| O |
Response: User Command |
TYPESCRIPT
|
| ||
Request: Task Editor |
CODE
|
TYPESCRIPT
|
| X |
Response: User Command |
TYPESCRIPT
|
| ||
Request: Task Editor |
CODE
|
TYPESCRIPT
|
CODE
| O |
Response: User Command |
TYPESCRIPT
|
e.g. default return value
CODE
e.g. When the data is invalid and the DRL cannot be generated, the value should be provided as shown below.
CODE
An example DRL that is generated is as follows:
CODE
| ||
Request: Task Editor V2 |
CODE
|
TYPESCRIPT
|
| X |
Response: User Command V2 |
TYPESCRIPT
|
| ||
Request: Task Editor V2 |
CODE
|
TYPESCRIPT
|
If | X |
Response: User Command V2 |
TYPESCRIPT
|
| ||
Send: Task Editor V2 |
CODE
|
TYPESCRIPT
|
| X |
Receive: User Command V2 | ||||
Send: User Command V2 |
CODE
|
TYPESCRIPT
|
| X |
Response: Task Editor V2 |
2-5) Get / Watch Global / System Variables from Task Editor
When: selecting the ‘User Command’ block added within the task of the Task Editor module
Purpose: Provide variables to store result values in the Property (PiP Screen) of the selected User Command
Method: IModuleScreenManager & Message
Type | Value | Description/Mandatory | ||
---|---|---|---|---|
Event Name | Parameter | |||
Request: User Command |
CODE
| - |
CODE
| X |
Response: Task Editor |
TYPESCRIPT
| |||
Request: User Command V2 |
CODE
| - | X | |
Response: Task Editor V2 |
TYPESCRIPT
|
CODE
| ||
Send: Task Editor |
CODE
|
TYPESCRIPT
|
| X |
Receive: User Command | ||||
Send: Task Editor V2 |
CODE
|
TYPESCRIPT
|
| X |
Receive: User Command V2 | ||||
Request: User Command V2 |
CODE
| - |
| X |
Response: Task Editor V2 |
TYPESCRIPT
| |||
Send: Task Editor V2 |
CODE
|
TYPESCRIPT
|
| X |
Receive: User Command V2 | ||||
Request: User Command V2 |
CODE
| - |
| X |
Response: Task Editor V2 |
TYPESCRIPT
| |||
Send: Task Editor V2 |
CODE
|
TYPESCRIPT
|
| X |
Receive: User Command V2 |
Reference: Data type definitions
import { ConveyorCoordinates, ConveyorDistance, ConveyorEnv, ConveyorWorkpieceContainerType, CoordinateSystem, ExternalEncoderChannel, ExternalEncoderModeData, ExternalEncoderPolarityData, ManipulatorPose, SixNumArray, SystemVariableType } from "dart-api";
export const ACTION_USER_COMMAND_SERVICE = "com.dart.module.taskeditor.action.USER_COMMAND_V2";
export const TaskEditorScreenEvent = {
GET_VARIABLES: "get_variables",
CHANGED_VARIABLES: "changed_variables",
GET_CONVEYOR_COORDINATES: "get_conveyor_coordinates",
CHANGED_CONVEYOR_COORDINATES: "changed_conveyor_coordinates",
GET_COMMAND_DEFINED_DATA: "get_command_defined_data",
CHANGED_COMMAND_DEFINED_DATA: "changed_command_defined_data"
};
export const UserCommandScreenEvent = {
SAVED_DATA: "savedData",
SAVED_VERSION: "savedVersion",
GET_DATA: "get_current_data",
DATA_CHANGED: "data_changed",
};
export const UserCommandServiceEvent = {
SAVE_SUB_PROGRAM: "req_to_save_commands_def_as_sub_program",
GET_REQUIRED_SUB_PROGRAM: "get_required_sub_program",
GEN_COMMAND_CALL: "gen_command_call",
START_COMMAND_DATA_MONITOR: "start_command_data_monitor",
STOP_COMMAND_DATA_MONITOR: "stop_command_data_monitor",
UPDATE_TASK_DATA_TO_MONITOR: "update_task_data_to_monitor",
COMMAND_DATA_VALIDITY_CHANGED: "command_data_validity_changed"
};
///////////////////////////// [START] Common /////////////////////////////
export const CommandDataValidity = {
ERROR: -1,
INVALID: 0,
VALID: 1
} as const;
export type CommandDataValidity = typeof CommandDataValidity[keyof typeof CommandDataValidity];
export const VariableDivision = {
SYSTEM: 0,
GLOBAL: 1,
DEFINE: 2,
COMMAND_DEFINED: 3
} as const;
export type VariableDivision = typeof VariableDivision[keyof typeof VariableDivision];
export const VariableType = {
...SystemVariableType,
CONVEYOR: 0x0001_0001
} as const;
export type VariableType = typeof VariableType[keyof typeof VariableType];
export const UserCommandDefinedDataScope = {
ALL: 0,
BELOW: 1,
CHILD: 2
} as const;
export type UserCommandDefinedDataScope = typeof UserCommandDefinedDataScope[keyof typeof UserCommandDefinedDataScope];
export type TaskEditorVariable = {
name: string;
division: typeof VariableDivision.SYSTEM | typeof VariableDivision.GLOBAL;
type: SystemVariableType;
data: string;
coordinates?: CoordinateSystem | number;
};
export type TaskEditorVariableV2 = {
name: string;
division: VariableDivision;
type: VariableType;
data: string;
coordinates?: CoordinateSystem | number | string;
};
export type TaskEditorPoseVariable = Omit<TaskEditorVariableV2, "data"> & {
data: SixNumArray;
}
export type CommandDefinedVariable = Omit<TaskEditorVariableV2, "division"> & {
division: typeof VariableDivision.COMMAND_DEFINED
};
export type CommandData = Record<string, any>;
export type CommandDefinedData = {
packageName: string;
componentId: string;
data: Record<string, any>;
};
export type SharedCommandDefinedData = CommandDefinedData & {
providerPath: string; // added by Task Editor
};
export type ConveyorCoordinatesData = {
name: string;
containerType: ConveyorWorkpieceContainerType;
timeout?: number;
offsetCoordinates?: {
pose?: ManipulatorPose;
variable?: string;
}
encoder: ExternalEncoderModeData & ExternalEncoderPolarityData & {
channel: ExternalEncoderChannel;
}
conveyor: {
name: string;
env: ConveyorEnv;
coordinates: ConveyorCoordinates;
distance: ConveyorDistance;
}
};
export type TaskData = {
variables: TaskEditorVariableV2[];
conveyorCoordinates: ConveyorCoordinatesData[];
commandDefinedData: SharedCommandDefinedData[];
};
export type MonitorId = string;
///////////////////////////// [END] Common /////////////////////////////
///////////////////////////// [START] TaskEditorScreen /////////////////////////////
// [START] TaskEditorScreenEvent.GET_VARIABLES / CHANGED_VARIABLES
export type GetVariableReq = undefined;
export type GetVariableRes = TaskEditorVariable[];
export type GetVariableV2Req = undefined;
export type GetVariableV2Res = TaskEditorVariableV2[];
// [END] TaskEditorScreenEvent.GET_VARIABLES / CHANGED_VARIABLES
// [START] TaskEditorScreenEvent.GET_CONVEYOR_COORDINATES / CHANGED_CONVEYOR_COORDINATES
export type GetConveyorCoordinatesReq = undefined;
export type GetConveyorCoordinatesRes = ConveyorCoordinatesData[];
// [END] TaskEditorScreenEvent.GET_CONVEYOR_COORDINATES / CHANGED_CONVEYOR_COORDINATES
// [START] TaskEditorScreenEvent.GET_COMMAND_DEFINED_DATA / CHANGED_COMMAND_DEFINED_DATA
export type getCommandDefinedDataReq = undefined;
export type getCommandDefinedDataRes = SharedCommandDefinedData[];
// [END] TaskEditorScreenEvent.GET_COMMAND_DEFINED_DATA / CHANGED_COMMAND_DEFINED_DATA
///////////////////////////// [END] TaskEditorScreen /////////////////////////////
///////////////////////////// [START] UserCommandScreen /////////////////////////////
// [START] UserCommandScreenEvent.GET_DATA / DATA_CHANGED
export type GetDataReq = undefined;
export type GetDataRes = CommandData | undefined;
export type GetDataV2Req = undefined;
export type GetDataV2Res = {
data?: CommandData;
validity: CommandDataValidity;
summary: string;
commandDefined?: {
scope: UserCommandDefinedDataScope;
conveyorCoordinates?: ConveyorCoordinatesData[];
variables?: CommandDefinedVariable[];
data?: CommandDefinedData;
}
};
// [END] UserCommandScreenEvent.GET_DATA / DATA_CHANGED
///////////////////////////// [END] UserCommandScreen /////////////////////////////
///////////////////////////// [START] UserCommandService /////////////////////////////
// [START] UserCommandServiceEvent.SAVE_SUB_PROGRAM
export type SaveSubProgramReq = {
programName: string;
};
export type SaveSubProgramRes = boolean;
// [END] UserCommandServiceEvent.SAVE_SUB_PROGRAM
// [START] UserCommandServiceEvent.GET_REQUIRED_SUB_PROGRAM
export type GetRequiredSubProgramReq = {
// User Command's component id
componentId: string;
// User Command's saved data
data: CommandData;
};
export type GetRequiredSubProgramRes = null | {
// ModuleService's package name
packageName: string;
// ModuleService's component id
componentId: string;
// ModuleService's action
action: string;
// IModuleChannel's event to request to save a sub program
eventName: string;
// sub program's name
programName: string;
// options for the sub program
options?: Record<string, any>;
}[];
// [END] UserCommandServiceEvent.GET_REQUIRED_SUB_PROGRAM
// [START] UserCommandServiceEvent.GEN_COMMAND_CALL
export type GenCommandCallReq = {
componentId: string;
data: CommandData;
endCommand?: boolean;
};
export type GenCommandCallRes = string | {
command?: string;
validity?: boolean;
variableName?: string;
};
// [END] UserCommandServiceEvent.GEN_COMMAND_CALL
// [START] UserCommandServiceEvent.START_COMMAND_DATA_MONITOR
export type StartCommandDataMonitorReq = {
componentId: string;
data: GetDataV2Res;
taskData: TaskData;
};
export type StartCommandDataMonitorRes = MonitorId | null;
// [END] UserCommandServiceEvent.START_COMMAND_DATA_MONITOR
// [START] UserCommandServiceEvent.STOP_COMMAND_DATA_MONITOR
export type StopCommandDataMonitorReq = {
id?: MonitorId;
};
export type StopCommandDataMonitorRes = boolean;
// [END] UserCommandServiceEvent.STOP_COMMAND_DATA_MONITOR
// [START] UserCommandServiceEvent.UPDATE_TASK_DATA_TO_MONITOR
export type UpdateTaskDataToMonitorReq = {
id: MonitorId;
taskData: TaskData;
};
// [END] UserCommandServiceEvent.UPDATE_TASK_DATA_TO_MONITOR
// [START] UserCommandServiceEvent.COMMAND_DATA_VALIDITY_CHANGED
export type CommandDataValidityChangedRes = {
id: MonitorId;
validity: CommandDataValidity;
};
// [END] UserCommandServiceEvent.COMMAND_DATA_VALIDITY_CHANGED
///////////////////////////// [END] UserCommandService /////////////////////////////