Software version : V2.10
Document version : V2.7.2
Original instructions(en_US)

Programming manual(V2.10)

M0609 | M0617 | M1013 | M1509 | H2017 |H2515 | A0509 | A0509S | A0912 | A0912S© 2022 Doosan Robotics Inc.

Table of Contents
1

Preface ......................................................................................15

1.1

Copyright ............................................................................................... 15

2

DRL Basic Syntex ........................................................................16

2.1

Basic Syntax ........................................................................................... 16

2.1.1

Indent...................................................................................................................... 16

2.1.2

Comment ................................................................................................................. 17

2.2

Variable ................................................................................................. 17

2.2.1

Variable name .......................................................................................................... 17

2.2.2

Numeric value .......................................................................................................... 18

2.2.3

String ...................................................................................................................... 19

2.2.4

list ........................................................................................................................... 20

2.2.5

tuple........................................................................................................................ 20

2.2.6

dictionary ................................................................................................................ 21

2.3

Function ................................................................................................ 21

2.3.1

Function Syntax........................................................................................................ 21

2.3.2

Scoping rule ............................................................................................................. 23

2.3.3

Parameter mode....................................................................................................... 23

2.4

Control Statement .................................................................................. 24

2.4.1

pass ......................................................................................................................... 24

2.4.2

if ............................................................................................................................. 25

2.4.3

while ....................................................................................................................... 26

2.4.4

for ........................................................................................................................... 26

2.4.5

break ....................................................................................................................... 27

2.4.6

continue .................................................................................................................. 27

2.4.7

Else in a loop ............................................................................................................ 28

3

Motion-related Commands ..........................................................29

3.1

Pos Creation........................................................................................... 29

3.1.1

posj(J1=0, J2=0, J3=0, J4=0, J5=0, J6=0) ..................................................................... 29

3.1.2

posx(X=0, Y=0, Z=0, A=0, B=0, C=0) ............................................................................. 30-2-

Programming manual(V2.10)

3.1.3trans(pos, delta, ref, ref_out)..................................................................................... 31

3.1.4

posb(seg_type, posx1, posx2=None, radius=0) ............................................................ 34

3.1.5

fkin(pos, ref) ............................................................................................................ 36

3.1.6

ikin(pos, sol_space, ref, ref_pos_opt, iter_threshold) .................................................. 37

3.1.7

addto(pos, add_val=None) ........................................................................................ 40

3.2

Motion settings....................................................................................... 41

3.2.1

set_velj(vel) ............................................................................................................. 41

3.2.2

set_accj(acc) ............................................................................................................ 43

3.2.3

set_velx(vel1, vel2) ................................................................................................... 44

3.2.4

set_velx(vel) ............................................................................................................ 46

3.2.5

set_accx(acc1, acc2).................................................................................................. 47

3.2.6

set_accx(acc)............................................................................................................ 49

3.2.7

set_tcp(name) .......................................................................................................... 50

3.2.8

set_ref_coord(coord) ................................................................................................ 52

3.3

Synchronous Motion ............................................................................... 54

3.3.1

movej() .................................................................................................................... 54

3.3.2

movel() .................................................................................................................... 59

3.3.3

movejx() .................................................................................................................. 64

3.3.4

movec() ................................................................................................................... 68

3.3.5

movesj()................................................................................................................... 74

3.3.6

movesx() .................................................................................................................. 77

3.3.7

moveb() ................................................................................................................... 81

3.3.8

move_spiral() ........................................................................................................... 85

3.3.9

move_periodic() ....................................................................................................... 89

3.3.10

move_home() ........................................................................................................... 94

3.4

Asynchronous Motion.............................................................................. 95

3.4.1

amovej() .................................................................................................................. 95

3.4.2

amovel() .................................................................................................................. 98

3.4.3

amovejx()................................................................................................................101

3.4.4

amovec().................................................................................................................104

3.4.5

amovesj() ................................................................................................................108

3.4.6

amovesx() ...............................................................................................................111

3.4.7

amoveb() ................................................................................................................114

3.4.8

amove_spiral() ........................................................................................................118

3.4.9

amove_periodic() ....................................................................................................122-3-

Programming manual(V2.10)

3.5

Additional Functions ..............................................................................125

3.5.1

mwait(time=0).........................................................................................................125

3.5.2

begin_blend(radius=0) .............................................................................................127

3.5.3

end_blend().............................................................................................................129

3.5.4

check_motion() .......................................................................................................130

3.5.5stop(st_mode) .........................................................................................................131

3.5.6

change_operation_speed(speed) ..............................................................................133

3.5.7

wait_manual_guide() ...............................................................................................135

3.5.8

wait_nudge()...........................................................................................................137

3.5.9

enable_alter_motion(n,mode,ref,limit_dPOS,limit_dPOS_per) ...................................139

3.5.10alter_motion(pos)....................................................................................................141

3.5.11disable_alter_motion().............................................................................................143

3.5.12check_robot_mastering() .........................................................................................144

3.6

Servo Motion .........................................................................................145

3.6.1

servoj() ...................................................................................................................145

3.6.2

servol() ...................................................................................................................148

3.6.3

speedj()...................................................................................................................150

3.6.4

speedl()...................................................................................................................152

4

Auxiliary Control Commands ..................................................... 155

4.1

Robot Current Value...............................................................................155

4.1.1

get_current_posj() ...................................................................................................155

4.1.2

get_current_velj()....................................................................................................155

4.1.3

get_current_posx(ref) ..............................................................................................156

4.1.4

get_current_tool_flange_posx(ref) ...........................................................................158

4.1.5

get_current_velx(ref)...............................................................................................159

4.1.6

get_current_rotm(ref)..............................................................................................160

4.1.7

get_joint_torque() ...................................................................................................161

4.1.8

get_external_torque()..............................................................................................161

4.1.9

get_tool_force(ref) ..................................................................................................162

4.2

Robot Target Value ................................................................................163

4.2.1

get_desired_posj() ...................................................................................................163

4.2.2

get_desired_velj()....................................................................................................164

4.2.3

get_desired_posx(ref) ..............................................................................................165

4.2.4

get_desired_velx(ref)...............................................................................................166-4-

Programming manual(V2.10)

4.3

Control State Value ................................................................................167

4.3.1

get_control_mode() .................................................................................................167

4.3.2

get_control_space() .................................................................................................167

4.3.3

get_current_solution_space() ...................................................................................168

4.3.4

get_solution_space(pos) ..........................................................................................169

4.3.5

get_orientation_error(xd, xc, axis)............................................................................170

5

Other Settings Command .......................................................... 172

5.1

Tool/Workpiece Settings ........................................................................172

5.1.1

get_workpiece_weight() ..........................................................................................172

5.1.2

reset_workpiece_weight()........................................................................................173

5.1.3

set_workpiece_weight(weight=0.0, cog=[0.0,0.0,0.0], cog_ref=DR_CUR_TCP,
add_up=DR_REPLACE, start_time=None, transition_time=None).................................173

5.1.4

set_tool_shape(name) .............................................................................................176

5.1.5

set_tool(name, start_time, transition_time) ..............................................................177

5.2

Control Mode Settings............................................................................178

5.2.1

set_singularity_handling(mode) ...............................................................................178

5.2.2

set_singular_handling_force(mode)..........................................................................180

5.2.3

set_palletizing_mode(mode) ....................................................................................182

5.2.4

set_motion_end(mode) ............................................................................................183

6

Force/Stiffness Control and Other User-Friendly Features............ 186

6.1

Force/Compliance Control ......................................................................186

6.1.1

release_compliance_ctrl() ........................................................................................186

6.1.2

task_compliance_ctrl(stx, time)................................................................................187

6.1.3

set_stiffnessx(stx, time) ...........................................................................................188

6.1.4

set_desired_force(fd, dir, time, mod) ........................................................................190

6.1.5

release_force(time=0) ..............................................................................................193

6.1.6

get_force_control_state().........................................................................................194

6.1.7

set_damping_factor(damping_factor, time) ..............................................................196

6.1.8

set_force_factor(force_factor, time) .........................................................................198

6.2

User-friendly Functions..........................................................................200

6.2.1

parallel_axis(x1, x2, x3, axis, ref) ..............................................................................200

6.2.2

parallel_axis(vect, axis, ref)......................................................................................202

6.2.3

align_axis(x1, x2, x3, pos, axis, ref) ...........................................................................203-5-

Programming manual(V2.10)

6.2.4align_axis(vect, pos, axis, ref)...................................................................................205

6.2.5

is_done_bolt_tightening(m=0, timeout=0, axis=None)................................................207

6.2.6

calc_coord(x1, x2, x3, x4, ref, mod) ...........................................................................208

6.2.7

set_user_cart_coord(pos, ref)...................................................................................210

6.2.8

set_user_cart_coord(x1, x2, x3, pos, ref) ...................................................................211

6.2.9

set_user_cart_coord(u1, v1, pos, ref) ........................................................................213

6.2.10

overwrite_user_cart_coord(id, pos, ref, apply_mod) ..................................................215

6.2.11

get_user_cart_coord(id)...........................................................................................216

6.2.12check_position_condition(axis, min, max, ref, mod, pos) ............................................218

6.2.13check_force_condition(axis, min, max, ref)................................................................220

6.2.14check_orientation_condition(axis, min, max, ref, mod) ..............................................222

6.2.15check_orientation_condition(axis, min, max, ref, mod, pos) .......................................224

6.2.16

coord_transform(pose_in, ref_in, ref_out).................................................................227

7

System Commands ................................................................... 230

7.1

IO Related .............................................................................................230

7.1.1

set_digital_output(index, val =None) ........................................................................230

7.1.2

set_digital_outputs(bit_list) .....................................................................................231

7.1.3

set_digital_outputs(bit_start, bit_end, val) ...............................................................232

7.1.4

set_digital_output(index, val=None, time=None, val2=None)......................................234

7.1.5

get_digital_input(index) ..........................................................................................235

7.1.6

get_digital_inputs(bit_list).......................................................................................237

7.1.7

get_digital_inputs(bit_start, bit_end) .......................................................................238

7.1.8

wait_digital_input(index, val, timeout=None)............................................................239

7.1.9

set_tool_digital_output(index, val=None) .................................................................241

7.1.10

set_tool_digital_outputs(bit_list) .............................................................................242

7.1.11

set_tool_digital_outputs(bit_start, bit_end, val)........................................................243

7.1.12

set_tool_digital_output(index, val=None, time=None, val2=None) ..............................245

7.1.13

get_tool_digital_input(index) ...................................................................................247

7.1.14

get_tool_digital_inputs(bit_list) ...............................................................................248

7.1.15

get_tool_digital_inputs(bit_start, bit_end)................................................................249

7.1.16

wait_tool_digital_input(index, val, timeout=None) ....................................................250

7.1.17

set_mode_analog_output(ch, mod ) ..........................................................................252

7.1.18

set_mode_analog_input(ch, mod ) ............................................................................253

7.1.19set_analog_output(ch, val).......................................................................................254-6-

Programming manual(V2.10)

7.1.20

get_analog_input(ch)...............................................................................................256

7.1.21

set_output(port_type, index, val=None, time=None, val2=None).................................257

7.1.22

get_input(port_type, index) .....................................................................................259

7.1.23

wait_input(port_type, index, val, timeout=None, condition=None) .............................263

7.1.24

wait_analog_input(ch, condition, val, timeout=None) ................................................266

7.1.25

wait_tool_analog_input(ch, condition, val, timeout=None).........................................267

7.2

TP Interface...........................................................................................269

7.2.1

tp_popup(message, pm_type=DR_PM_MESSAGE, button_type=0) ...............................269

7.2.2

tp_log(message) ......................................................................................................270

7.2.3

tp_get_user_input(message, input_type) ..................................................................272

7.3

Thread ..................................................................................................273

7.3.1

thread_run(th_func_name, loop=False).....................................................................273

7.3.2

thread_stop(th_id) ..................................................................................................275

7.3.3

thread_pause(th_id) ................................................................................................276

7.3.4

thread_resume(th_id) ..............................................................................................277

7.3.5

thread_state(th_id) .................................................................................................278

7.3.6

Integrated example - Thread.....................................................................................279

7.4

Others...................................................................................................281

7.4.1

wait(time) ...............................................................................................................281

7.4.2

exit().......................................................................................................................282

7.4.3

sub_program_run(name) .........................................................................................282

7.4.4

drl_report_line(option) ............................................................................................284

7.4.5

set_fm(key, value) ...................................................................................................285

7.4.6

get_robot_model()...................................................................................................286

7.4.7

get_robot_serial_num() ...........................................................................................287

7.4.8

check_robot_jts() ....................................................................................................287

7.4.9

check_robot_fts() ....................................................................................................288

7.4.10start_timer() ...........................................................................................................288

7.4.11

end_timer() .............................................................................................................289

8Mathematical Function ............................................................. 291

8.1

Basic Function .......................................................................................291

8.1.1

ceil(x) .....................................................................................................................291

8.1.2

floor(x) ...................................................................................................................291

8.1.3

pow(x, y).................................................................................................................292-7-

Programming manual(V2.10)

8.1.4sqrt(x).....................................................................................................................293

8.1.5

log(x, b) ..................................................................................................................293

8.1.6

d2r(x) .....................................................................................................................294

8.1.7

r2d(x) .....................................................................................................................295

8.1.8

random().................................................................................................................295

8.2

Trigonometric functions.........................................................................296

8.2.1

sin(x) ......................................................................................................................296

8.2.2

cos(x)......................................................................................................................297

8.2.3

tan(x)......................................................................................................................297

8.2.4

asin(x) ....................................................................................................................298

8.2.5

acos(x) ....................................................................................................................299

8.2.6

atan(x)....................................................................................................................299

8.2.7

atan2(y, x)...............................................................................................................300

8.3

Linear algebra .......................................................................................301

8.3.1

norm(x)...................................................................................................................301

8.3.2

rotx(angle) ..............................................................................................................301

8.3.3

roty(angle) ..............................................................................................................302

8.3.4

rotz(angle) ..............................................................................................................303

8.3.5

rotm2eul(rotm) .......................................................................................................304

8.3.6

rotm2rotvec(rotm) ..................................................................................................305

8.3.7

eul2rotm([alpha,beta,gamma]) ................................................................................305

8.3.8

eul2rotvec([alpha,beta,gamma]) ..............................................................................306

8.3.9

eul2rpy([alpha,beta,gamma])...................................................................................307

8.3.10rpy2eul([roll,pitch,yaw]) ..........................................................................................308

8.3.11rotvec2eul([rx,ry,rz]) ...............................................................................................309

8.3.12

rotvec2rotm([rx,ry,rz]) ............................................................................................310

8.3.13htrans(posx1,posx2) ................................................................................................310

8.3.14

get_intermediate_pose(posx1,posx2,alpha) ..............................................................312

8.3.15

get_distance(posx1, posx2) ......................................................................................313

8.3.16

get_normal(x1, x2, x3) .............................................................................................314

8.3.17

add_pose(posx1,posx2)............................................................................................315

8.3.18subtract_pose(posx1,posx2).....................................................................................316

8.3.19inverse_pose(posx1) ................................................................................................317

8.3.20

dot_pose(posx1, posx2) ...........................................................................................318

8.3.21cross_pose(posx1, posx2).........................................................................................319-8-

Programming manual(V2.10)

8.3.22

unit_pose(posx1) .....................................................................................................320

9

External Communication Commands.......................................... 322

9.1

Serial ....................................................................................................322

9.1.1

serial_open(port=None, baudrate=115200, bytesize=DR_EIGHTBITS,
parity=DR_PARITY_NONE, stopbits=DR_STOPBITS_ONE) ............................................322

9.1.2

serial_close(ser) ......................................................................................................323

9.1.3

serial_state(ser) ......................................................................................................324

9.1.4

serial_set_inter_byte_timeout(ser, timeout=None) ....................................................325

9.1.5

serial_write(ser, tx_data) .........................................................................................326

9.1.6

serial_read(ser, length=-1, timeout=-1) .....................................................................327

9.1.7

serial_get_count() ...................................................................................................329

9.1.8

serial_get_info(id) ...................................................................................................330

9.1.9

Combined Example - Serial .......................................................................................331

9.2

Tcp/Client .............................................................................................333

9.2.1

client_socket_open(ip, port).....................................................................................333

9.2.2

client_socket_close(sock).........................................................................................334

9.2.3

client_socket_state(sock).........................................................................................335

9.2.4

client_socket_write(sock, tx_data) ...........................................................................336

9.2.5

client_socket_read(sock, length=-1, timeout=-1) .......................................................337

9.2.6

Integrated example (Tcp/Client) ...............................................................................339

9.3

Tcp/Server ............................................................................................341

9.3.1

server_socket_open(port) ........................................................................................341

9.3.2

server_socket_close(sock)........................................................................................342

9.3.3

server_socket_state(sock)........................................................................................343

9.3.4

server_socket_write(sock, tx_data) ..........................................................................345

9.3.5

server_socket_read(sock, length=-1, timeout=-1) ......................................................346

9.3.6

Integrated example - Tcp/Server ...............................................................................347

9.4

Modbus .................................................................................................350

9.4.1

add_modbus_signal(ip, port, name, reg_type, index, value=0, slaveid=255).................350

9.4.2

add_modbus_rtu_signal(slaveid=1, port=None, baudrate=115200, bytesize=DR_EIGHTBITS,
parity=DR_PARITY_NONE, stopbits=DR_STOPBITS_ONE, name, reg_type, index,
value=0)..................................................................................................................352

9.4.3

add_modbus_signal_multi(ip, port, slaveid=255, name=None,
reg_type=DR_HOLDING_REGISTER, start_address=0, cnt=1) .......................................354-9-

Programming manual(V2.10)

9.4.4

add_modbus_rtu_signal_multi(slaveid=1, port=None, baudrate=115200,
bytesize=DR_EIGHTBITS, parity=DR_PARITY_NONE, stopbits=DR_STOPBITS_ONE,
name=None, reg_type=DR_HOLDING_REGISTER, start_address=0, cnt=1) ....................356

9.4.5

del_modbus_signal(name) .......................................................................................358

9.4.6

del_modbus_signal_multi(name)..............................................................................359

9.4.7

set_modbus_output(iobus, value).............................................................................361

9.4.8

set_modbus_outputs(iobus_list, val_list) ..................................................................362

9.4.9

set_modbus_output_multi(iobus, val_list) ................................................................363

9.4.10get_modbus_input(iobus) ........................................................................................365

9.4.11

get_modbus_inputs(iobus_list) ................................................................................366

9.4.12

get_modbus_inputs_list(iobus_list) ..........................................................................368

9.4.13

get_modbus_input_multi (iobus) ..............................................................................369

9.4.14

wait_modbus_input(iobus, val, timeout=None) .........................................................370

9.4.15

set_modbus_slave(address, val) ...............................................................................372

9.4.16get_modbus_slave(address) .....................................................................................373

9.4.17

modbus_crc16(data) ................................................................................................374

9.4.18modbus_send_make(send_data) ..............................................................................375

9.4.19modbus_recv_check(recv_data) ...............................................................................376

9.4.20

modbus_unsigned_to_signed(unsigned_data) ...........................................................377

9.5

Industrial Ethernet (EtherNet/IP,PROFINET) ............................................378

9.5.1

set_output_register_bit(address, val) .......................................................................378

9.5.2

set_output_register_int(address, val) .......................................................................379

9.5.3

set_output_register_float(address, val) ....................................................................381

9.5.4

get_output_register_bit(address) .............................................................................382

9.5.5

get_output_register_int(address) .............................................................................383

9.5.6

get_output_register_float(address) ..........................................................................384

9.5.7

get_input_register_bit(address) ...............................................................................385

9.5.8

get_input_register_int(address) ...............................................................................386

9.5.9

get_input_register_float(address) ............................................................................387

9.6

FOCAS...................................................................................................389

9.6.1

focas_connect(ip, port, timeout)...............................................................................389

9.6.2

focas_disconnect(handle).........................................................................................390

9.6.3

focas_pmc_read_bit(handle, addr_type, start_num, bit_offset) ..................................391

9.6.4

focas_pmc_read_char(handle, addr_type, start_num, read_count) .............................393

9.6.5

focas_pmc_read_word(handle, addr_type, start_num, read_count) ............................395

9.6.6

focas_pmc_read_long(handle, addr_type, start_num, read_count) .............................397- 10 -

Programming manual(V2.10)

9.6.7

focas_pmc_read_float(handle, addr_type, start_num, read_count).............................399

9.6.8

focas_pmc_read_double(handle, addr_type, start_num, read_count) .........................401

9.6.9

focas_pmc_write_bit(handle, addr_type, start_num, bit_offset, write_data) ...............403

9.6.10focas_pmc_write_char(handle, addr_type, start_num, write_data, write_count) .........405

9.6.11

focas_pmc_write_word(handle, addr_type, start_num, write_data, write_count) ........407

9.6.12

focas_pmc_write_long(handle, addr_type, start_num, write_data, write_count) .........409

9.6.13

focas_pmc_write_float(handle, addr_type, start_num, write_data, write_count).........411

9.6.14

focas_pmc_write_double(handle, addr_type, start_num, write_data, write_count) .....413

9.6.15

focas_get_error_str(handle, errorCode) ....................................................................415

10External Vision Commands ........................................................ 420

10.1

Overview ..............................................................................................420

10.2

2D Vision - COGNEX / SICK / VISOR............................................................420

10.2.1

vs_set_info(type).....................................................................................................421

10.2.2

vs_connect(ip_addr, port_num=9999) .......................................................................422

10.2.3vs_disconnect() .......................................................................................................423

10.2.4

vs_get_job() ............................................................................................................423

10.2.5vs_set_job(job_name) ..............................................................................................424

10.2.6

cognex_set_integer (job_name, integer_number) ......................................................424

10.2.7

visor_job_change(index) ..........................................................................................425

10.2.8vs_trigger() .............................................................................................................426

10.2.9vs_set_init_pos(vision_posx_init, robot_posx_init, vs_pos=1).....................................427

10.2.10

vs_get_offset_pos(vision_posx _meas, vs_pos=1) ......................................................428

10.2.11Integrated example - DR_VS_COGNEX, DR_VS_SICK ....................................................430

10.2.12vs_request(cmd)......................................................................................................430

10.2.13vs_result()...............................................................................................................431

10.2.14Integrated example - DR_VS_CUSTOM .......................................................................432

10.3

Pickit 3D ...............................................................................................434

10.3.1

pickit_connect(ip)....................................................................................................435

10.3.2

pickit_disconnect() ..................................................................................................435

10.3.3

pickit_change_configuration(setup_id, product_id)) ..................................................436

10.3.4

pickit_request_calibration() .....................................................................................437

10.3.5

pickit_detection(offset_z) ........................................................................................437

10.3.6

pickit_next_object(offset_z).....................................................................................439

10.3.7

pickit_save_snapshot() ............................................................................................441- 11 -

Programming manual(V2.10)

10.3.8

Integrated example - Pickit 3D ..................................................................................442

11

Doosan Vision(SVM) Command................................................... 444

11.1

Camera Connection................................................................................445

11.1.1

svm_connect(ip=”192.168.137.5”, port=20)...............................................................445

11.1.2

svm_disconnect() ....................................................................................................446

11.2

Check Image Quality ..............................................................................446

11.2.1

svm_set_led_brightness(value) ................................................................................446

11.2.2

svm_get_led_brightness() ........................................................................................447

11.2.3svm_set_camera_exp_val(value) ..............................................................................447

11.2.4svm_set_camera_gain_val(value) .............................................................................448

11.2.5svm_set_camera_load(job_id) ..................................................................................449

11.3

Vision Job Manage .................................................................................449

11.3.1

svm_set_job(job_id) ................................................................................................449

11.4

Camera Calibration ................................................................................450

11.4.1

svm_get_robot_pose(job_id) ....................................................................................450

11.5

Object Recognition/Detection .................................................................451

11.5.1

svm_get_vision_info(job_id).....................................................................................451

11.5.2

svm_get_variable(tool_id, var_type).........................................................................452

11.5.3svm_detect_landmark(job_id) ..................................................................................453

11.5.4

svm_get_marker_offset_pose(cpos, offset, euler_mode) ............................................454

11.5.5svm_get_detect_barcode() .......................................................................................455

11.5.6svm_get_barcode_db_data(index) ............................................................................456

11.5.7svm_compare_barcode_db_data(dbdata) .................................................................457

11.6

Robot Task ............................................................................................457

11.6.1

svm_set_init_pos_data(Id_list, Pos_list)....................................................................457

11.6.2

svm_get_offset_pos(posx_robot_init, job_id, tool_id) ................................................459

11.7

Other SVM commands ............................................................................460

11.7.1

svm_set_tp_popup (svm_flag) ..................................................................................460

11.8

Integrated example (SVM) ......................................................................460

11.8.1

Example..................................................................................................................460

12

Application Commands ............................................................. 462

12.1

External Encoder Setting Commands.......................................................462- 12 -

Programming manual(V2.10)

12.1.1

set_extenc_polarity(channel, polarity_A, polarity_B, polarity_Z, polarity_S) ...............462

12.1.2

set_extenc_mode(channel, mode_AB, pulse_AZ, mode_Z, mode_S, inverse_cnt) ..........463

12.1.3

get_extenc_count(channel) ......................................................................................465

12.1.4clear_extenc_count(channel) ...................................................................................466

12.2

Conveyor Tracking.................................................................................467

12.2.1

set_conveyor(name) ................................................................................................467

12.2.2

set_conveyor_ex(name=””, conv_type=0, encoder_channel=1, triggering_mute_time=0.0,
count_per_dist=5000, conv_coord=posx(0,0,0,0,0,0), ref=DR_BASE, conv_speed=100.0,
speed_filter_size=500, min_dist=0.0, max_dist=1000.0, watch_window=100.0...).........468

12.2.3

get_conveyor_obj(conv_id, timeout=None, container_type=DR_FIFO,
obj_offset_coord=None)...........................................................................................472

12.2.4

tracking_conveyor(conv_id, time=0.3) ......................................................................476

12.2.5

untracking_conveyor(conv_id, time=0.3) ..................................................................478

12.3

Welding.................................................................................................480

12.3.1

app_weld_enable_digital() .......................................................................................480

12.3.2

app_weld_disable_digital() ......................................................................................482

12.3.3

app_weld_set_interface_eip_r2m_process(welding_start=[0,0,0,0,0,0,0,0,0],
robot_ready=[0,0,0,0,0,0,0,0,0], error_reset=[0,0,0,0,0,0,0,0,0]).................................484

12.3.4

app_weld_set_interface_eip_r2m_mode(welding_mode=[0,0,0,0,0,0,0,0,0],s_2t=[0,0,0,0,0,0,0,0,0], pulse_mode=[0,0,0,0,0,0,0,0,0],wm_opt1=[0,0,0,0,0,0,0,0,0]) .488

12.3.5app_weld_set_interface_eip_r2m_test(gas_test=[0,0,0,0,0,0,0,0,0],inching_plus=[0,0,0,0,0,0,0,0,0], inching_minus=[0,0,0,0,0,0,0,0,0],
blow_out_torch=[0,0,0,0,0,0,0,0,0], simulation=[0,0,0,0,0,0,0,0,0],ts_opt1=[0,0,0,0,0,0,0,0,0], ...)..................................................................................492

12.3.6app_weld_set_interface_eip_r2m_condition(job_num=[0,0,0,0,0,0,0,0,0],
synergic_id=[0,0,0,0,0,0,0,0,0], r_wire_feed_speed=[0,0,0,0,0,0,0,0,0],
voltage_corret=[0,0,0,0,0,0,0,0.0,0.0], dynamic_correct=[0,0,0,0,0,0,0,0,0])................495

12.3.7

app_weld_set_interface_eip_r2m_option(opt1=[0,0,0,0,0,0,0,0,0], opt2=[0,0,0,0,0,0,0,0,0],
opt3=[0,0,0,0,0,0,0,0,0], opt4=[0,0,0,0,0,0,0,0,0], opt5=[0,0,0,0,0,0,0,0,0],
opt6=[0,0,0,0,0,0,0,0,0],...).......................................................................................498

12.3.8app_weld_set_interface_eip_m2r_process(current_flow=[0,0,0,0,0,0,0,0,0],
process_active=[0,0,0,0,0,0,0,0,0], main_current=[0,0,0,0,0,0,0,0,0],
machine_ready=[0,0,0,0,0,0,0,0,0], comm_ready=[0,0,0,0,0,0,0,0,0]) ..........................502

12.3.9app_weld_set_interface_eip_m2r_monitoring(welding_voltage=[0,0,0,0,0,0,0,0,0],
welding_current=[0,0,0,0,0,0,0,0,0], wire_feed_speed=[0,0,0,0,0,0,0,0,0],
wire_stick=[0,0,0,0,0,0,0,0,0], error=[0,0,0,0,0,0,0,0,0], ...) ........................................506

12.3.10

app_weld_set_interface_eip_m2r_other(opt1=[0,0,0,0,0,0,0,0,0], opt2=[0,0,0,0,0,0,0,0,0],
opt3=[0,0,0,0,0,0,0,0,0], opt4=[0,0,0,0,0,0,0,0,0], opt5=[0,0,0,0,0,0,0,0,0],
opt6=[0,0,0,0,0,0,0,0,0], opt7=[0,0,0,0,0,0,0,0,0],...) ..................................................509

12.3.11

app_weld_set_weld_cond_digital(flag_dry_run=0, vel_target=0, vel_min=0, vel_max=0,
welding_mode=0, s_2t=0, pulse_mode=0, wm_opt1=0, simulation=0, ts_opt1=0,
ts_opt2=0,...)...........................................................................................................513- 13 -

Programming manual(V2.10)

12.3.12

app_weld_adj_welding_cond_digital(flag_reset=None, f_target=None, vel_target=None,
wv_offset=None, wv_width_ratio=None, dynamic_cor=None, voltage_cor=None,
job_number=None, synergic_id=None) ......................................................................518

12.3.13app_weld_get_welding_cond_digital()......................................................................522

12.3.14app_weld_enable_analog(ch_v_out=[1,0], spec_v_out=[0,0,0,0], ch_f_out=[2,0],
spec_f_out=[0,0,0,0], ch_v_in=[1,0], spec_v_in=[0,0,0,0], ch_c_in=[2,0],
spec_c_in=[0,0,0,0],ch_arc_on=1,ch_gas_on=2,ch_inching_fwd=3,ch_inching_bwd=4, ...) .52
7

12.3.15

app_weld_disable_analog()......................................................................................532

12.3.16

app_weld_set_weld_cond_analog(flag_dry_run=0, v_target=0, f_target=0, vel_target=0,
vel_min=0, vel_max=0, weld_proc_param=[0.2,0.2,0.5,0.5,0.5,0.2,0.2,0.5,0.5]) ...........534

12.3.17

app_weld_adj_welding_cond_analog(flag_reset=0, v_target=None, f_target=None,
vel_target=None, wv_offset=None, wv_width_ratio=None) ........................................538

12.3.18

app_weld_get_welding_cond_analog() .....................................................................541

12.3.19

app_weld_weave_cond_trapezoidal(wv_offset=[0,0], wv_ang=0,
wv_param=[0,1.5,0,-1.5,0.3,0.1,0.3,0.3,0.1,0.3]) ........................................................544

12.3.20

app_weld_weave_cond_zigzag(wv_offset=[0,0], wv_ang=0, wv_param=[3,0.6]) ..........547

12.3.21

app_weld_weave_cond_circular(wv_offset=[0,0], wv_ang=0, wv_param=[3,3,0.3,0.3]) .549

12.3.22app_weld_weave_cond_sinusoidal(wv_offset=[0,0], wv_ang=0, wv_param=[3,0.6]).....551

13

A-Series Command.................................................................... 555

13.1

Controller .............................................................................................555

13.1.1

get_function_input(index)........................................................................................555

13.2

Flange I/O..............................................................................................556

13.2.1flange_serial_open(baudrate=115200, bytesize=DR_EIGHTBITS, parity=DR_PARITY_NONE,
stopbits = DR_STOPBITS_ONE)..................................................................................556

13.2.2flange_serial_close() ................................................................................................557

13.2.3flange_serial_write(tx_data) ....................................................................................558

13.2.4flange_serial_read(timeout=None) ...........................................................................559

13.2.5Integrated example - A-Series Command ...................................................................560- 14 -

Programming manual(V2.10)

Preface

1 PrefaceThis manual is composed of thirteen chapters. Chapter 2 through 12 describe DRL commands common to Mseries robot, H-series robot and A-series robot, chapter 13 describes DRL commands that apply only to A-series
robot.
The contents of this manual are current as of the date this manual was written, and product-related information
may be modified without prior notification to the user.
For more information on the revised manual, please visit our Robot LAB website. (https://
robotlab.doosanrobotics.com/)

1.1 CopyrightThe copyright and intellectual property rights of the contents of this manual are held by Doosan Robotics. It istherefore prohibited to use, copy, or distribute the contents without written approval from Doosan Robotics. In
the event of abuse or modification of the patent right, the user will be fully accountable for the consequences.
While the information in this manual is reliable, Doosan Robotics will not be held accountable for any damage
that occurs due to errors or typos. The contents of this manual may be modified according to productimprovement without prior notification.
© 2022 Doosan Robotics Inc., All rights reserved- 15 -

Programming manual(V2.10)

DRL Basic Syntex

2 DRL Basic Syntex
2.1 Basic Syntax
CautionThe syntax of DRL is the same as the syntax of Python which means that DRL does not include all thesyntax and features of Python.
DRL only supports the information described in this manual.

2.1.1 Indent
FeaturesThis function is used to separate each code block. An error occurs if the indentation is not complied.
• Indentation is used to separate each code block.
• For Indentation, 2 spaces, 4 space or tab character can be used.
• For a block, same type of indentation should be used

Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

Code block 1[TAB] Code block 2
Example)if x == 3:
y += 1# No Error
def fnSum(x,y):[space4]sum = x + y[space4]return sum# No Error
def fnSubtract(x,y):[TAB]diff = x - y[TAB]return diff

# Indentation error
def fnProduct(x,y):[space4]product = x * y[TAB]return product- 16 -

Programming manual(V2.10)

DRL Basic Syntex

2.1.2 Comment
FeaturesThis function is used to provide an additional description of the code. The comments do not affect the sourcecode since they are excluded from code processing.
A statement following "#" is recognized as a comment. A block that begins with ’’’ and ends with ’’’ isrecognized as a comment.
• Comment is used to provide an additional description of the code. The comments do not affect the sourcecode since they are excluded from code processing• A statement following "#" is recognized as a comment.
• A block that begins with ’’’ and ends with ’’’ is recognized as a comment

Example1
2
3# Comment example 1’’’
Comment example 2

2.2 Variable
2.2.1 Variable nameFeatures• Variable is used to express the data value and can consist of letters, numbers, and underscores (_). The
first character cannot be a number.
• Letters are case sensitive.
• An error occurs if the variable name is the same as a reserved word or interpreter internal function name.
To avoid this, use the function name as using the prefix "var _", if possible.

Caution
Never use the following reserved words as variable names or function names.
and

assert

break

class

continue

def

del

elif

else

exceptexec

finallyforfromglobal- 17 -

Programming manual(V2.10)

DRL Basic Syntex

ifimportinislambda

list

not

open

or

pass

print

raise

return

try

while

with

yield

selectExample
1
2
3
4
5
6

friend = 10
Friend = 1_myFriend = None
Pass = 10 # Syntax error
movej = 0 # movej is a DRL instruction name and should not be used as avariable.

2.2.2 Numeric value
Features
DRL provides numeric types such as int, float, complex number and so on.

Example
1
2
3
4
5
6
7
8
9
10
11

10, 0x10, 0o10, 0b10
3.14, 314e-2
x = 3-4j
int_value = 10
hexa_value = 0x10
octa_value = 0o10
binary_value = 0b10
double_value = 3.14
double value = 314e-2
complex_value = 3-4j

- 18 -

Programming manual(V2.10)

DRL Basic Syntex

2.2.3 String
StringFeaturesAll character strings are in Unicode.
• Escape characters\n: New line
\t: Tab\r: Carrage return\0: Null string\\: back slash(\) in string\’: single quote mark in string\": double quote mark in string• String concatenation: "py"+ "tyon" → "python"• String repeatition: "py"* 3 → "pypypy"• String indexing: "python" [0] → "p"• String slicing: "python" [1:4] → "yth"
Example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

"string1"'string2'
tp_log("st"+"ring")#expected result: string
tp_log("str"* 3)#expected result: strstrstr
tp_log("line1\nline2")#expected result: line1# line2tp_log("\"string\"")#expected result: "string"
tp_log("str"[0])#expected result: s
tp_log("string"[1:3])#expected result: tr- 19 -

Programming manual(V2.10)

DRL Basic Syntex+, *Example1
2"Doosan"+ "Robotics" → "DoosanRobotics""Doo"* 3 → "DooDooDoo"

Indexing & slicing
Example1
2" Doosan" [0] → "D"" Doosan" [1:4] → "oos"2.2.4 list
Features• The items in a list can be changed and ordered.
• A list can be indexed and sliced.
• append, insert, extend, and + operators• count, remove, and sort operators

Example
1
2
3
4
5
6
7
8
9
10

colors = ["red", "green", "blue"]
tp_log(colors[0]+","+colors[1]+","+colors[2])#expected print result: red,green,blue
numbers = [1, 3, 5, 7, 9]
sum = 0for number in numbers:sum += number
tp_log( str(sum) )#expected result: 25

2.2.5 tuple
Features
Tupule is similar to a list but is faster at processing since it is read-only.

- 20 -

Programming manual(V2.10)

DRL Basic Syntex

Example
1
2
3
4
5
6
7
8
9
10
11

colors = ("red", "green", "blue")numbers = (1, 3, 5, 7, 9)
def fnMinMax(numbers):
numbers.sort()
return (numbers[0], numbers[-1])minmax = fnMinMax([4,1,2,9,5,7])tp_log("Min Value= " + str(minmax[0]))#expected result: Min Value = 1
tp_log("Max Value= "+ str(minmax[1]))#expected result: Max Value = 9

2.2.6 dictionary
FeaturesDictionary specifies the keys and values and lists the values.

Example
1
2
3
4
5
6
7
8

d = dict(a = 1, b = 3, c = 5)colors = dict()colors["cherry"] = "red"ages = {'Kim':35, 'Lee':38, 'Chang':37}
tp_log("Ages of Kim = " + str(ages['Kim']))#expected print result: Ages of Kim = 35

2.3 Function
2.3.1 Function Syntax
Features• Declaration: A function begins with def and ends with colon (:).
• The beginning and ending of a function is specified by an indentation of the code.
• The interface and implementation are not separated. However, they must have been defined before they
are used.
• An error occurs if the function name is the same as a reserved word or interpreter internal function name.

- 21 -

Programming manual(V2.10)

DRL Basic Syntex

To avoid this, use the function name as using the prefix "fn_", if possible.

Caution
Never use the following reserved words as variable names or function names.
and

assert

break

class

continue

def

del

elif

else

exceptexec

finallyforfromglobalif

importinislambda

list

not

open

or

pass

print

raise

return

try

while

with

yield

selectsentence
def <function name> (parameter 1, parameter 2, … parameter N):<syntax> …
return <return value>

Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

# Example
def fn_Times(a, b):
return a * b
fn_Times (10, 10)
def fn_Times(a, b):
return a * b
tp_log(str(fn_Times(10, 5)))#expected result: 50
def movej():return 0# movej should not be used as a function name asinterpreter# internal function name- 22 -

Programming manual(V2.10)

DRL Basic Syntex

2.3.2 Scoping rule
Features• If there is no value corresponding to the local variable name in a function, the name can be found based on
the LGB rule.
• Namespace: An area that contains the variable name• Local scope: A namespace and local domain inside a function• Global scope: Global domain outside a function• Built-in scope: The domain related to the contents defined by Python and an internal domain• LGB rule: The order of finding a variable name. local → global → built-in

Example
1
2
3
4
5
6
7
8
9
10
11
12

# Error: can't find simple_pi in circle_area
simple_pi = 3.14
def circle_area(r):return r*r*simple_pi# simple_pi should be declared as global if it is used in circle_area_ok
def circle_area_ok(r):global simple_pi
return r*r*simple_pi
tp_log(str(circle_area(3.0)))#expected result: 28.26

2.3.3 Parameter mode
Features
DRL provides 3 types of parameter modes: Default parameter values, Keyword parameters and Arbitaryparameters

Example
1
2
3
4
5
6
7
8

def fn_Times(a = 10, b = 20):
return a * b#Example - Default parameter value
tp_log(str(fn_Times(5)))#expected result: 100#Example - Keyword parameter- 23 -

Programming manual(V2.10)

DRL Basic Syntex

9
10
11
12
13
14
15
16
17
18
19
20

tp_log(str(fn_Times(b=5)))#expected result: 50
tp_log(str(fn_Times(a=5, b=5)))#expected result: 25#Example - arbitary parameterdef fn_myUnion(*args):
for arg in args:
tp_log(str(arg))
fn_myUnion("red", 1)#expected print result: red#
1

Example - Default parameter value
12
3
4

def fn_Times(a = 10, b = 20)
return a * b
fn_Times(5)Example - Keyword parameter
1
2
3
4

def fn_Times(a = 10, b = 20)
return a * b
fn_Times(a=5, b=5)

Example - Variable parameter
1
2
3
4

def fn_myUnion(*ar)…….
fn_myUnion("red", "white", "black")

2.4 Control Statement
2.4.1 pass
Features
The ‘pass’ is used when an operation is not executed.

- 24 -

Programming manual(V2.10)

DRL Basic Syntex

Example12
3

while True:
pass #pass means empty statement, so while statement continues to run.
tp_log("This line never reached")

2.4.2 if
Features‘if’ is a conditional statement. It can use "elif" and "else" according to whether the condition of the "if" syntax istrue or false.

sentense
if <conditional statement>:<syntax>

if <conditional statement 1>:<Syntax 1>
elif <conditional statement 2>:<Syntax 2>
else:<Syntax 3>

Example - if, elif, else
1
2
3
4
5
6
7
8
9
10

numbers = [2,5,7]
for number in numbers:
if number%2==0:
tp_log(str(number) + " is even")else:
tp_log (str(number) + " is odd")#expected result:#2 is even#5 is odd
#7 is odd

- 25 -

Programming manual(V2.10)

DRL Basic Syntex

2.4.3 while
Features‘while’ is a conditional statement that repeats an operation according to whether the condition is true or false.

syntaxwhile <conditional statement>:<syntax>

Example
1
2
3
4
5
6
7
8

sum = 0cnt = 1
while cnt < 10:
sum = sum+cnt
cnt = cnt+1
tp_log("sum = " + str(sum))#expected result:#sum = 45

2.4.4 forFeatures'for' repeats an operation within the specified repeating range.

syntaxfor <item> in <sequential object S>:<syntax>

Example
1
2
3
4
5
6
7
8

x=0
for i in range(0, 3): # i is 0 -> 1 -> 2
x= x + 1
sum = 0for i in range(0, 10):sum = sum + i
tp_log("sum = " + str(sum))- 26 -

Programming manual(V2.10)

DRL Basic Syntex

910#expected result:#sum = 45

2.4.5 breakFeatures'break' is used to exit the internal block of a loop.

Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

x =0
while True:x = x + 1
if x > 10:
break
sum = 0;cnt = 0
while True:
if cnt > 9:
breaksum = sum + cnt
cnt = cnt+1
tp_log("sum = " + str(sum))#expected print result:#sum = 45

2.4.6 continue
Features
If 'continue' is used in a loop block, the loop stops further executing and returns to the beginning point of theloop.

Example
1
2
3
4
5
6
7
8
9

#<ex> 1x=0
y=0
while True:x = x + 1
if x > 10:continuey += 100- 27 -

Programming manual(V2.10)

DRL Basic Syntex

10
11
12
13
14
15
16
17

#<ex> 2sum = 0for i in range(0, 10):
if i%2==0:
continue
sum = sum + i
tp_log("sum of odd numbers = " + str(sum))#sum of odd numbers = 25

2.4.7 Else in a loop
Features
The "else" block is executed when the loop is executed until the end without being terminated by the "break"function in the middle of executing a loop.

Example
1
2
3
4
5
6
7

L = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }for i in L:
if i % 2 == 0:
continueelse:
tp_log("exit without break")- 28 -

Programming manual(V2.10)

Motion-related Commands

3 Motion-related Commands
3.1 Pos Creation
3.1.1 posj(J1=0, J2=0, J3=0, J4=0, J5=0, J6=0)
FeaturesThis function designates the joint space angle in coordinate values.

Parameters
No.

Data TypeDefault
Value

Description

J1

float

0

1-axis angle orlist

angle list or

posj

posj

J2

float

0

2-axis angle

J3

float

0

3-axis angle

J4

float

0

4-axis angle

J5

float

0

5-axis angle

J6

float

0

6-axis angle

ReturnPosj

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred- 29 -

Programming manual(V2.10)

Motion-related Commands

Example12
345

q1 = posj()# q1=posj(0,0,0,0,0,0)q2 = posj(0, 0, 90, 0, 90, 0)
q3 = posj([0, 30, 60, 0, 90, 0])# q3=posj(0,30,60,0,90,0)Related commands• movej()(p. 54)• amovej()(p. 95)• movesj()(p. 74)• amovesj()(p. 108)3.1.2 posx(X=0, Y=0, Z=0, A=0, B=0, C=0)
FeaturesThis function designates the joint space angle in coordinate values.

Parameters
No.

Data TypeDefault
Value

Description

X

float

0

X position orlist

position list or

posx

posx

Y

float

0

Y position

Z

float

0

Z position

A

float

0

A orientation(z-direction rotation of reference
coordinate system)

B

float

0

B orientation(y-direction rotation of A rotatedcoordinate system)

C

float

0

C orientation(z-direction rotation of A and B rotatedcoordinate system)- 30 -

Programming manual(V2.10)

Motion-related Commands

ReturnPosx

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

Example
1
2
3
4
5
6
7
8
9

movej([0,0,90,0,90,0], v=10, a=20)
x2 = posx(400, 300, 500, 0, 180, 0)x3 = posx([350, 350, 450, 0, 180, 0])180, 0)#x3=posx(350, 350, 450, 0,x4 = posx(x2)180, 0)#x4=posx(400, 300, 500, 0,

movel(x2, v=100, a=200)

Related commands• movel()(p. 59)• movec()(p. 68)• movejx()(p. 64)• amovel()(p. 98)• movec()(p. 68)• movejx()(p. 64)

3.1.3 trans(pos, delta, ref, ref_out)
Features• pos (pose) defined based on the ref coordinate is moved/rotated by the amount equal to delta, and then avalue converted based on the ref_out coordinate is returned.
• In case that the ref coordinate is the tool coordinate, this function retuns the value based on input
parameter(pos)’s coordinate without ref_out coordinate.

- 31 -

Programming manual(V2.10)

Motion-related Commands

Parameters
Parameter NameData TypeDefault
Value

Description

pos

posx

-

posx orposition list

list (float[6])
delta

posx

-

posx orposition list

list (float[6])
ref

int

None

reference coordinate• DR_BASE : base coordinate• DR_WORLD : world coordinate• DR_TOOL : tool coordinate• user coordinate: user defined

ref_out

int

DR_BASEreference coordinate• DR_BASE : base coordinate• DR_WORLD : world coordinate• user coordinate: user defined

ReturnValue

Description

posx list (float[6])task space point

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid- 32 -

Programming manual(V2.10)

Motion-related Commands

Exception

Description

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

p0 = posj(0,0,90,0,90,0)
movej(p0, v=30, a=30)

x1 = posx(200, 200, 200, 0, 180, 0)delta = [100, 100, 100, 0, 0, 0]x2 = trans(x1, delta, DR_BASE, DR_BASE)

x1_base = posx(500, 45, 700, 0, 180, 0)x4 = trans(x1_base, [10, 0, 0, 0, 0, 0], DR_TOOL)
movel(x4, v=100, a=100, ref=DR_BASE)

uu1 = [1, 1, 0]
vv1 = [-1, 1, 0]
pos = posx(559, 34.5, 651.5, 0, 180.0, 0)
DR_userTC1 = set_user_cart_coord(uu1, vv1, pos)system#user defined coordinate

x1_userTC1 = posx(30, 20, 100, 0, 180, 0)
system#posx on user coordinate

x9 = trans(x1_userTC1, [0, 0, 50, 0, 0, 0], DR_userTC1, DR_BASE)
movel(x9, v=100, a=100, ref=DR_BASE)- 33 -

Programming manual(V2.10)

Motion-related Commands

Related commands• posx(X=0, Y=0, Z=0, A=0, B=0, C=0)(p. 30)• addto(pos, add_val=None)(p. 40)

3.1.4 posb(seg_type, posx1, posx2=None, radius=0)
Features• Input parameters for constant-velocity blending motion (moveb and amoveb) with the Posb coordinatesof each waypoint and the data of the unit path type (line or arc) define the unit segment object of the
trajectory to be blended.
• Only posx1 is inputted if seg_type is a line (DR_LINE), and posx2 is also inputted if seg_type is a circle(DR_CIRCLE). Radius sets the blending radius with the continued segment.

Parameters
Parameter Name

Data TypeDefault
Value

Description

seg_type

Int-

DR_LINE
DR_CIRCLE

posx1

posx

-

1st task posx

posx2

posx

-

2nd task posx

radiusfloat

0Blending radius [mm]ReturnPosb

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred- 34 -

Programming manual(V2.10)

Motion-related Commands

Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48

q0 = posj(0, 0, 90, 0, 90, 0)
movej(q0,vel=30,acc=60)
x0 = posx(564, 34, 690, 0, 180, 0)
movel(x0, vel=200, acc=400)# Moves to the start position.

x1 = posx(564, 200, 690, 0, 180, 0)
seg1 = posb(DR_LINE, x1, radius=40)x2 = posx(564, 100, 590, 0, 180, 0)x2c = posx(564, 200, 490, 0, 180, 0)
seg2 = posb(DR_CIRCLE, x2, x2c, radius=40)
x3 = posx(564, 300, 490, 0, 180, 0)
seg3 = posb(DR_LINE, x3, radius=40)
x4 = posx(564, 400, 590, 0, 180, 0)x4c = posx(564, 300, 690, 0, 180, 0)
seg4 = posb(DR_CIRCLE, x4, x4c, radius=40)
x5 = posx(664, 300, 690, 0, 180, 0)
seg5 = posb(DR_LINE, x5, radius=40)
x6 = posx(564, 400, 690, 0, 180, 0)
x6c = posx(664, 500, 690, 0, 180, 0)
seg6 = posb(DR_CIRCLE, x6, x6c, radius=40)
x7 = posx(664, 400, 690, 0, 180, 0)
seg7 = posb(DR_LINE, x7, radius=40)
x8 = posx(664, 400, 590, 0, 180, 0)
x8c = posx(564, 400, 490, 0, 180, 0)- 35 -

Programming manual(V2.10)

Motion-related Commands

49
50
51
52
53
54
55
56
57
58

seg8 = posb(DR_CIRCLE, x8, x8c, radius=0)
be 0.
# If not 0, it is processed as 0.

# The last radius mustb_list = [seg1, seg2, seg3, seg4, seg5, seg6, seg7, seg8]

moveb(b_list, vel=200, acc=400)

Related commands• posx(X=0, Y=0, Z=0, A=0, B=0, C=0)(p. 30)• moveb()(p. 81)• amoveb()(p. 114)

3.1.5 fkin(pos, ref)FeaturesThis function receives the input data of joint angles or equivalent forms (float[6]) in the joint space and returns
the TCP (objects in the task space) based on the ref coordinate.

Parameters
Parameter Name

Data type

Default Value

Description

pos

posj

-

posj orposition list

list (float[6])
ref

int

DR_BASEreference coordinate• DR_BASE : basecoordinate• DR_WORLD : world
coordinate

ReturnValue

Description

posx

Task space point- 36 -

Programming manual(V2.10)

Motion-related Commands

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

Example
1
2
3
4
5
6
7
8

q1 = posj(0, 0, 90, 0, 90, 0)
movej(q1,v=10,a=20)
q2 = posj(30, 0, 90, 0, 90, 0)x2 = fkin(q2, DR_WORLD)# x2: Space coordinate at the edge of the robot (TCP) corresponding tojoint value q2
movel(x2,v=100,a=200,ref=DR_WORLD) # Linear motion to x2

9Related commands• set_tcp(name)(p. 50)• The tcp information of the name registered in the teach pendant is reflected during fkin operation.
• posj(J1=0, J2=0, J3=0, J4=0, J5=0, J6=0)(p. 29)• posx(X=0, Y=0, Z=0, A=0, B=0, C=0)(p. 30)

3.1.6 ikin(pos, sol_space, ref, ref_pos_opt, iter_threshold)FeaturesThis function returns the joint position corresponding to sol_space, which is equivalent to the robot pose in theoperating space, among 8 joint shapes. Joint position is returned according to closest joint position depend on
option(ref_pos_opt). Through status of return value, you can check whether current robot pose is in wrist
singularity or out of operating region.

- 37 -

Programming manual(V2.10)

Motion-related Commands

Note
After SW version V2.9, if the accuracy of robot is corrected when using this function, the accuracy
correction algorithm operates. The level of accuracy is adjustable according to the option(iter_threshold). Also, depending on the robot posture, there may be a delay of up to 0.1 seconds.

Parameters
Parameter
Name

Data TypeDefault
Value

Description

pos

posx

-

posx orposition list

list
(float[6])sol_spaceint-

solution space

ref

int

DR_BASEreference coordinate• DR_BASE : base coordinate• DR_WORLD : world coordinate

ref_pos_opt

int

0

Determine closest joint position depend on option among
multi turn solutions• 0 : posj(0,0,0,0,0,0) is reference• 1 : current joint position is reference

iter_thresholdlist(float[2])0.005

If the accuracy has been corrected, the level of the accuracy
correction algorithm
The norm value of TCP position (X, Y, Z) [mm]0.01

If the accuracy has been corrected, the level of the accuracy
correction algorithm
The norm value of TCP orientation (A, B, C) [deg]Robot configuration vs. solution space
Solution space

BinaryShoulder

Elbow

Wrist

0

000

Lefty

Below

No Flip

1

001

Lefty

Below

Flip

- 38 -

Programming manual(V2.10)

Motion-related Commands

Solution space

BinaryShoulder

Elbow

Wrist

2

010

Lefty

Above

No Flip

3

011

Lefty

Above

Flip

4

100

RightyBelow

No Flip

5

101

Righty

Below

Flip

6

110

RightyAbove

No Flip

7

111

Righty

Above

Flip

ReturnValue

Description

posj

Joint space point

status• 0 : Return joint position• 1 : Out of workspace• 2 : In wrist singularity region

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully- 39 -

Programming manual(V2.10)

Motion-related Commands

Example1234

x1 = posx(370.9, 719.7, 651.5, 90, -180, 0)
q1, status = ikin(x1, 2, DR_BASE, ref_pos_opt=0) # Joint angle q1 where
the coordinate of the robot edge is x1 (second of 8 cases), reference
joint position : posj(0,0,0,0,0,0)# q1=posj(60.3, 81.0, -60.4, -0.0, 159.4, -29.7) (M1013, tcp=(0,0,0))
movej(q1,v=10,a=20)

Related commands• set_tcp(name)(p. 50)• posj(J1=0, J2=0, J3=0, J4=0, J5=0, J6=0)(p. 29)• posx(X=0, Y=0, Z=0, A=0, B=0, C=0)(p. 30)

3.1.7 addto(pos, add_val=None)
FeaturesThis function creates a new posj object by adding add_val to each joint value of posj.

Parameters
Parameter
Name

Data TypeDefault Value

Description

pos

posj

-

posj orposition list

list (float[6])add_vallist (float[6])None

List of add values to be added to the position• No value is added if it is None or [].

ReturnValue

Description

posj

Joint space point- 40 -

Programming manual(V2.10)

Motion-related Commands

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

Example
1
2
3
4
5
6
7
8
9
10

q1 = posj(10, 20, 30, 40, 50, 60)
movej (q1, v=10, a=20)
q2 = addto(q1, [0, 0, 0, 0, 45, 0])
movej (q2, v=10, a=20) # The robot moves to the joint (10, 20, 30, 40, 95,
60).
q3 = addto(q2, [])q4 = addto(q3)Related commands• posj(J1=0, J2=0, J3=0, J4=0, J5=0, J6=0)(p. 29)

3.2 Motion settings
3.2.1 set_velj(vel)FeaturesThis function sets the global velocity in joint motion (movej, movejx, amovej, or amovejx) after using thiscommand. The default velocity is applied to the globally set vel if movej() is called without the explicit input ofthe velocity argument.

Parameters
Parameter
Name

Data TypeDefault Value- 41 -

Description

Programming manual(V2.10)

Motion-related Commands

vel

float

-

velocity (same to all axes) or
velocity (to an axis)

list (float[6])ReturnValue

Description0

Success

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

Example
1
2
3
4
5
6
7
8
9
10
11

#1
Q1 = posj(0,0,90,0,90,0)Q2 = posj(0,0,0,0,90,0)
movej(Q1, vel=10, acc=20)
set_velj(30) # The global joint velocity is set to 30 (deg/sec).
set_accj(60) # The global joint acceleration is set to 60 (deg/sec2). [Seeset_accj().]movej(Q2)# The joint motion velocity to Q2 is 30 (deg/sec) which is
the global velocity.
movej(Q1, vel=20, acc=40)# The joint motion velocity to Q1 is 20 (deg/sec) which is the specified velocity.
#2
set_velj(20.5) # Decimal point input is possible.
set_velj([10, 10, 20, 20, 30, 10]) # The global velocity can be specified
to each axis.

Related commands• set_accx(acc1, acc2)(p. 47)• set_accx(acc)(p. 49)• movej()(p. 54)• movejx()(p. 64)• movesj()(p. 74)• amovej()(p. 95)• amovejx()(p. 101)

- 42 -

Programming manual(V2.10)

Motion-related Commands• amovesj()(p. 108)3.2.2 set_accj(acc)
FeaturesThis function sets the global velocity in joint motion (movej, movejx, amovej, or amovejx) after using thiscommand. The globally set acceleration is applied as the default acceleration if movej() is called without the
explicit input of the acceleration argument.

Parameters
Parameter
Name

Data TypeDefault
Value

Description

acc

float

-

acceleration (same to all axes) or
acceleration (acceleration to an axis)

list(float[6])ReturnValue

Description0

Success

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

Example
1
2
3
4
5
6

#1
Q1 = posj(0,0,90,0,90,0)Q2 = posj(0,0,0,0,90,0)
movej(Q1, vel=10, acc=20)
set_velj(30) # The global joint velocity is set to 30 (deg/sec). [Seeset_velj().]set_accj(60) # The global joint acceleration is set to 60 (deg/sec2).

- 43 -

Programming manual(V2.10)

Motion-related Commands

7
8
9
10
11

movej(Q2)# The joint motion acceleration to Q2 is 60(deg/sec2) whichis the global acceleration.
movej(Q1, vel=20, acc=40) # The joint motion acceleration to Q1 is 40(deg/sec2) which is the specified acceleration.
#2
set_accj(30.55)
set_accj([30, 40, 30, 30, 30, 10])

Related commands• set_velj(vel)(p. 41)• movej()(p. 54)• movejx()(p. 64)• movesj()(p. 74)• amovej()(p. 95)• amovejx()(p. 101)
• amovesj()(p. 108)3.2.3 set_velx(vel1, vel2)
FeaturesThis function sets the velocity of the task space motion globally. The globally set velocity velx is applied as thedefault velocity if the task motion such as movel(), amovel(), movec(), movesx() is called without the explicit
input of the velocity value. In the set value, vel1 and vel2 define the linear velocity and rotating velocity,
relatively, of TCP.

Parameters
Parameter Name

Data TypeDefault
Value

Description

vel1

float

-

velocity 1

vel2

float

-

velocity 2

ReturnValue

Description0

Success- 44 -

Programming manual(V2.10)

Motion-related Commands

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

Example
1
2
3
4
5
6
7
8
9
10
11
12

#1
P0 = posj(0,0,90,0,90,0)
movej(P0)P1 = posx(400,500,800,0,180,0)P2 = posx(400,500,500,0,180,0)
movel(P1, vel=10, acc=20)
set_velx(30,20)# The global task velocity is set to 30(mm/sec) and20(deg/sec).
set_accx(60,40)# The global task acceleration is set to 60(mm/sec2) and40(deg/sec2).
movel(P2)# The task motion velocity to P2 is 30(mm/sec) and20(deg/sec) which are the global velocity.
movel(P1, vel=20, acc=40)# The task motion velocity to P1 is 20(mm/sec)
and 20(deg/sec) which are the specified velocity.
#2
set_velx(10.5, 19.4)# Decimal point input is possible.

Related commands• set_accx(acc1, acc2)(p. 47)• set_accx(acc)(p. 49)• movel()(p. 59)• movec()(p. 68)• movesx()(p. 77)• moveb()(p. 81)• move_spiral()(p. 85)• amovel()(p. 98)• amovec()(p. 104)
• amovesx()(p. 111)
• amoveb()(p. 114)
• amove_spiral()(p. 118)

- 45 -

Programming manual(V2.10)

Motion-related Commands

3.2.4 set_velx(vel)FeaturesThis function sets the linear velocity of the task space motion globally. The globally set velocity vel is applied as
the default velocity if the task motion such as movel(), amovel(), movec(), movesx() is called without the explicit
input of the velocity value. The set value vel defines the linear velocity of the TCP while the rotating velocity of
the TCP is determined proportionally to the linear velocity.

Parameters
Parameter Name

Data TypeDefault
Value

Description

vel

float

-

velocity

ReturnValue

Description0

Success

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

Example
1
2
3
4
5
6
7
8
9

#1
p0 = posj(0,0,90,0,90,0)
movej(p0)P1 = posx(400,500,800,0,180,0)P2 = posx(400,500,500,0,180,0)
movel(P1, vel=10, acc=20)
set_velx(30) # The global task velocity is set to 30 (mm/sec). The global
task angular velocity is automatically determined.
set_accx(60) # The global task acceleration is set to 60 (mm/sec2). The
global task angular acceleration is automatically determined.
movel(P2) # The task motion linear velocity to P2 is 30(mm/sec) which is
the global velocity.

- 46 -

Programming manual(V2.10)

Motion-related Commands

10
11
12

movel(P1, vel=20, acc=40) # The task motion linear velocity to P1 is
20(mm/sec) which is the specified velocity.
#2
set_velx(10.5) # Decimal point input is possible.

Related commands• set_accx(acc1, acc2)(p. 47)• set_accj(acc)(p. 43)• movel()(p. 59)• movec()(p. 68)• movesx()(p. 77)• moveb()(p. 81)• move_spiral()(p. 85)• movel()(p. 59)• movec()(p. 68)• movesx()(p. 77)• amoveb()(p. 114)
• amove_spiral()(p. 118)

3.2.5 set_accx(acc1, acc2)
FeaturesThis function sets the acceleration of the task space motion globally. The globally set acceleration accx isapplied as the default acceleration if the task motion such as movel(), amovel(), movec(), movesx() is called
without the explicit input of the acceleration value. In the set value, acc1 and acc2 define the linear acceleration
and rotating acceleration, relatively, of the TCP.

Parameters
Parameter Name

Data TypeDefault
Value

Description

acc1

float

-

acceleration 1

acc2

float

-

acceleration 2

ReturnValue

Description0

Success- 47 -

Programming manual(V2.10)

Motion-related Commands

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

Example
1
2
3
4
5
6
7
8
9

P0 = posj(0,0,90,0,90,0)
movej(P0)P1 = posx(400,500,800,0,180,0)P2 = posx(400,500,500,0,180,0)
movel(P1, vel=10, acc=20)
set_velx(30,20) # The global task velocity is set to 30(mm/sec) and20(deg/sec).
set_accx(60,40) # The global task acceleration is set to 60(mm/sec2) and40(deg/sec2).
movel(P2)# The task motion acceleration to P2 is 60(mm/sec2) and40(deg/sec2) which is the global acceleration.
movel(P1, vel=20, acc=40) # The task motion acceleration to P1 is 40(mm/sec) and 40(deg/sec2) which is the specified acceleration.

Related commands• set_velx(vel1, vel2)(p. 44)• set_velx(vel)(p. 46)• movel()(p. 59)• movec()(p. 68)• movesx()(p. 77)• moveb()(p. 81)• move_spiral()(p. 85)• movel()(p. 59)• movec()(p. 68)• movesx()(p. 77)• amoveb()(p. 114)
• amove_spiral()(p. 118)

- 48 -

Programming manual(V2.10)

Motion-related Commands

3.2.6 set_accx(acc)
FeaturesThis function sets the linear acceleration of the task space motion globally. The globally set acceleration acc is
applied as the default acceleration if the task motion such as movel(), amovel(), movec(), movesx() is called
without the explicit input of the acceleration value. The set value acc defines the linear acceleration of the TCP
while the rotating acceleration of the TCP is determined proportionally to the linear acceleration.

Parameters
Parameter Value

Data TypeDefault
Value

Description

acc

float

-

acceleration

ReturnValue

Description0

Success

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

Example
1
2
3
4
5
6
7
8
9

P0 = posj(0,0,90,0,90,0)
movej(P0)P1 = posx(400,500,800,0,180,0)P2 = posx(400,500,500,0,180,0)
movej(P0, vel=10, acc=20)
movel(P1, vel=10, acc=20)
set_velx(30)# The global task velocity is set to 30 (mm/sec). The
global task angular velocity is automatically determined.
set_accx(60)# The global task acceleration is set to 60 (mm/sec2).
The global task angular acceleration is automatically determined.
movel(P2)# The task motion linear acceleration to P2 is 60(mm/sec2) which is the global acceleration.

- 49 -

Programming manual(V2.10)

Motion-related Commands

10

movel(P1, vel=20, acc=40) # The task motion linear acceleration to P1 is
40(mm/sec2) which is the specified acceleration.

Related commands• set_velx(vel1, vel2)1• set_velx(vel)2• movel()3• movec()4• movesx()5• moveb()6• move_spiral()7• movel()8• movec()9• movesx()10• amoveb()11• amove_spiral()123.2.7 set_tcp(name)Featureshis function calls the name of the TCP registered in the Teach Pendant and sets it as the current TCP.

Parameter
Parameter Name

Data TypeDefault
Value

Description

namestring-Name of the TCP registered in the TP.

1 http://manual.doosanrobotics.com/display/Programming/.set_velx%28vel1%2C+vel2%29+v2.8reworking
2 http://manual.doosanrobotics.com/display/Programming/.set_velx%28vel%29+v2.8reworking
3 http://manual.doosanrobotics.com/display/Programming/.movel%28%29+v2.8reworking
4 http://manual.doosanrobotics.com/display/Programming/.movec%28%29+v2.8reworking
5 http://manual.doosanrobotics.com/display/Programming/.movesx%28%29+v2.8reworking
6 http://manual.doosanrobotics.com/display/Programming/.moveb%28%29+v2.8reworking
7 http://manual.doosanrobotics.com/display/Programming/.move_spiral%28%29+v2.8reworking
8 http://manual.doosanrobotics.com/display/Programming/.movel%28%29+v2.8reworking
9 http://manual.doosanrobotics.com/display/Programming/.movec%28%29+v2.8reworking
10 http://manual.doosanrobotics.com/display/Programming/.movesx%28%29+v2.8reworking
11 http://manual.doosanrobotics.com/display/Programming/.amoveb%28%29+v2.8reworking
12 http://manual.doosanrobotics.com/display/Programming/.amove_spiral%28%29+v2.8reworking- 50 -

Programming manual(V2.10)

Motion-related Commands

ReturnValue

Description0

Success

Negative value

FailedException
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Example123
45P0 = posj(0,0,90,0,90,0)
movej(P0)
set_tcp("tcp1") # The TCP data registered as tcp1 in the TP is called andset to the current TCP value.
P1 = posx(400,500,800,0,180,0)
movel(P1, vel=10, acc=20) # Moves the recognized center of the tool to theP1 position.

Related commands• fkin(pos, ref)(p. 36)• ikin(pos, sol_space, ref, ref_pos_opt, iter_threshold)(p. 37)• movel()13• movec()14• movesx()15• moveb()16
13 http://manual.doosanrobotics.com/display/Programming/.movel%28%29+v2.8reworking
14 http://manual.doosanrobotics.com/display/Programming/.movec%28%29+v2.8reworking
15 http://manual.doosanrobotics.com/display/Programming/.movesx%28%29+v2.8reworking
16 http://manual.doosanrobotics.com/display/Programming/.moveb%28%29+v2.8reworking- 51 -

Programming manual(V2.10)

Motion-related Commands• move_spiral()17• movel()18• movec()19• movesx()20• amoveb()21• amove_spiral()22

3.2.8 set_ref_coord(coord)
FeaturesThis function sets the reference coordinate system.

Parameter
Parameter Name

Data TypeDefault
Value

Description

coord

int

-

Reference coordinate system• DR_BASE: Base Coordinate• DR_WORLD: World Coordinate• DR_TOOL: Tool Coordinate• user Coordinate: User defined

ReturnValue

Description0

Success

Negative value

Failed

17 http://manual.doosanrobotics.com/display/Programming/.move_spiral%28%29+v2.8reworking
18 http://manual.doosanrobotics.com/display/Programming/.movel%28%29+v2.8reworking
19 http://manual.doosanrobotics.com/display/Programming/.movec%28%29+v2.8reworking
20 http://manual.doosanrobotics.com/display/Programming/.movesx%28%29+v2.8reworking
21 http://manual.doosanrobotics.com/display/Programming/.amoveb%28%29+v2.8reworking
22 http://manual.doosanrobotics.com/display/Programming/.amove_spiral%28%29+v2.8reworking- 52 -

Programming manual(V2.10)

Motion-related Commands

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6
7
8
9
10
11
12

p0 = posj(0,0,90,0,90,0)
movej(p0, v=30, a=30)
x1 = posx(370.9, 419.7, 651.5, 90,-180,0)
movel(x1, v=100, a=100) # Base Coordinate basis
uu1 = [-1, 1, 0] # x-axis vector of the user coordinate system (basecoordinate basis)
vv1 = [1, 1, 0]# y-axis vector of the user coordinate system (basecoordinate basis)pos = posx(370.9, -419.7, 651.5, 0, 0, 0) # Origin point of the user
coordinate system
DR_USER1 = set_user_cart_coord(uu1, vv1, pos)
# Sets the user coordinate
system.
set_ref_coord(DR_USER1)# Sets DR_USER1 of the user coordinate
system to the global coordinate system.
movel([0,0,0,0,0,0],v=100,a=100) # The global coordinate system is used
if the reference coordinate system is not specified.
# Moves to the origin point anddirection of the DR_USER1 coordinate system.
movel([0,200,0,0,0,0],v=100,a=100) # Moves to the (0,200,0) point of the
DR_USER1 coordinate system.

Related commands• movel()23• movejx()(p. 64)

23 http://manual.doosanrobotics.com/display/Programming/.movel%28%29+v2.8reworking- 53 -

Programming manual(V2.10)

Motion-related Commands• movec()24• movesx()25• moveb()26• move_spiral()27• move_periodic()(p. 89)

3.3 Synchronous Motion
3.3.1 movej()
Features
The robot moves to the target joint position (pos) from the current joint position.

Parameters
Parameter
Name

Data TypeDefault Value

Description

pos

posj

-

posj orjoint angle list

list (float[6])vel (v)

float

None

velocity (same to all axes) orlist (float[6])

None

float

None

list (float[6])Nonetime (t)

float

None

Reach time [sec]radius (r)

float

None

Radius for blending

velocity (to an axis)acc (a)acceleration (same to all axes) or
acceleration (acceleration to an axis)

24 http://manual.doosanrobotics.com/display/Programming/.movec%28%29+v2.8reworking
25 http://manual.doosanrobotics.com/display/Programming/.movesx%28%29+v2.8reworking
26 http://manual.doosanrobotics.com/display/Programming/.moveb%28%29+v2.8reworking
27 http://manual.doosanrobotics.com/display/Programming/.move_spiral%28%29+v2.8reworking- 54 -

Programming manual(V2.10)

Motion-related Commands

Parameter
Name

Data TypeDefault Value

Description

mod

int

DR_MV_MOD_ABS

Movement basis• DR_MV_MOD_ABS : Absolute• DR_MV_MOD_REL : Relative

ra

int

DR_MV_RA_DUPLICATE

Reactive motion mode
• DR_MV_RA_DUPLICATE:
duplicate• DR_MV_RA_OVERRIDE: override

Note• Abbreviated parameter names are supported. (v:vel, a:acc, t:time, r:radius)• _global_velj is applied if vel is None. (The initial value of _global_velj is 0.0 and can be set by
set_velj.)• _global_accj is applied if acc is None. (The initial value of _global_accj is 0.0 and can be set by
set_accj.)• If the time is specified, values are processed based on time, ignoring vel and acc.
• If the time is None, it is set to 0.
• If the radius is None, it is set to the blending radius in the blending section and 0 otherwise.
• If a new motion (following motion) is executed before the motion being executed (previous
motion) is completed, the previous motion and the following motion are smoothly connected(Motion Blending). It is possible to set the option ra, which can determine whether to maintainor cancel the target of the previous motion, for the following motion. (Maintain:
ra=DR_MV_RA_DUPLICATE / Cancel: ra=DR_MV_RA_OVERRIDE) For example, in the figure
below, if the following motion is executed at the “2nd motion event” point of a previous motion
with the target, “Target#1,” and if the option ra=DR_MV_RA_DUPLICATE is set for the following
motion, the motion will follow the orange trajectory, as the motion maintains the target of theprevious motion, and if option ra=DR_MV_RA_OVERRIDE is set for the following motion, the- 55 -

Programming manual(V2.10)

Motion-related Commands

motion will follow the green trajectory, as it cancels the target of the previous motion.

CautionIf the following motion is blended with the conditions of ra=DR_MV_RA_DUPLICATE and radius>0, thepreceding motion can be terminated when the following motion is terminated while the remaining
motion time determined by the remaining distance, velocity, and acceleration of the preceding motion isgreater than the motion time of the following motion. Refer to the following image for more information.

- 56 -

Programming manual(V2.10)

Motion-related Commands• In versions below SW V2.8, if the blending radius exceeds 1/2 of the total moving distance, themotion is not operated because it affects the motion after blending, and the running task
program is terminated when a blending error occurs• In SW V2.8 or later, if the blending radius exceeds 1/2 of the total moving distance, the blending
radius size is automatically changed to 1/2 of the total moving distance, and the change history
can be checked in the information log message.

- 57 -

Programming manual(V2.10)

Motion-related Commands

ReturnValue

Description0

Success

Negative value

FailedException
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6
7
8
9
10
11

Q1 = posj(0,0,90,0,90,0)Q2 = posj(0,0,0,0,90,0)
movej(Q1, vel=10, acc=20)# Moves to the Q1 joint angle at the velocity of 10(deg/sec) andacceleration of 20(deg/sec2).
movej(Q2, time=5)# Moves to the Q2 joint angle with a reach time of 5 sec.
movej(Q1, v=30, a=60, r=200)# Moves to the Q1 joint angle and is set to execute the next motion# when the distance from the Q1 space position is 200mm.
movej(Q2, v=30, a=60, ra= DR_MV_RA_OVERRIDE)# Immediately terminates the last motion and blends it to move to theQ2 joint angle.

Related commands• posj(J1=0, J2=0, J3=0, J4=0, J5=0, J6=0)(p. 29)- 58 -

Programming manual(V2.10)

Motion-related Commands• set_velj(vel)(p. 41)• set_accj(acc)(p. 43)• amovej()(p. 95)

3.3.2 movel()
Features
The robot moves along the straight line to the target position (pos) within the task space.

Parameters
Parameter Name

Data TypeDefault Value

Description

pos

posx

-

posx orposition list

list (float[6])vel (v)

float

None

list (float[2])

None

float

None

list (float[2])

None

float

None

velocity or
velocity1, velocity2

acc (a)acceleration or
acceleration1, acceleration2

time (t)Reach time [sec]• If the time is specified, values
are processed based on time,
ignoring vel and acc.

radius (r)

float

None

Radius for blending

ref

int

None

reference coordinate• DR_BASE: base coordinate• DR_WORLD: world coordinate• DR_TOOL: tool coordinate• user coordinate: user defined

mod

int

DR_MV_MOD_ABS

Movement basis• DR_MV_MOD_ABS : Absolute• DR_MV_MOD_REL : Relative- 59 -

Programming manual(V2.10)

Motion-related Commands

Parameter Name

Data TypeDefault Value

Description

ra

int

DR_MV_RA_DUPLICATE

Reactive motion mode

DR_MV_APP_NONE

Application mode

app_type

int• DR_MV_RA_DUPLICATE:
duplicate• DR_MV_RA_OVERRIDE:
override• DR_MV_APP_NONE: No
application related• DR_MV_APP_WELD: Welding
application related

Note• Abbreviated parameter names are supported. (v:vel, a:acc, t:time, r:radius)• _global_velx is applied if vel is None. (The initial value of _global_velx is 0.0 and can be set by
set_velx.)• _global_accx is applied if acc is None. (The initial value of _global_accx is 0.0 and can be set by
set_accx.)• If an argument is inputted to vel (e.g., vel=30), the input argument corresponds to the linear
velocity of the motion while the angular velocity is determined proportionally to the linear
velocity.
• If an argument is inputted to acc (e.g., acc=60), the input argument corresponds to the linear
acceleration of the motion while the angular acceleration is determined proportionally to thelinear acceleration.
• If the time is specified, values are processed based on time, ignoring vel and acc.
• If the time is None, it is set to 0.
• If the radius is None, it is set to the blending radius in the blending section and 0 otherwise.
• _g_coord is applied if the ref is None. (The initial value of _g_coord is DR_BASE, and it can be
set by the set_ref_coord command.)• If ‘app_type’ is ‘DR_MV_APP_WELD’, parameter ‘vel’ is internally replaced by the speed setting
entered in app_weld_set_weld_cond(), not the input value of ‘vel’.
• If a new motion (following motion) is executed before the motion being executed (previous
motion) is completed, the previous motion and the following motion are smoothly connected(Motion Blending). It is possible to set the option ra, which can determine whether to maintainor cancel the target of the previous motion, for the following motion. (Maintain:
ra=DR_MV_RA_DUPLICATE / Cancel: ra=DR_MV_RA_OVERRIDE) For example, in the figure
below, if the following motion is executed at the “2nd motion event” point of a previous motion
with the target, “Target#1,” and if the option ra=DR_MV_RA_DUPLICATE is set for the following
motion, the motion will follow the orange trajectory, as the motion maintains the target of theprevious motion, and if option ra=DR_MV_RA_OVERRIDE is set for the following motion, the- 60 -

Programming manual(V2.10)

Motion-related Commands

motion will follow the green trajectory, as it cancels the target of the previous motion.

CautionIf the following motion is blended with the conditions of ra=DR_MV_RA_DUPLICATE and radius>0, thepreceding motion can be terminated when the following motion is terminated while the remaining
motion time determined by the remaining distance, velocity, and acceleration of the preceding motion isgreater than the motion time of the following motion. Refer to the following image for more information.

- 61 -

Programming manual(V2.10)

Motion-related Commands• In versions below SW V2.8, if the blending radius exceeds 1/2 of the total moving distance, themotion is not operated because it affects the motion after blending, and the running task
program is terminated when a blending error occurs• In SW V2.8 or later, if the blending radius exceeds 1/2 of the total moving distance, the blending
radius size is automatically changed to 1/2 of the total moving distance, and the change history
can be checked in the information log message.

ReturnValue

Description0

Success- 62 -

Programming manual(V2.10)

Motion-related Commands

Value

Description

Negative value

FailedException
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

P0 = posj(0,0,90,0,90,0)
movej(P0, v=30, a=30)
P1 = posx(400,500,800,0,180,0)P2 = posx(400,500,500,0,180,0)P3 = posx(30,30,30,0,0,0)
movel(P1, vel=30, acc=100)# Moves to the P1 position with a velocity of 30(mm/sec) andacceleration of 100(mm/sec2).
movel(P2, time=5)# Moves to the P2 position with a reach time of 5 sec.
movel(P3, time=5, ref=DR_TOOL, mod=DR_MV_MOD_REL)# Moves the robot from the start position to the relative position of
P3 in the tool coordinate system# with a reach time of 5 sec.
movel(P2, time=5, r=10)# Moves the robot to the P2 position with a reach time of 5 seconds,# and the next motion is executed when the distance from the P2
position is 10mm.

Related commands• posx(X=0, Y=0, Z=0, A=0, B=0, C=0)(p. 30)• set_velx(vel1, vel2)(p. 44)- 63 -

Programming manual(V2.10)

Motion-related Commands• set_velx(vel)(p. 46)• set_accx(acc1, acc2)(p. 47)• set_accx(acc)(p. 49)• set_tcp(name)(p. 50)• set_ref_coord(coord)(p. 52)• amovel()(p. 98)

3.3.3 movejx()
Features
The robot moves to the target position (pos) within the joint space.
Since the target position is inputted as a posx form in the task space, it moves in the same way as movel.
However, since this robot motion is performed in the joint space, it does not guarantee a linear path to thetarget position. In addition, one of 8 types of joint combination (robot configurations) corresponding to the task
space coordinate system (posx) must be specified in sol (solution space).

Parameters
Parameter Name

Data TypeDefault Value

Description

pos

posx

-

posx orposition list

list (float[6])vel (v)

float

None

velocity (same to all axes) orNonevelocity (to an axis)

Noneacceleration (same to all axes) orNoneacceleration (acceleration to an
axis)

list (float[6])acc (a)float
list (float[6])time (t)

float

None

Reach time [sec]radius (r)

float

None

Radius for blending- 64 -

Programming manual(V2.10)

Motion-related Commands

Parameter Name

Data TypeDefault Value

Description

ref

int

None

reference coordinatež DR_BASE: base coordinatež DR_WORLD: world coordinatež DR_TOOL: tool coordinate
ž user coordinate: User defined

mod

int

DR_MV_MOD_ABS

Movement basis
ž DR_MV_MOD_ABS: Absolutež DR_MV_MOD_REL: Relative

ra

int

DR_MV_RA_DUPLICATE

Reactive motion mode
ž DR_MV_RA_DUPLICATE:
duplicatež DR_MV_RA_OVERRIDE:
override

sol

int

0

Solution space

Note• Abbreviated parameter names are supported. (v:vel, a:acc, t:time, r:radius)• _global_velj is applied if vel is None. (The initial value of _global_velj is 0.0 and can be set by
set_velj.)• _global_accj is applied if acc is None. (The initial value of _global_accj is 0.0 and can be set by
set_accj.)• If the time is specified, values are processed based on time, ignoring vel and acc.
• If the time is None, it is set to 0.
• If the radius is None, it is set to the blending radius in the blending section and 0 otherwise.
• _g_coord is applied if the ref is None. (The initial value of _g_coord is DR_BASE, and it can be
set by the set_ref_coord command.)• Using the blending in the preceding motion generates an error in the case of input with relative
motion (mod=DR_MV_MOD_REL), and it is recommended to blend using movej() or movel().
• Refer to the description of movej() and movel() for blending according to option ra and vel/acc.
Caution• In versions below SW V2.8, if the blending radius exceeds 1/2 of the total moving distance, themotion is not operated because it affects the motion after blending, and the running task
program is terminated when a blending error occurs- 65 -

Programming manual(V2.10)

Motion-related Commands• In SW V2.8 or later, if the blending radius exceeds 1/2 of the total moving distance, the blending
radius size is automatically changed to 1/2 of the total moving distance, and the change history
can be checked in the information log message.

Robot configuration (shape vs. solution space)
Solution space

BinaryShoulder

Elbow

Wrist

0

000

Lefty

Below

No Flip

1

001

Lefty

Below

Flip

2

010

Lefty

Above

No Flip

3

011

Lefty

Above

Flip

4

100

RightyBelow

No Flip

5

101

Righty

Below

Flip

6

110

RightyAbove

No Flip

7

111

Righty

Above

Flip

ReturnValue

Description0

Success

Negative value

Error

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred- 66 -

Programming manual(V2.10)

Motion-related Commands

Exception

Description

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

P0 = posj(0,0,90,0,90,0)
movej(P0, v=30, a=30)
P1 = posx(400,500,800,0,180,0)P2 = posx(400,500,500,0,180,0)
movel(P2, vel=100, acc=200)# Linear movement to P2

X_tmp, sol_init = get_current_posx()
space from the P2 position# Obtains the current solution

movejx(P1, vel=30, acc=60, sol=sol_init)# Moves to the joint angle with a velocity and acceleration of 30(deg/sec)
and 60(deg/sec2), respectively,# when the TCP edge is the P1 position (maintaining the solution space inthe last P2 position)
movejx(P2, time=5, sol=2)# Moves to the joint angle with a reach time of 5 sec when the TCP edge isat the P2 position# (forcefully sets a solution space to 2)
movejx(P1, vel=[10, 20, 30, 40, 50, 60], acc=[20, 20, 30, 30, 40, 40],
radius=100, sol=2)# Moves the robot to the joint angle when the TCP edge is at the P1
position,# and the next motion is executed when the distance from the P2 positionis 100mm.
movejx(P2, v=30, a=60, ra= DR_MV_RA_OVERRIDE, sol=2)# Immediately terminates the last motion and blends it to move to thejoint angle# when the TCP edge is at the P2 position.

- 67 -

Programming manual(V2.10)

Motion-related Commands

Related commands• posx(X=0, Y=0, Z=0, A=0, B=0, C=0)(p. 30)• set_velj(vel)(p. 41)• set_accj(acc)(p. 43)• get_current_posx(ref)(p. 156)
• amovejx()(p. 101)

3.3.4 movec()
Features
The robot moves along an arc to the target pos (pos2) via a waypoint (pos1) or to a specified angle from thecurrent position in the task space.

Parameters
Parameter Name

Data TypeDefault Value

Description

pos

posj

-

posx orposition list

list (float[6])
pos2

posx

posx orposition list

list (float[6]vel (v)

float

None

velocity or
velocity1, velocity2

list (float[2])

None

float

None

list (float[2])Nonetime (t)

float

None

Reach time [sec]radius (r)

float

None

Radius for blendingacc (a)acceleration or
acceleration1, acceleration2- 68 -

Programming manual(V2.10)

Motion-related Commands

Parameter Name

Data TypeDefault Value

Description

ref

int

None

reference coordinate• DR_BASE: base coordinate• DR_WORLD: world coordinate• DR_TOOL: tool coordinate• user coordinate: user defined

mod

int

DR_MV_MOD_ABS

Movement basis• DR_MV_MOD_ABS: Absolute• DR_MV_MOD_REL: Relative

angle (an)

float

None

angle orangle1, angle2

list (float[2])raint

DR_MV_RA_DUPLICATE

Reactive motion mode
• DR_MV_RA_DUPLICATE: duplicate• DR_MV_RA_OVERRIDE: override

ori

int

DR_MV_ORI_TEACH

Orientation mode
• DR_MV_ORI_TEACH: orientation
changes continuously from theinitial to the final taught value• DR_MV_ORI_FIXED: orientation
holds with the initial orientation• DR_MV_ORI_RADIAL: orientation
changes radially from the initial.

app_type

int

DR_MV_APP_NONE

Application mode
• DR_MV_APP_NONE: application
related• DR_MV_APP_WELD: Welding
application related

Note• Abbreviated parameter names are supported. (v:vel, a:acc, t:time, r:radius, angle:an)• _global_velx is applied if vel is None. (The initial value of _global_velx is 0.0 and can be set by
set_velx.)• _global_accx is applied if acc is None. (The initial value of _global_accx is 0.0 and can be set by
set_accx.)- 69 -

Programming manual(V2.10)

Motion-related Commands• If an argument is inputted to vel (e.g., vel=30), the input argument corresponds to the linear
velocity of the motion while the angular velocity is determined proportionally to the linear
velocity.
• If an argument is inputted to acc (e.g., acc=60), the input argument corresponds to the linear
acceleration of the motion while the angular acceleration is determined proportionally to thelinear acceleration.
• If the time is specified, values are processed based on time, ignoring vel and acc.
• If the time is None, it is set to 0.
• If the radius is None, it is set to the blending radius in the blending section and 0 otherwise.
• _g_coord is applied if the ref is None. (The initial value of _g_coord is DR_BASE, and it can be
set by the set_ref_coord command.)• If the mod is DR_MV_MOD_REL, pos1 and pos2 are defined in the relative coordinate system of
the previous pos. (pos1 is the relative coordinate from the starting point while pos2 is therelative coordinate from pos1.)• If the angle is None, it is set to 0.
• If only one angle is entered, the angle applied will be the total rotation angle of the circularpath.
• If two angle values are inputted, angle1 refers to the total rotating angle moving at a constantvelocity on the circular path while angle2 refers to the rotating angle in the rotating section for
acceleration and deceleration. In that case, the total moving angle angle1 + 2 X angle2 moves
along the circular path.
• If ‘app_type’ is ‘DR_MV_APP_WELD’, parameter ‘vel’ is internally replaced by the speed setting
entered in app_weld_set_weld_cond(), not the input value of ‘vel’.
• ‘ori’(orientation mode) is defined as below.
a. DR_MV_ORI_TEACH(orientation based on teaching) : It moves while changing thecurrent pose to the teaching pose of Pose 2, proportionate to the movement distance.
The orientation of the taught pose, ‘pose 1’ is ignored.
b. DR_MV_ORI_FIXED(fixed orientation) : Move along the path while maintaining the initialorientation up to the taught pose, ‘pose2’.
c. DR_MV_ORI_RADIAL(orientation constrained radially) : Move along the path while
maintaining radial orientation at the initial pose to the ‘pose 2’.

• If a new motion (following motion) is executed before the motion being executed (previous
motion) is completed, the previous motion and the following motion are smoothly connected(Motion Blending). It is possible to set the option ra, which can determine whether to maintainor cancel the target of the previous motion, for the following motion. (Maintain:- 70 -

Programming manual(V2.10)

Motion-related Commands

ra=DR_MV_RA_DUPLICATE / Cancel: ra=DR_MV_RA_OVERRIDE) For example, in the figure
below, if the following motion is executed at the “2nd motion event” point of a previous motion
with the target, “Target#1,” and if the option ra=DR_MV_RA_DUPLICATE is set for the following
motion, the motion will follow the orange trajectory, as the motion maintains the target of theprevious motion, and if option ra=DR_MV_RA_OVERRIDE is set for the following motion, themotion will follow the green trajectory, as it cancels the target of the previous motion.

CautionIf the following motion is blended with the conditions of ra=DR_MV_RA_DUPLICATE and radius>0, thepreceding motion can be terminated when the following motion is terminated while the remaining
motion time determined by the remaining distance, velocity, and acceleration of the preceding motion isgreater than the motion time of the following motion. Refer to the following image for more information.

- 71 -

Programming manual(V2.10)

Motion-related Commands• In versions below SW V2.8, if the blending radius exceeds 1/2 of the total moving distance, themotion is not operated because it affects the motion after blending, and the running task
program is terminated when a blending error occurs• In SW V2.8 or later, if the blending radius exceeds 1/2 of the total moving distance, the blending
radius size is automatically changed to 1/2 of the total moving distance, and the change history
can be checked in the information log message.

ReturnValue

Description0

Success

Negative value

Error- 72 -

Programming manual(V2.10)

Motion-related Commands

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

#1
P0 = posj(0,0,90,0,90,0)
movej(P0)
set_velx(30,20) # Set the global task velocity to 30(mm/sec) and 20(deg/sec).
set_accx(60,40) # Set the global task acceleration to 60(mm/sec2) and40(deg/sec2).
P1 = posx(400,500,800,0,180,0)P2 = posx(400,500,500,0,180,0)P3 = posx(100, 300, 700, 45, 0, 0)
P4 = posx(500, 400, 800, 45, 45, 0)
movec(P1, P2, vel=30)# Moves to P2 with a velocity of 30(mm/sec) and global acceleration of
60(mm/sec2)# via P1 along the arc trajectory.
movej(P0)movec(P3, P4, vel=30, acc=60)# Moves to P4 with a velocity of 30(mm/sec) and acceleration of 60(mm/sec2).
# via P3 along the arc trajectory
movej(P0).
movec(P2, P1, time=5)# Moves with a global velocity of 30(mm/sec) and acceleration of 60(mm/sec2).
# to P1 along the arc trajectory via P2 at the 5-second point.
movec(P3, P4, time=3, radius=100)- 73 -

Programming manual(V2.10)

Motion-related Commands

24
25
26
27

# Moves along the arc trajectory to P4 via P3 with a reach time of 3
seconds# and then executes the next motion at a distance of 100mm from the P4
position.
movec(P2, P1, ra=DR_MV_RA_OVERRIDE)# Immediately terminates the last motion and blends it to move to the P1
position.

Related commands• posx(X=0, Y=0, Z=0, A=0, B=0, C=0)(p. 30)• set_velx(vel1, vel2)(p. 44)• set_velx(vel)(p. 46)• set_accx(acc1, acc2)(p. 47)• set_accx(acc)(p. 49)• set_tcp(name)(p. 50)• set_ref_coord(coord)(p. 52)• amovec()(p. 104)

3.3.5 movesj()
Features
The robot moves along a spline curve path that connects the current position to the target position (the last
waypoint in pos_list) via the waypoints of the joint space input in pos_list.
The input velocity/acceleration means the maximum velocity/acceleration in the path, and the acceleration anddeceleration during the motion are determined according to the position of the waypoint.

Parameters
Parameter Name

Data TypeDefault Value

Description

pos_list

list (posj)-

posj listvel (v)

float

None

velocity(same to all axes) or
velocity(to an axis)

list (float[6])acc (a)

float

None

acceleration (same to all axes) or
acceleration (acceleration to an axis)

list (float[6])time (t)

float

None

Reach time [sec]- 74 -

Programming manual(V2.10)

Motion-related Commands

Parameter Name

Data TypeDefault Value

Description

mod

int

DR_MV_MOD_ABS

Movement basis• DR_MV_MOD_ABS : Absolute• DR_MV_MOD_REL : Relative

Note• Abbreviated parameter names are supported. (v:vel, a:acc, t:time)• _global_velj is applied if vel is None. (The initial value of _global_velj is 0.0 and can be set by
set_velj.)• _global_accj is applied if acc is None. (The initial value of _global_accj is 0.0 and can be set by
set_accj.)• If the time is specified, values are processed based on time, ignoring vel and acc.
• If the time is None, it is set to 0.
• If the mod is DR_MV_MOD_REL, each pos in the pos_list is defined in the relative coordinate of
the previous pos. (If pos_list=[q1, q2, ...,q(n-1), q(n)], q1 is the relative angle of the starting point
while q(n) is the relative coordinate of q(n-1).)• This function does not support online blending of previous and subsequent motions.

ReturnValue

Description0

Success

Negative value

Error

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred- 75 -

Programming manual(V2.10)

Motion-related Commands

Exception

Description

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

#CASE 1) Absolute angle input (mod= DR_MV_MOD_ABS)
q0 = posj(0,0,0,0,0,0)
movej(q0, vel=30, acc=60)# Moves in joint motion to the initial
position (q0).
q1 = posj(10, -10, 20, -30, 10, 20) # Defines the posj variable (joint
angle) q1.
q2 = posj(25, 0, 10, -50, 20, 40)
q3 = posj(50, 50, 50, 50, 50, 50)
q4 = posj(30, 10, 30, -20, 10, 60)
q5 = posj(20, 20, 40, 20, 0, 90)
qlist = [q1, q2, q3, q4, q5]
of q1-q5 as the waypoints.

# Defines the list (qlist) which is a set

movesj(qlist, vel=30, acc=100)# Moves the spline curve that connects the waypoints defined in theqlist.
# with a maximum velocity of 30(mm/sec) and maximum acceleration of
100(mm/sec2)#CASE 2) Relative angle input (mod= DR_MV_MOD_REL)
q0 = posj(0,0,0,0,0,0)
movej(q0, vel=30, acc=60)# Moves in joint motion to the initial
position (q0).
dq1 = posj(10, -10, 20, -30, 10, 20)# Defines dq1 (q1=q0+dq1) as
the relative joint angle of q0
dq2 = posj(15, 10, -10, -20, 10, 20)# Defines dq2 (q2=q1+dq2) as
the relative joint angle of q1
dq3 = posj(25, 50, 40, 100, 30, 10)# Defines dq3 (q3=q2+dq3) as
the relative joint angle of q2
dq4 = posj(-20, -40, -20, -70, -40, 10)# Defines dq4 (q4=q3+dq4) as
the relative joint angle of q3
dq5 = posj(-10, 10, 10, 40, -10, 30)# Defines dq5 (q5=q4+dq5) as
the relative joint angle of q4
dqlist = [dq1, dq2, dq3, dq4, dq5]
# Defines the list (dqlist) which is a set of q1-q5 as the relative
waypoints.
movesj(dqlist, vel=30, acc=100, mod= DR_MV_MOD_REL )# Moves the spline curve that connects the relative waypoints definedin the dqlist- 76 -

Programming manual(V2.10)

Motion-related Commands

31# with a maximum velocity of 30(mm/sec) and maximum acceleration of
100(mm/sec2) (same motion as CASE-1).

Related commands• posj(J1=0, J2=0, J3=0, J4=0, J5=0, J6=0)(p. 29)• set_velj(vel)(p. 41)• set_accj(acc)(p. 43)• amovesj()(p. 108)3.3.6 movesx()
Features
The robot moves along a spline curve path that connects the current position to the target position (the last
waypoint in pos_list) via the waypoints of the task space input in pos_list.
The input velocity/acceleration means the maximum velocity/acceleration in the path and the constant velocity
motion is performed with the input velocity according to the condition if the option for the constant speed
motion is selected.

Parameters
Parameter Name

Data TypeDefault Value

Description

pos_list

list (posx)-

posx listvel (v)

float

None

velocity or
velocity1, velocity2

list (float[2])acc (a)

float

None

acceleration or
acceleration1, acceleration2

list (float[2])time (t)

float

None

Reach time [sec]

ref

int

None

reference coordinate• DR_BASE: base coordinate• DR_WORLD: world
coordinate• DR_TOOL: tool coordinate• user coordinate: user defined- 77 -

Programming manual(V2.10)

Motion-related Commands

Parameter Name

Data TypeDefault Value

Description

mod

int

DR_MV_MOD_ABS

Movement basis• DR_MV_MOD_ABS: Absolute• DR_MV_MOD_REL: Relative

vel_opt

int

DR_MVS_VEL_NONE

Velocity option• DR_MVS_VEL_NONE: None
• DR_MVS_VEL_CONST:
Constant velocity

Note• Abbreviated parameter names are supported. (v:vel, a:acc, t:time)• _global_velx is applied if vel is None. (The initial value of _global_velx is 0.0 and can be set by
set_velx.)• _global_accx is applied if acc is None. (The initial value of _global_accx is 0.0 and can be set by
set_accx.)• If an argument is inputted to vel (e.g., vel=30), the input argument corresponds to the linear
velocity of the motion while the angular velocity is determined proportionally to the linear
velocity.
• If an argument is inputted to acc (e.g., acc=60), the input argument corresponds to the linear
acceleration of the motion while the angular acceleration is determined proportionally to thelinear acceleration.
• If the time is specified, values are processed based on time, ignoring vel and acc.
• If the time is None, it is set to 0.
• _g_coord is applied if the ref is None. (The initial value of _g_coord is DR_BASE, and it can be
set by the set_ref_coord command.)• If the mod is DR_MV_MOD_REL, each pos in the pos_list is defined in the relative coordinate of
the previous pos. (If pos_list=[p1, p2, ...,p(n-1), p(n)], p1 is the relative angle of the starting point
while p(n) is the relative coordinate of p(n-1).)• This function does not support online blending of previous and subsequent motions.
CautionThe constant velocity motion according to the distance and velocity between the waypoints cannot be
used if the "vel_opt= DR_MVS_VEL_CONST" option (constant velocity option) is selected, and the motion
is automatically switched to the variable velocity motion (vel_opt= DR_MVS_VEL_NONE) in that case.

- 78 -

Programming manual(V2.10)

Motion-related Commands

ReturnValue

Description0

Success

Negative value

Error

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

#CASE 1) Absolute coordinate input (mod= DR_MV_MOD_ABS)
P0 = posj(0,0,90,0,90,0)
movej(P0, v=30, a=30)
x0 = posx(600, 43, 500, 0, 180, 0) # Defines the posx variable (spacecoordinate/pose) x0.
movel(x0, vel=100, acc=200) # Linear movement to the initial position x0x1 = posx(600, 600, 600, 0, 175, 0) # Defines the posx variable (spacecoordinate/pose) x1.
x2 = posx(600, 750, 600, 0, 175, 0)x3 = posx(150, 600, 450, 0, 175, 0)
x4 = posx(-300, 300, 300, 0, 175, 0)
x5 = posx(-200, 700, 500, 0, 175, 0)
x6 = posx(600, 600, 400, 0, 175, 0)
xlist = [x1, x2, x3, x5, x6]
of x1-x6 as the waypoints.

# Defines the list (xlist) which is a set

movesx(xlist, vel=[100, 30], acc=[200, 60], vel_opt=DR_MVS_VEL_NONE)- 79 -

Programming manual(V2.10)

Motion-related Commands

16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47

# Moves the spline curve that connects the waypoints defined in thexlist# with a maximum velocity of 100, 30(mm/sec, deg/sec) and maximum
acceleration of 200(mm/sec2) and# 60(deg/sec2).
movesx(xlist, vel=[100, 30], acc=[200, 60], time=5, vel_opt=DR_MVS_VEL_CON
ST)# Moves the spline curve that connects the waypoints defined in thexlist# with a constant velocity of 100, 30(mm/sec, deg/sec).
#CASE 2) Relative coordinate input (mod= DR_MV_MOD_REL)
P0 = posj(0,0,90,0,90,0)
movej(P0)x0 = posx(600, 43, 500, 0, 180, 0) # Defines the posx variable (spacecoordinate/pose) x0.
movel(x0, vel=100, acc=200) # Linear movement to the initial position x0
dx1 = posx(0, 557, 100, 0, -5, 0)# Definition of relative coordinate dx1 to x0 (Homogeneoustransformation of dx1 based in x1= x0)
dx2 = posx(0, 150, 0, 0, 0, 0)# Definition of relative coordinate dx2 to x1 (Homogeneoustransformation of dx2 based in x2= x1)
dx3 = posx(-450, -150, -150, 0, 0, 0)# Definition of relative coordinate dx3 to x2 (Homogeneoustransformation of dx3 based in x3= x2)
dx4 = posx(-450, -300, -150, 0, 0, 0)# Definition of relative coordinate dx4 to x3 (Homogeneoustransformation of dx4 based in x4= x3)
dx5 = posx(100, 400, 200, 0, 0, 0)# Definition of relative coordinate dx5 to x4 (Homogeneoustransformation of dx5 based in x5= x4)
dx6 = posx(800, -100, -100, 0, 0, 0)# Definition of relative coordinate dx6 to x5 (Homogeneoustransformation of dx6 based in x6= x5)
dxlist = [dx1, dx2, dx3, dx4, dx5, dx6]
# Defines the list (dxlist) which is a set of dx1-dx6 as the
waypoints.
movesx(dxlist, vel=[100, 30], acc=[200, 60], mod= DR_MV_MOD_REL, vel_opt=D
R_MVS_VEL_NONE)# Moves the spline curve that connects the waypoints defined in thedxlist# with a maximum velocity of 100, 30 (mm/sec, deg/sec)# and maximum acceleration of 200(mm/sec2), and 60(deg/sec2) (samemotion as CASE-1).

Related commands• posx(X=0, Y=0, Z=0, A=0, B=0, C=0)(p. 30)• set_velx(vel1, vel2)(p. 44)- 80 -

Programming manual(V2.10)

Motion-related Commands• set_velx(vel)(p. 46)• set_accx(acc1, acc2)(p. 47)• set_accx(acc)(p. 49)• set_tcp(name)(p. 50)• set_ref_coord(coord)(p. 52)• amovesx()(p. 111)3.3.7 moveb()FeaturesThis function takes a list that has one or more path segments (line or circle) as arguments and moves at aconstant velocity by blending each segment into the specified radius. Here, the radius can be set through posb.

Parameters
Parameter Name

Data TypeDefault Value

Description

pos_list

list (posb)-

posb listvel (v)

float

None

velocity or
velocity1, velocity2

list (float[2])acc (a)

float

None

acceleration or
acceleration1, acceleration2

list (float[2])time (t)

float

None

Reach time [sec]* If the time is specified, values areprocessed based on time, ignoring vel
and acc.

ref

int

None

reference coordinate• DR_BASE: base coordinate• DR_WORLD: world coordinate• DR_TOOL: tool coordinate• user coordinate: User defined

mod

int

DR_MV_MOD_ABS

Movement basis• DR_MV_MOD_ABS: Absolute• DR_MV_MOD_REL: Relative- 81 -

Programming manual(V2.10)

Motion-related Commands

Parameter Name

Data TypeDefault Value

Description

app_type

int

DR_MV_APP_NONE

Application mode
• DR_MV_APP_NONE: No
application related• DR_MV_APP_WELD: Welding
application related

Note• Abbreviated parameter names are supported. (v:vel, a:acc, t:time)• Up to 50 arguments can be entered in posb_list.
• _global_velx is applied if vel is None. (The initial value of _global_velx is 0.0 and can be set by
set_velx.)• _global_accx is applied if acc is None. (The initial value of _global_accx is 0.0 and can be set by
set_accx.)• If an argument is inputted to vel (e.g., vel=30), the input argument corresponds to the linear
velocity of the motion while the angular velocity is determined proportionally to the linear
velocity.
• If an argument is inputted to acc (e.g., acc=60), the input argument corresponds to the linear
acceleration of the motion while the angular acceleration is determined proportionally to thelinear acceleration.
• If the time is specified, values are processed based on time, ignoring vel and acc.
• If the time is None, it is set to 0.
• _g_coord is applied if the ref is None. (The initial value of _g_coord is DR_BASE, and it can be
set by the set_ref_coord command.)• If the mod is DR_MV_MOD_REL, each pos in the posb_list is defined in the relative coordinate of
the previous pos.
• If ‘app_type’ is ‘DR_MV_APP_WELD’, parameter ‘vel’ is internally replaced by the speed setting
entered in app_weld_set_weld_cond(), not the input value of ‘vel’.
Caution• A user input error is generated if the blending radius in posb is 0.
• A user input error is generated due to the duplicated input of Line if contiguous Line-Linesegments have the same direction.
• A user input error is generated to prevent a sudden acceleration if the blending condition
causes a rapid change in direction.
• This function does not support online blending of previous and subsequent motions.

- 82 -

Programming manual(V2.10)

Motion-related Commands

ReturnValue

Description0

Success

Negative value

Error

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Example1
2
3# Init Pose @ Jx1
Jx1 = posj(45,0,90,0,90,45)
X0 = posx(370, 420, 650, 0, 180, 0)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

# CASE 1) ABSOLUTE# Absolute Goal Poses
X1 = posx(370, 670, 650, 0, 180, 0)
X1a = posx(370, 670, 400, 0, 180, 0)
X1a2= posx(370, 545, 400, 0, 180, 0)
X1b = posx(370, 595, 400, 0, 180, 0)
X1b2= posx(370, 670, 400, 0, 180, 0)
X1c = posx(370, 420, 150, 0, 180, 0)
X1c2= posx(370, 545, 150, 0, 180, 0)
X1d = posx(370, 670, 275, 0, 180, 0)
X1d2= posx(370, 795, 150, 0, 180, 0)# initial joint position# initial task position

seg11 = posb(DR_LINE, X1, radius=20)
seg12 = posb(DR_CIRCLE, X1a, X1a2, radius=20)
seg14 = posb(DR_LINE, X1b2, radius=20)
seg15 = posb(DR_CIRCLE, X1c, X1c2, radius=20)
seg16 = posb(DR_CIRCLE, X1d, X1d2, radius=20)
b_list1 = [seg11, seg12, seg14, seg15, seg16]- 83 -

Programming manual(V2.10)

Motion-related Commands

19
20
21
22
23
24
25
26
27
28
29
30

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

28

# The blending radius of the last waypoint (seg16) is ignored.
movej(Jx1, vel=30, acc=60, mod=DR_MV_MOD_ABS)# Joint motion to the initial angle (Jx1)
movel(X0, vel=150, acc=250, ref=DR_BASE, mod=DR_MV_MOD_ABS)# Line motion to the initial position (X0)moveb(b_list1, vel=150, acc=250, ref=DR_BASE, mod=DR_MV_MOD_ABS)# Moves the robot from the current position through a trajectory
consisting of seg11(LINE), seg12(CIRCLE), seg14(LINE),# seg15(CIRCLE), and seg16(CIRCLE) with a constant velocity of 150(mm/sec) with the exception of accelerating and decelerating sections.
# (The final point is X1d2.) Blending to the next segment begins# when the distance of 20mm from the end point (X1, X1a2, X1b2, X1c2,
and X1d2) of each segment# is reached.

# CASE 2) RELATIVE# Relative Goal Poses
dX1 = posx(0, 250, 0, 0, 0, 0)
dX1a = posx(0, 0, -150, 0, 0, 0)
dX1a2= posx(0, -125, 0, 0, 0, 0)
dX1b = posx(0, 50, 0, 0, 0, 0)
dX1b2= posx(0, 75, 0, 0, 0, 0)
dX1c = posx(0, -250, -250, 0, 0, 0)
dX1c2= posx(0, 125, 0, 0, 0, 0)
dX1d = posx(0, 125, 125, 0, 0, 0)
dX1d2= posx(0, 125, -125, 0, 0, 0)
dseg11 = posb(DR_LINE, dX1, radius=20)
dseg12 = posb(DR_CIRCLE, dX1a, dX1a2, radius=20)
dseg14 = posb(DR_LINE, dX1b2, radius=20)
dseg15 = posb(DR_CIRCLE, dX1c, dX1c2, radius=20)
dseg16 = posb(DR_CIRCLE, dX1d, dX1d2, radius=20)
db_list1 = [dseg11, dseg12, dseg14, dseg15, dseg16]# The blending radius of the last waypoint (dseg16) is ignored.
movej(Jx1, vel=30, acc=60, mod=DR_MV_MOD_ABS)# Joint motion to the initial angle (Jx1)
movel(X0, vel=150, acc=250, ref=DR_BASE, mod=DR_MV_MOD_ABS)# Line motion to the initial position (X0)moveb(b_list1, vel=150, acc=250, ref=DR_BASE, mod=DR_MV_MOD_ABS)# Moves the robot from the current position through a trajectory
consisting of dseg11(LINE), dseg12(CIRCLE), dseg14(LINE),# dseg15(CIRCLE), and dseg16(CIRCLE) with a constant velocity of
150(mm/sec) with the exception of accelerating and decelerating sections.
(The final point is X1d2.)# Blending to the next segment begins when the distance of 20mm fromthe end point (X1, X1a2, X1b2, X1c2, and X1d2) of each segment is reached.
(The path is the same as CASE#1.)- 84 -

Programming manual(V2.10)

Motion-related Commands

Related commands• posb(seg_type, posx1, posx2=None, radius=0)(p. 34)• set_velx(vel1, vel2)(p. 44)• set_velx(vel)(p. 46)• set_accx(acc1, acc2)(p. 47)• set_accx(acc)(p. 49)• set_tcp(name)(p. 50)• set_ref_coord(coord)(p. 52)• amoveb()(p. 114)

3.3.8 move_spiral()Features
Motion along a spiral trajectory on a plane which is perpendicular to the input 'axis' is performed on thespecified coordinate system 'ref'. Additional input, travel distance 'lmax' can cause the robot to move around acone, starting from the apex of it.

Parameters
Parameter
Name

Data
Type

Default Value

Range

Description

rev

float

10

rev > 0Total number of revolutions

rmax

float

10

rmax >
0

Final spiral radius [mm]

lmax

float

0

Distance moved in the axis direction [mm]vel (v)

float

None

velocityacc (a)

float

None

acceleration

time (t)

float

None

time ≥
0

Total execution time <sec>

axis

int

DR_AXIS_Z-

axis• DR_AXIS_X: x-axis• DR_AXIS_Y: y-axis• DR_AXIS_Z: z-axis- 85 -

Programming manual(V2.10)

Motion-related Commands

Parameter
Name

Data
Type

Default Value

Range

Description

ref

Int

DR_TOOL-

reference coordinate• DR_BASE : base coordinate• DR_WORLD : world coordinate• DR_TOOL : tool coordinate• user coordinate : user defined

Note• Abbreviated parameter names are supported. (v:vel, a:acc, t:time)• rev refers to the total number of revolutions of the spiral motion.
• Rmax refers to the maximum radius of the spiral motion.
• Lmax refers to the parallel distance in the axis direction during the motion. A negative valuemeans the parallel distance in the –axis direction.
• Vel refers to the moving velocity of the spiral motion.
• The first value of _global_velx (parallel velocity) is applied if vel is None. (The initial value of_global_velx is 0.0 and can be set by set_velx.)• acc refers to the moving acceleration of the spiral motion.
• The first value of _global_accx (parallel acceleration) is applied if acc is None. (The initial valueof _global_accx is 0.0 and can be set by set_accx.)• If the time is specified, values are processed based on time, ignoring vel and acc.
• If the time is None, it is set to 0.
• The axis defines the axis that is perpendicular to the surface defined by the spiral motion.
• Ref refers to the reference coordinate system defined by the spiral motion.
• This function does not support online blending of previous and subsequent motions.
Caution• An error can be generated to ensure safe motion if the rotating acceleration calculated by thespiral path is too great.
In this case, reduce the vel, acc, or time value.

ReturnValue

Description0

Success

Negative value

Error- 86 -

Programming manual(V2.10)

Motion-related Commands

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example
1
2

3
4
5
6

# hole search# (A motion that completes 9.5 revolutions (rev) to the 50 mm radius(rmax) from 0 on the Tool-X/Y surface as the center of the rotation in the
Tool-Z direction and the spiral trajectory that moves 50 mm (lmax) in the
Tool-Z direction at the same time in 10 seconds from the initial position)
J00 = posj(0,0,90,0,60,0)
movej(J00,vel=30,acc=30)# Joint movement to the initial pose
move_spiral(rev=9.5,rmax=20.0,lmax=50.0,time=20.0,axis=DR_AXIS_Z,ref=
DR_TOOL)- 87 -

Programming manual(V2.10)

Motion-related Commands

Related commands• set_velx(vel1, vel2)(p. 44)• set_velx(vel)(p. 46)• set_accx(acc1, acc2)(p. 47)• set_accx(acc)(p. 49)• set_tcp(name)(p. 50)• set_ref_coord(coord)(p. 52)• amove_spiral()(p. 118)

- 88 -

Programming manual(V2.10)

Motion-related Commands

3.3.9 move_periodic()
FeaturesThis function performs the cyclic motion based on the sine function of each axis (parallel and rotation) of thereference coordinate (ref) input as a relative motion that begins at the current position. The attributes of the
motion on each axis are determined by the amplitude and period, and the acceleration/deceleration time andthe total motion time are set by the interval and repetition count.

Parameters
Parameter Name

Data TypeDefault Value

Range

Description

amp

list (float[6])

-

0≤amp

Amplitude(motion between-amp and +amp) [mm] or[deg]periodfloat or0≤period

period(time for 1 cycle)[sec]list (float[6])
atime

float

0.0

0≤atimeAcc-, dec- time [sec]repeatint

1>0

Repetition count

ref

int

DR_TOOL-

reference coordinate• DR_BASE : basecoordinate• DR_WORLD : world
coordinate• DR_TOOL : tool
coordinate• user coordinate :user definedNote• Amp refers to the amplitude. The input is a list of 6 elements which are the amp values for theaxes (x, y, z, rx, ry, and rz). The amp input on the axis that does not have a motion must be 0.
• Period refers to the time needed to complete a motion in the direction, the amplitude. The
input is a list of 6 elements which are the periods for the axes (x, y, z, rx, ry, and rz).
• Atime refers to the acceleration and deceleration time at the beginning and end of the periodic
motion. The largest of the inputted acceleration/deceleration times and maximum period*1/4- 89 -

Programming manual(V2.10)

Motion-related Commands

is applied. An error is generated when the inputted acceleration/deceleration time exceeds 1/2of the total motion time.
• Repeat refers to the number of repetitions of the axis (reference axis) that has the largest period
value and determines the total motion time. The number of repetitions for each of theremaining axes is determined automatically according to the motion time.
• If the motion terminates normally, the motions for the remaining axes can be terminatedbefore the reference axis's motion terminates so that the end position matches the starting
position. The deceleration section will deviate from the previous path if the motions of all axes
are not terminated at the same time. Refer to the following image for more information.

- 90 -

Programming manual(V2.10)

Motion-related Commands- 91 -

Programming manual(V2.10)

Motion-related Commands• Ref refers to the reference coordinate system of the repeated motion.
• If a maximum velocity error is generated during a motion, adjust the amplification and periodusing the following formula.
Max. velocity = Amplification(amp)*2*pi(3.14)/Period(period) (i.e., Max.
velocity=62.83mm/sec if amp=10mm and period=1 sec)
• This function does not support online blending of previous and subsequent motions.

ReturnValue

Description0

Success

Negative value

Error- 92 -

Programming manual(V2.10)

Motion-related Commands

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6
7
8
9
10
11
12
13

14

P0 = posj(0,0,90,0,90,0)
movej(P0)#1move_periodic(amp =[10,0,0,0,30,0], period=1.0, atime=0.2, repeat=5, ref=D
R_TOOL)# Repeats the x-axis (10mm amp and 1 sec. period) motion and rotating
y-axis (30deg amp and 1 sec. period) motion in the tool coordinate system# totally, repeat the motion 5 times.
#2
move_periodic(amp =[10,0,20,0,0.5,0], period=[1,0,1.5,0,0,0], atime=0.5,
repeat=3, ref=DR_BASE)# Repeats the x-axis (10mm amp and 1 sec. period) motion and z-axis(20mm amp and 1.5 sec. period) motion in the base coordinate system# 3 times. The rotating y-axis motion is not performed since its
period is "0".
# The total motion time is about 5.5 sec. (1.5 sec. * 3 times + 1 sec.
for acceleration/deceleration) since the period of the x-axis motion isgreater.
# The x-axis motion is repeated 4.5 times.

Related commands• set_ref_coord(coord)(p. 52)• amove_periodic()(p. 122)

- 93 -

Programming manual(V2.10)

Motion-related Commands

3.3.10 move_home()
Features
Homing is performed by moving to the joint motion to the mechanical or user defined home position. According
to the input parameter [target], it moves to the mechanical home defined in the system or the home set by theuser.
주의• When using the Move command after homing is complete, it is recommended to use the wait
command after homing.

Parameter
Parameter
Name

Data
Type

Dafault
Valuetarget

int

-

Range

Description

Tartget of home position• DR_HOME_TARGET_MECHANIC : Mechanical home,
joint angle (0,0,0,0,0,0)• DR_HOME_TARGET_USER : user home.

Note• Homing motion is divided into two steps and performed sequentially.
a. Move to the homing position at the speed specified in the system.
b. Finding the home position precisely• Safety should be ensured so that there is no danger of collision in the vicinity of homing
operation.

ReturnValue

Description0

Success

Negative value

Error- 94 -

Programming manual(V2.10)

Motion-related Commands

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example1
2
3
4

move_home(DR_HOME_TARGET_USER)# Go to the user home

P0 = posj(0,0,90,0,90,0)
movej(P0)

3.4 Asynchronous Motion
3.4.1 amovej()
Features
The asynchronous movej motion operates in the same way as movej except that it does not have the radiusparameter for blending. The command is the asynchronous motion command, and the next command is
executed at the same time the motion begins.

Note• movej(pos): The next command is executed after the robot starts from the current position andreaches (stops at) pos.
• amovej(pos): The next command is executed regardless of whether the robot starts from thecurrent position and reaches (stops at) pos.

- 95 -

Programming manual(V2.10)

Motion-related Commands

Parameters
Parameter
Name

Data TypeDefault Value

Description

pos

posj

-

posj orjoint angle list

list (float[6])vel (v)

float

None

velocity (same to all axes) or
velocity (to an axis)

list (float[6])acc (a)

float

None

acceleration (same to all axes) or
acceleration (acceleration to an axis)

list (float[6])time (t)

float

None

Reach time [sec]

mod

int

DR_MV_MOD_ABS

Movement basis• DR_MV_MOD_ABS: Absolute• DR_MV_MOD_REL: Relative

ra

int

DR_MV_RA_DUPLICATE

Reactive motion mode
• DR_MV_RA_DUPLICATE: duplicate• DR_MV_RA_OVERRIDE: override

Note• Abbreviated parameter names are supported. (v:vel, a:acc, t:time)• _global_velj is applied if vel is None. (The initial value of _global_velj is 0.0 and can be set by
set_velj.)• _global_accj is applied if acc is None. (The initial value of _global_accj is 0.0 and can be set by
set_accj.)• If the time is specified, values are processed based on time, ignoring vel and acc.
• If the time is None, it is set to 0.
• Refer to the description of the movej() motion for the path of blending according to option ra
and vel/acc.

- 96 -

Programming manual(V2.10)

Motion-related Commands

ReturnValue

Description0

Success

Negative value

Error

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6
7
8
9
10
11

#Example 1. The robot moves to q1 and stops the motion 3 seconds after it
begins the motion at q0 and then moves to q99
q0 = posj(0, 0, 90, 0, 90, 0)
amovej (q0, vel=10, acc=20)# Moves to q0 and performs the next
command immediately afterwait(3)# Temporarily suspends the program execution for 3
seconds (while the motion continues).
q1 = posj(0, 0, 0, 0, 90, 0)
amovej (q1, vel=10, acc=20)# Maintains the q0 motion (DUPLICATE blending if the ra argument isomitted) and iterates to q1.
# Performs the next command immediately after the blending motion.
mwait(0)# Temporarily suspends the program execution until the
motion is terminated.
q99 = posj(0, 0, 0, 0, 0, 0)
movej (q99, vel=10, acc=20)# Joint motion to q99- 97 -

Programming manual(V2.10)

Motion-related Commands

Related commands• posj(J1=0, J2=0, J3=0, J4=0, J5=0, J6=0)(p. 29)• set_velj(vel)(p. 41)• set_accj(acc)(p. 43)• mwait(time=0)(p. 125)
• movej()(p. 54)

3.4.2 amovel()
Features
The asynchronous movel motion operates in the same way as movel except that it does not have the radiusparameter for blending. The command is the asynchronous motion command, and the next command is
executed without waiting for the motion to terminate.
Note• movel(pos): The next command is executed after the robot starts from the current position andreaches (stops at) pos.
• amovel(pos): The next command is executed regardless of whether the robot starts from thecurrent position and reaches (stops at) pos.

Parameters
Parameter Name

Data TypeDefault Value

Description

pos

posx

-

posx orposition list

list (float[6])vel (v)

float

None

velocity or
velocity1, velocity2

list (float[2])acc (a)

float

None

acceleration or
acceleration1, acceleration2

list (float[2])- 98 -

Programming manual(V2.10)

Motion-related Commands

Parameter Name

Data TypeDefault Value

Description

time (t)

float

None

Reach time [sec]• If the time is specified, values
are processed based on time,
ignoring vel and acc.

ref

int

None

reference coordinate• DR_BASE : base coordinate• DR_WORLD : world coordinate• DR_TOOL : tool coordinate• user coordinate: User defined

mod

int

DR_MV_MOD_ABS

Movement basis• DR_MV_MOD_ABS: Absolute• DR_MV_MOD_REL: Relative

ra

int

app_type

int

DR_MV_RA_DUPLICATE

Reactive motion mode

DR_MV_APP_NONE

Reactive motion mode

• DR_MV_RA_DUPLICATE:
duplicate• DR_MV_RA_OVERRIDE:
override• DR_MV_APP_NONE: No
application related• DR_MV_APP_WELD: Welding
application related

Note• Abbreviated parameter names supported (v:vel, a:acc, t:time).
• _global_velx is applied if vel is None. (The initial value of _global_velx is 0.0 and can be set by
set_velx.)• _global_accx is applied if acc is None. (The initial value of _global_accx is 0.0 and can be set by
set_accx.)• If an argument is inputted to vel (e.g., vel=30), the input argument corresponds to the linear
velocity of the motion while the angular velocity is determined proportionally to the linear
velocity.
• If an argument is inputted to acc (e.g., acc=60), the input argument corresponds to the linear
acceleration of the motion while the angular acceleration is determined proportionally to thelinear acceleration.
• If the time is specified, values are processed based on time, ignoring vel and acc.

- 99 -

Programming manual(V2.10)

Motion-related Commands• If the time is None, it is set to 0.
• _g_coord is applied if the ref is None. (The initial value of _g_coord is DR_BASE, and it can be
set by the set_ref_coord command.)• Refer to the description of the movej() motion for the path of the blending according to option
ra and vel/acc.
• If ‘app_type’ is ‘DR_MV_APP_WELD’, parameter ‘vel’ is internally replaced by the speed setting
entered in app_weld_set_weld_cond(), not the input value of ‘vel’.

ReturnValue

Description0

Success

Negative value

Error

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6
7

#Example 1. D-Out 2 seconds after the motion starts with x1
j0 = posj(-148,-33,-54,180,92,32)
movej(j0, v=30, a=30)
x1 = posx(784, 543, 570, 0, 180, 0)
amovel (x1, vel=100, acc=200)# Performs the next motion immediately
after beginning a motion with x1.
wait(2)# Temporarily suspends the program
execution for 2 seconds (while the motion continues).
set_digital_output(1, 1)# D-Out (no. 1 channel) ON- 100 -

Programming manual(V2.10)

Motion-related Commands

8

mwait(0)# Temporarily suspends the program
execution until the motion is terminated.

Related commands• posx(X=0, Y=0, Z=0, A=0, B=0, C=0)(p. 30)• set_velx(vel1, vel2)(p. 44)• set_velx(vel)(p. 46)• set_accx(acc1, acc2)(p. 47)• set_accx(acc)(p. 49)• set_tcp(name)(p. 50)• set_ref_coord(coord)(p. 52)• mwait(time=0)(p. 125)
• movel()(p. 59)

3.4.3 amovejx()
Features
The asynchronous movejx motion operates in the same way as movejx except that it does not have the radiusparameter for blending. The command is the asynchronous motion command, and the next command is
executed without waiting for the motion to terminate.
Note• movejx(pos): The next command is executed after the robot starts from the current position
and reaches (stops at) pos.
• amovejx(pos): The next command is executed regardless of whether the robot starts from thecurrent position and reaches (stops at) pos.

Parameters
Parameter Name

Data TypeDefault Value

Description

pos

posx

-

posx orposition list

list (float[6])vel (v)

float

None

list (float[6])Nonevelocity (same to all axes) or
velocity (to an axis)- 101 -

Programming manual(V2.10)

Motion-related Commands

Parameter Name

Data TypeDefault Value

Descriptionacc (a)

float

None

acceleration (same to all axes) orlist (float[6])Nonetime (t)

float

None

Reach time [sec]

ref

int

None

reference coordinate

acceleration (acceleration to an axis)• DR_BASE: base coordinate• DR_WORLD : world coordinate• DR_TOOL: tool coordinate• user coordinate: user defined
mod

int

DR_MV_MOD_ABS

Movement basis• DR_MV_MOD_ABS: Absolute• DR_MV_MOD_REL: Relative

ra

int

DR_MV_RA_DUPLICATE

Reactive motion mode
• DR_MV_RA_DUPLICATE:
duplicate• DR_MV_RA_OVERRIDE: override

sol

int

0

Solution space

Note• Abbreviated parameter names are supported. (v:vel, a:acc, t:time)• _global_velj is applied if vel is None. (The initial value of _global_velj is 0.0 and can be set by
set_velj.)• _global_accj is applied if acc is None. (The initial value of _global_accj is 0.0 and can be set by
set_accj.)• If the time is specified, values are processed based on time, ignoring vel and acc.
• If the time is None, it is set to 0.
• If the time is specified, values are processed based on time, ignoring vel and acc.
• If the time is None, it is set to 0.
• _g_coord is applied if the ref is None. The initial value of _g_coord is DR_BASE, and it can be set
by the set_ref_coord command.
• Refer to the description of the movej() motion for the path of the blending according to option
ra and vel/acc.
Caution- 102 -

Programming manual(V2.10)

Motion-related Commands

If relative motion is entered (mod=DR_MV_MOD_REL), the motion in progress cannot execute blending.
Therefore it is recommended to execute blending with movej() or movel().

ReturnValue

Description0

Success

Negative value

Error

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6
7
8

#Example 1. D-Out 2 seconds after the joint motion starts with x1
p0 = posj(-148,-33,-54,180,92,32)
movej(p0, v=30, a=30)
x1 = posx(784, 443, 770, 0, 180, 0)
amovejx (x1, vel=100, acc=200, sol=1)# Performs the next motion
immediately after beginning a joint motion with x1.
wait(2)# Temporarily suspends the program
execution for 2 seconds (while the motion continues).
set_digital_output(1, 1)# D-Out (no. 1 channel) ON
mwait(0)# Temporarily suspends the program
execution until the motion is terminated.

- 103 -

Programming manual(V2.10)

Motion-related Commands

Related commands• posx(X=0, Y=0, Z=0, A=0, B=0, C=0)(p. 30)• set_velj(vel)(p. 41)• set_accj(acc)(p. 43)• get_current_posx(ref)(p. 156)• mwait(time=0)(p. 125)
• movejx()(p. 64)

3.4.4 amovec()
Features
The asynchronous movec motion operates in the same way as movec except that it does not have the radiusparameter for blending. The command is the asynchronous motion command, and the next command is
executed without waiting for the motion to terminate.

Note• movec(pos1. pos2): The next command is executed after the robot starts from the current
position and reaches (stops at) pos2.
• amovec(pos1. pos2): The next command is executed regardless of whether the robot starts
from the current position and reaches (stops at) pos2.

Parameters
Parameter
Name

Data TypeDefault Value

Description

pos

posx

-

posx orposition list

list (float[6])
pos2

posx

-

posx orposition list

list (float[6]vel (v)

float

None

velocity or
velocity1, velocity2

list (float[2])- 104 -

Programming manual(V2.10)

Motion-related Commands

Parameter
Name

Data TypeDefault Value

Descriptionacc (a)

float

None

acceleration or
acceleration1, acceleration2

list (float[2])time (t)

float

None

Reach time [sec]

ref

int

None

reference coordinate• DR_BASE: base coordinate• DR_WORLD: world coordinate• DR_TOOL: tool coordinate• user coordinate: user defined

mod

int

DR_MV_MOD_ABS

Movement basis• DR_MV_MOD_ABS: Absolute• DR_MV_MOD_REL: Relative

angle (an)

float

None

angle orangle1, angle2

list (float[2])raint

DR_MV_RA_DUPLICATE

Reactive motion mode
• DR_MV_RA_DUPLICATE: duplicate• DR_MV_RA_OVERRIDE: override

ori

int

DR_MV_ORI_TEACH

Orientation mode
• DR_MV_ORI_TEACH: orientation
changes continuously from the initial
to the final taught value• DR_MV_ORI_FIXED: orientation holdswith the initial orientation• DR_MV_ORI_RADIAL: orientation
changes radially from the initial.

app_type

int

DR_MV_APP_NONE

Application mode
• DR_MV_APP_NONE: No application
related• DR_MV_APP_WELD: Welding
application related

Note- 105 -

Programming manual(V2.10)

Motion-related Commands• Abbreviated parameter names are supported. (v:vel, a:acc, t:time, angle:an)• _global_velx is applied if vel is None. (The initial value of _global_velx is 0.0 and can be set by
set_velx.)• _global_accx is applied if acc is None. (The initial value of _global_accx is 0.0 and can be set by
set_accx.)• If an argument is inputted to vel (e.g., vel=30), the input argument corresponds to the linear
velocity of the motion while the angular velocity is determined proportionally to the linear
velocity.
• If an argument is inputted to acc (e.g., acc=60), the input argument corresponds to the linear
acceleration of the motion while the angular acceleration is determined proportionally to thelinear acceleration.
• If the time is specified, values are processed based on time, ignoring vel and acc.
• If the time is None, it is set to 0.
• _g_coord is applied if the ref is None. (The initial value of _g_coord is DR_BASE, and it can be
set by the set_ref_coord command.)• If the mod is DR_MV_MOD_REL, pos1 and pos2 are defined in the relative coordinate system of
the previous pos. (pos1 is the relative coordinate from the starting point while pos2 is therelative coordinate from pos1.)• If the angle is None, it is set to 0.
• If only one angle is entered, the angle applied will be the total rotation angle of the circularpath.
• If two angle values are inputted, angle1 refers to the total rotating angle moving at a constantvelocity on the circular path while angle2 refers to the rotating angle in the rotating section for
acceleration and deceleration. Here, the robot moves on the circular path at a total movement
angle of angle1 + 2xangle2.
• Refer to the description of the movej() motion for the path of the blending according to option
ra and vel/acc.
• If ‘app_type’ is ‘DR_MV_APP_WELD’, parameter ‘vel’ is internally replaced by the speed setting
entered in app_weld_set_weld_cond(), not the input value of ‘vel’.
• ori’(orientation mode) is defined as below.
a. DR_MV_ORI_TEACH(orientation based on teaching) : It moves while changing thecurrent pose to the teaching pose of Pose 2, proportionate to the movement
distance.The orientation of the taught pose, ‘pose 1’ is ignored.
b. DR_MV_ORI_FIXED(fixed orientation) : Move along the path while maintaining the initialorientation up to the taught pose, ‘pose2’.

- 106 -

Programming manual(V2.10)

Motion-related Commandsc. DR_MV_ORI_RADIAL(orientation constrained radially) : Move along the path while
maintaining radial orientation at the initial pose to the ‘pose 2

ReturnValue

Description0

Success

Negative value

Error

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example12
3
45#Example 1. D-Out 3 seconds after the arc motion through x1 and x2 begins
p0 = posj(-148,-33,-54,180,92,32)
movej(p0, v=30, a=30)
x1 = posx(784, 443, 770, 0, 180, 0)
amovejx (x1, vel=100, acc=200, sol=2) # Performs the next motion
immediately after beginning a joint motion with x1.

- 107 -

Programming manual(V2.10)

Motion-related Commands

6
7
8

wait(2)# Temporarily suspends the program execution for 2
seconds (while the motion continues).
set_digital_output(1, 1)# D-Out (no. 1 channel) ON
mwait(0)Related commands• posx(X=0, Y=0, Z=0, A=0, B=0, C=0)(p. 30)• set_velx(vel1, vel2)(p. 44)• set_velx(vel)(p. 46)• set_accx(acc1, acc2)(p. 47)• set_accx(acc)(p. 49)• set_tcp(name)(p. 50)• set_ref_coord(coord)(p. 52)• mwait(time=0)(p. 125)
• movec()(p. 68)

3.4.5 amovesj()
Features
The asynchronous movesj motion operates in the same way as movesj() except for the asynchronous
processing.
Generating a new command for the motion before the amovesj() motion results in an error for safety reasons.
Therefore, the termination of the amovesj() motion must be confirmed using mwait() or check_motion()
between amovesj() and the following motion command.
Note• movesj(pos_list): The next command is executed after the robot starts from the current
position and reaches (stops at) the end point of pos_list.
• amovesj(pos_list): The next command is executed regardless of whether the robot starts fromthe current position and reaches (stops at) the end point of pos_list.

Parameters
Parameter Name

Data TypeDefault Value

Description

pos_list

list (posj)-

posj list- 108 -

Programming manual(V2.10)

Motion-related Commands

Parameter Name

Data TypeDefault Value

Descriptionvel (v)

float

None

velocity (same to all axes) or
velocity (to an axis)

list (float[6])acc (a)

float

None

acceleration (same to all axes) or
acceleration (acceleration to an
axis)

list (float[6])time (t)

float

None

Reach time [sec]

mod

int

DR_MV_MOD_ABS

Movement basis• DR_MV_MOD_ABS:
Absolute• DR_MV_MOD_REL:
Relative

Note• Abbreviated parameter names are supported. (v:vel, a:acc, t:time)• _global_velj is applied if vel is None. (The initial value of _global_velj is 0.0 and can be set by
set_velj.)• _global_accj is applied if acc is None. (The initial value of _global_accj is 0.0 and can be set by
set_accj.)• If the time is specified, values are processed based on time, ignoring vel and acc.
• If the time is None, it is set to 0.
• If the mod is DR_MV_MOD_REL, each pos in the pos_list is defined in the relative coordinate of
the previous pos. (If pos_list=[q1, q2, ...,q(n-1), q(n)], q1 is the relative angle of the starting point
while q(n) is the relative coordinate of q(n-1).)• This function does not support online blending of previous and subsequent motions.

ReturnValue

Description0

Success

Negative value

Error- 109 -

Programming manual(V2.10)

Motion-related Commands

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

#Example 1. D-Out 3 seconds after the spline motion through q1 - q5 begins
q0 = posj(0,0,0,0,0,0)
movej(q0, vel=30, acc=60)# Moves in joint motion to the initial
position (q0).
q1 = posj(10, -10, 20, -30, 10, 20)# Defines the posj variable(joint angle) q1.
q2 = posj(25, 0, 10, -50, 20, 40)
q3 = posj(50, 50, 50, 50, 50, 50)
q4 = posj(30, 10, 30, -20, 10, 60)
q5 = posj(20, 20, 40, 20, 0, 90)
qlist = [q1, q2, q3, q4, q5]# Defines the list (qlist) which is a set of waypoints q1-q5.
amovesj(qlist, vel=30, acc=100)# Moves the spline curve that connects the waypoints defined in theqlist.
# with a maximum velocity of 30(mm/sec) and maximum acceleration of
100(mm/sec2).
# Executes the next command.
wait(3)# Temporarily suspends the
program execution for 3 seconds (while the motion continues).
set_digital_output(1, 1)# D-Out (no. 1 channel) ON
mwait(0)# Temporarily suspends the
program execution until the motion is terminated.

- 110 -

Programming manual(V2.10)

Motion-related Commands

Related commands• posj(J1=0, J2=0, J3=0, J4=0, J5=0, J6=0)(p. 29)• set_velj(vel)(p. 41)• set_accj(acc)(p. 43)• mwait(time=0)(p. 125)
• amovesj(p. 108)3.4.6 amovesx()
Features
The asynchronous movesx motion operates in the same way as movesx() except for the asynchronous
processing.
Generating a new command for the motion before the amovesj() motion results in an error for safety reasons.
Therefore, the termination of the amovesx() motion must be confirmed using mwait() or check_motion()
between amovesx() and the following motion command.
Note• movesx(pos_list): The next command is executed after the robot starts from the current
position and reaches (stops at) the end point of pos_list.
• amovesx(pos_list): The next command is executed regardless of whether the robot starts fromthe current position and reaches (stops at) the end point of pos_list.

Parameters
Parameter Name

Data TypeDefault Value

Description

pos_list

list (posx)-

posx listvel (v)

float

None

velocity or
velocity1, velocity2

list (float[2])acc (a)

float

None

acceleration or
acceleration1, acceleration2

list (float[2])time (t)

float

None

Reach time [sec]- 111 -

Programming manual(V2.10)

Motion-related Commands

Parameter Name

Data TypeDefault Value

Description

ref

int

None

reference coordinate• DR_BASE: base coordinate• DR_WORLD: world coordinate• DR_TOOL: tool coordinate• user coordinate: User defined

mod

int

DR_MV_MOD_ABS

Movement basis• DR_MV_MOD_ABS: Absolute• DR_MV_MOD_REL: Relative

vel_opt

int

DR_MVS_VEL_NONE

Velocity option• DR_MVS_VEL_NONE: None
• DR_MVS_VEL_CONST: Constantvelocity

Note• Abbreviated parameter names are supported. (v:vel, a:acc, t:time)• _global_velx is applied if vel is None. (The initial value of _global_velx is 0.0 and can be set by
set_velx.)• _global_accx is applied if acc is None. (The initial value of _global_accx is 0.0 and can be set by
set_accx.)• If an argument is inputted to vel (e.g., vel=30), the input argument corresponds to the linear
velocity of the motion while the angular velocity is determined proportionally to the linear
velocity.
• If an argument is inputted to acc (e.g., acc=60), the input argument corresponds to the linear
acceleration of the motion while the angular acceleration is determined proportionally to thelinear acceleration.
• If the time is specified, values are processed based on time, ignoring vel and acc.
• If the time is None, it is set to 0.
• _g_coord is applied if the ref is None. (The initial value of _g_coord is DR_BASE, and it can be
set by the set_ref_coord command.)• If the mod is DR_MV_MOD_REL, each pos in the pos_list is defined in the relative coordinate of
the previous pos. (If pos_list=[p1, p2, ...,p(n-1), p(n)], p1 is the relative angle of the starting point
while p(n) is the relative coordinate of p(n-1).)• This function does not support online blending of previous and subsequent motions.
Caution- 112 -

Programming manual(V2.10)

Motion-related Commands

The constant velocity motion according to the distance and velocity between the waypoints cannot be
used if the "vel_opt= DR_MVS_VEL_CONST" option (constant velocity option) is selected, and the motion
is automatically switched to the variable velocity motion (vel_opt= DR_MVS_VEL_NONE) in that case.

ReturnValue

Description0

Success

Negative value

Error

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6
7
8
9
10
11

#Example 1. D-Out 3 seconds after the spline motion through x1 - x6 begins
P0 = posj(0,0,90,0,90,0)
movej(P0)x0 = posx(600, 43, 500, 0, 180, 0)# Defines the posx variable(space coordinate/pose) x0.
movel(x0, vel=100, acc=200)# Linear movement to the initial
position x0x1 = posx(600, 600, 600, 0, 175, 0)# Defines the posx variable(space coordinate/pose) x1.
x2 = posx(600, 750, 600, 0, 175, 0)x3 = posx(150, 600, 450, 0, 175, 0)
x4 = posx(-300, 300, 300, 0, 175, 0)
x5 = posx(-200, 700, 500, 0, 175, 0)
x6 = posx(600, 600, 400, 0, 175, 0)- 113 -

Programming manual(V2.10)

Motion-related Commands

12
13
14
15
16
17
18
19
20
21

xlist = [x1, x2, x3, x5, x6]
is a set of x1-x6 as the waypoints.

# Defines the list (xlist) whichamovesx(xlist, vel=[100, 30], acc=[200, 60], vel_opt=DR_MVS_VEL_NONE)# Moves the spline curve that connects the waypoints defined in thexlist# with a maximum velocity of 100, 30(mm/sec, deg/sec) and maximum
acceleration of 200(mm/sec2) and# 60(deg/sec2). The next command is executed immediately after the
motion starts.
wait(3)# Temporarily suspends the program execution for 3
seconds (while the motion continues).
set_digital_output(1, 1)# D-Out (no. 1 channel) ON
mwait(0)# Temporarily suspends the program
execution until the motion is terminated.

Related commands• posx(X=0, Y=0, Z=0, A=0, B=0, C=0)(p. 30)• set_velx(vel1, vel2)(p. 44)• set_velx(vel)(p. 46)• set_accx(acc1, acc2)(p. 47)• set_accx(acc)(p. 49)• set_tcp(name)(p. 50)• set_ref_coord(coord)(p. 52)• mwait(time=0)(p. 125)
• movesx()(p. 77)

3.4.7 amoveb()Features
The asynchronous moveb motion operates in the same way as moveb() except for the asynchronous processing
and executes the next line after the command is executed.
Generating a new command for the motion before the amoveb() motion results in an error for safety reasons.
Therefore, the termination of the amoveb() motion must be confirmed using mwait() or check_motion()
between amoveb() and the following motion command.

Note• moveb(seg_list): The next command is executed after the robot starts from the current position
and reaches (stops at) the end point of seg_list.

- 114 -

Programming manual(V2.10)

Motion-related Commands• amoveb(seg_list): The next command is executed regardless of whether the robot starts fromthe current position and reaches (stops at) the end point of seg_list.

Parameters
Parameter Name

Data TypeDefault Value

Description

pos_list

list (posb)-

posb listvel (v)

float

None

velocity or
velocity1, velocity2

list (float[2])acc (a)

float

None

acceleration or
acceleration1, acceleration2

list (float[2])time (t)

float

None

Reach time [sec]• If the time is specified, values
are processed based on time,
ignoring vel and acc.

ref

int

None

reference coordinate• DR_BASE: base coordinate• DR_WORLD: world coordinate• DR_TOOL: tool coordinate• user coordinate: User defined

mod

int

DR_MV_MOD_ABS

Movement basis• DR_MV_MOD_ABS: Absolute• DR_MV_MOD_REL: Relative

app_type

int

DR_MV_APP_NONE

Application mode
• DR_MV_APP_NONE: No
application related• DR_MV_APP_WELD: Welding
application related

Note• Abbreviated parameter names are supported. (v:vel, a:acc, t:time)• Up to 50 arguments can be entered in posb_list.

- 115 -

Programming manual(V2.10)

Motion-related Commands• _global_velx is applied if vel is None. (The initial value of _global_velx is 0.0 and can be set by
set_velx.)• _global_accj is applied if acc is None. (The initial value of _global_accx is 0.0 and can be set by
set_accx.)• If an argument is inputted to vel (e.g., vel=30), the input argument corresponds to the linear
velocity of the motion while the angular velocity is determined proportionally to the linear
velocity.
• If an argument is inputted to acc (e.g., acc=60), the input argument corresponds to the linear
acceleration of the motion while the angular acceleration is determined proportionally to thelinear acceleration.
• If the time is specified, values are processed based on time, ignoring vel and acc.
• If the time is None, it is set to 0.
• _g_coord is applied if the ref is None. (The initial value of _g_coord is DR_BASE, and it can be
set by the set_ref_coord command.)• If the mod is DR_MV_MOD_REL, each pos in the pos_list is defined in the relative coordinate of
the previous pos.
• This function does not support online blending of previous and subsequent motions.
• If ‘app_type’ is ‘DR_MV_APP_WELD’, parameter ‘vel’ is internally replaced by the speed setting
entered in app_weld_set_weld_cond(), not the input value of ‘vel’.
Caution• A user input error is generated if the blending radius in posb is 0.
• A user input error is generated due to the duplicated input of Line if contiguous Line-Linesegments have the same direction.
• A user input error is generated to prevent a sudden acceleration if the blending condition
causes a rapid change in direction.
• This function does not support online blending of previous and subsequent motions.

ReturnValue

Description0

Success

Negative value

Error- 116 -

Programming manual(V2.10)

Motion-related Commands

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

#Example 1. D-Out 3 seconds after the motion through the path of seg11 seg16 begins# Init Pose @ Jx1
Jx1 = posj(45,0,90,0,90,45)# initial joint position
X0 = posx(370, 420, 650, 0, 180, 0)# initial task position# CASE#1) ABSOLUTE# Absolute Goal Poses
X1 = posx(370, 670, 650, 0, 180, 0)
X1a = posx(370, 670, 400, 0, 180, 0)
X1a2= posx(370, 545, 400, 0, 180, 0)
X1b = posx(370, 595, 400, 0, 180, 0)
X1b2= posx(370, 670, 400, 0, 180, 0)
X1c = posx(370, 420, 150, 0, 180, 0)
X1c2= posx(370, 545, 150, 0, 180, 0)
X1d = posx(370, 670, 275, 0, 180, 0)
X1d2= posx(370, 795, 150, 0, 180, 0)
seg11 = posb(DR_LINE, X1, radius=20)
seg12 = posb(DR_CIRCLE, X1a, X1a2, radius=20)
seg14 = posb(DR_LINE, X1b2, radius=20)
seg15 = posb(DR_CIRCLE, X1c, X1c2, radius=20)
seg16 = posb(DR_CIRCLE, X1d, X1d2, radius=20)
b_list1 = [seg11, seg12, seg14, seg15, seg16]# The blending radius of the last waypoint (seg16) is ignored.
movej(Jx1, vel=30, acc=60, mod=DR_MV_MOD_ABS)# Joint motion to the initial angle (Jx1)
movel(X0, vel=150, acc=250, ref=DR_BASE, mod=DR_MV_MOD_ABS)# Line motion to the initial position (X0)- 117 -

Programming manual(V2.10)

Motion-related Commands

29
30
31
32
33
34
35
36
37

amoveb(b_list1, vel=150, acc=250, ref=DR_BASE, mod=DR_MV_MOD_ABS)# Moves the robot from the current position through a trajectory
consisting of seg11(LINE), seg12(CIRCLE), seg14(LINE),# seg15(CIRCLE), and seg16(CIRCLE) with a constant velocity of 150(mm/sec) with the exception of accelerating and decelerating sections.
# (The final point is X1d2.)# Blending to the next segment begins when the distance of 20mm fromthe end point (X1, X1a2, X1b2, X1c2, and X1d2)# of each segment is reached.
wait(3)# Temporarily suspends the program
execution for 3 seconds (while the motion continues).
set_digital_output(1, 1)# D-Out (no. 1 channel) ON
mwait(0)# Temporarily suspends the program
execution until the motion is terminated.

Related commands• posb(seg_type, posx1, posx2=None, radius=0)(p. 34)• set_velx(vel1, vel2)(p. 44)• set_velx(vel)(p. 46)• set_accx(acc1, acc2)(p. 47)• set_accx(acc)(p. 49)• set_tcp(name)(p. 50)• set_ref_coord(coord)(p. 52)• mwait(time=0)(p. 125)
• moveb()(p. 81)

3.4.8 amove_spiral()Features
The asynchronous move_spiral motion operates in the same way as move_spiral() except for the asynchronous
processing and executes the next line after the command is executed.
Generating a new command for the motion before the amove_spiral() motion results in an error for safety
reasons. Therefore, the termination of the amove_spiral() motion must be confirmed using mwait() orcheck_motion() between amove_spiral() and the following motion command.
Motion along a spiral trajectory on a plane which is perpendicular to the input 'axis' is performed on thespecified coordinate system 'ref'. Additional input, travel distance 'lmax' can cause the robot to move around acone, starting from the apex of itNote• move_spiral: The next command is executed after the robot starts from the current position
and reaches (stops at) the end point of the spiral trajectory.

- 118 -

Programming manual(V2.10)

Motion-related Commands• amove_spiral: The next command is executed after the robot starts from the current position
and regardless of whether it reaches (stops at) the end point of the spiral trajectory.

Parameters
Parameter Name

Data TypeDefault Value

Range

Description

rev

float

10

rev > 0Total number of revolutions

rmax

float

10

rmax > 0

Final spiral radius [mm]

lmax

float

0

Distance moved in the axis
direction [mm]vel (v)

float

None

velocityacc (a)

float

None

acceleration

time (t)

float

None

time ≥ 0

Total execution time <sec>

axis

int

DR_AXIS_Z-

axis• DR_AXIS_X: x-axis• DR_AXIS_Y: y-axis• DR_AXIS_Z: z-axis

ref

Int

DR_TOOL-

reference coordinate• DR_BASE : basecoordinate• DR_WORLD : world
coordinate• DR_TOOL : tool
coordinate• user coordinate :user defined

Note• Abbreviated parameter names are supported. (v:vel, a:acc, t:time)• rev refers to the total number of revolutions of the spiral motion.
• Rmax refers to the maximum radius of the spiral motion.
• Lmax refers to the parallel distance in the axis direction during the motion. A negative valuemeans the parallel distance in the –axis direction.
• Vel refers to the moving velocity of the spiral motion.

- 119 -

Programming manual(V2.10)

Motion-related Commands• The first value of _global_velx (parallel velocity) is applied if vel is None. (The initial value of_global_velx is 0.0 and can be set by set_velx.)• Acc refers to the moving acceleration of the spiral motion.
• The first value of _global_accx (parallel acceleration) is applied if acc is None. (The initial valueof _global_accx is 0.0 and can be set by set_accx.)• If the time is specified, values are processed based on time, ignoring vel and acc.
• If the time is None, it is set to 0.
• The axis defines the axis that is perpendicular to the surface defined by the spiral motion.
• Ref refers to the reference coordinate system defined by the spiral motion.
• This function does not support online blending of previous and subsequent motions.
Caution• An error can be generated to ensure safe motion if the rotating acceleration calculated by thespiral path is too great.
In this case, reduce the vel, acc, or time value.

ReturnValue

Description0

Success

Negative value

Error

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully- 120 -

Programming manual(V2.10)

Motion-related Commands

Example
1
2

3
4
5
6
7
8
9
10
11
12

## hole search# (A motion that completes 9.5 revolutions (rev) to the 30 mm radius(rmax) from 0 on the Tool-X/Y surface as the center of the rotation in the
Tool-Z direction# and the spiral trajectory that moves 50 mm (lmax) in the Tool-Z
direction at the same time in 20 seconds# from the initial position.
# D-Out (no. 1 channel) 3 seconds after the motion begins.)
J00 = posj(0,0,90,0,60,0)
movel(J00, vel=30, acc=30)# Joint moves to the beginning pose
amove_spiral(rev=9.5,rmax=50.0,lmax=50.0,time=10.0,axis=DR_AXIS_Z,ref=
DR_TOOL)wait(3)
set_digital_output(1, 1)# D-Out (no. 1 channel) ON
mwait(0)# Waits until the motion stops.

Related commands• set_velx(vel1, vel2)(p. 44)• set_velx(vel)(p. 46)• set_accx(acc1, acc2)(p. 47)• set_accx(acc)(p. 49)• set_tcp(name)(p. 50)- 121 -

Programming manual(V2.10)

Motion-related Commands• set_ref_coord(coord)(p. 52)• mwait(time=0)(p. 125)
• move_spiral()(p. 85)

3.4.9 amove_periodic()
Features
The asynchronous move_periodic motion operates in the same way as move_periodic() except for the
asynchronous processing and executes the next line after the command is executed.
Generating a new command for the motion before the amove_periodic() motion results in an error for safety
reasons. Therefore, the termination of the amove_periodic() motion must be confirmed using mwait() orcheck_motion() between amove_periodic() and the following motion command.
This command performs a cyclic motion based on the sine function of each axis (parallel and rotation) of thereference coordinate (ref) input as a relative motion that begins at the current position. The attributes of the
motion on each axis are determined by amp (amplitude) and period, and the acceleration/deceleration time
and the total motion time are set by the interval and repetition count.

Note• move_ periodic: Starting from the current position, reaching the end of the periodic trajectory,
stopping, and then executing the following command• amove_ periodic: Executes the next command immediately regardless of whether the end of
the periodic trajectory is reached from the current position

Parameters
Parameter Name

Data TypeDefault Value

Range

Description

amp

list (float[6])

-

0≤amp

Amplitude (motion between-amp and +amp) [mm] or[deg]periodfloat or0≤period

Period (time for 1 cycle) [sec]list (float[6])
atime

float

0.0

0≤atimeAcc-, dec- time [sec]repeatint

1>0

Repetition count- 122 -

Programming manual(V2.10)

Motion-related Commands

Parameter Name

Data TypeDefault Value

Range

Description

ref

int

DR_TOOL-

reference coordinate• DR_BASE : basecoordinate• DR_WORLD : world
coordinate• DR_TOOL : tool
coordinate• user coordinate : user
definedNote• Amp refers to the amplitude. The input is a list of 6 elements which are the amp values for theaxes (x, y, z, rx, ry, and rz). The amp input on the axis that does not have a motion must be 0.
• Period refers to the time needed to complete a motion in the direction, the amplitude. The
input is a list of 6 elements which are the periods for the axes (x, y, z, rx, ry, and rz).
• Atime refers to the acceleration and deceleration time at the beginning and end of the periodic
motion. The largest of the inputted acceleration/deceleration times and maximum period*1/4
is applied. An error is generated when the inputted acceleration/deceleration time exceeds 1/2of the total motion time.
• Repeat refers to the number of repetitions of the axis (reference axis) that has the largest period
value and determines the total motion time. The number of repetitions for each of theremaining axes is determined automatically according to the motion time.
• If the motion terminates normally, the motions for the remaining axes can be terminatedbefore the reference axis's motion terminates so that the end position matches the starting
position. The deceleration section will deviate from the previous path if the motions of all axes

- 123 -

Programming manual(V2.10)

Motion-related Commands

are not terminated at the same time. Refer to the following image for more information.

• Ref refers to the reference coordinate system of the repeated motion.
• If a maximum velocity error is generated during a motion, adjust the amplification and periodusing the following formula.
Max. velocity = Amplification(amp)*2*pi(3.14)/Period(period) (i.e., Max.
velocity=62.83mm/sec if amp=10mm and period=1 sec)
• This function does not support online blending of previous and subsequent motions.

ReturnValue

Success0

Success

Negative value

Error

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred- 124 -

Programming manual(V2.10)

Motion-related Commands

Exception

Description

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6
7
8
9

P0 = posj(0,0,90,0,90,0)
movej(P0)amove_periodic(amp =[10,0,0,0,0.5,0], period=1, atime=0.5, repeat=5, ref=D
R_TOOL)wait(1)
set_digital_output(1, 1)
mwait(0)# Repeats the x-axis (10mm amp and 1 sec. period) motion and y rotating
axis (0.5deg amp and 1 sec. period) motion in the tool coordinate system# 5 times.
# SET(1) the Digital_Output channel no. 1, 1 second after the periodic
motion begins.

Related commands• set_ref_coord(coord)(p. 52)• move_periodic()(p. 89)

3.5 Additional Functions
3.5.1 mwait(time=0)
FeaturesThis function sets the waiting time between the previous motion command and the motion command in thenext line. The waiting time differs according to the time[sec] input.

- 125 -

Programming manual(V2.10)

Motion-related Commands

Parameters
Parameter Name

Data TypeDefault
Value

Description

time

float

0

Waiting time after the motion ends [sec]ReturnValue

Description0

Success

Negative value

Error

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6

#Example 1. The robot moves to q1 and stops the motion 3 seconds after it
begins the motion at q0 and then moves to q99
q0 = posj(0, 0, 90, 0, 90, 0)
amovej (q0, vel=10, acc=20)# Moves to q0 and performs the next
command immediately afterwait(3)# Temporarily suspends the program
execution for 3 seconds (while the motion continues).
q1 = posj(0, 0, 0, 0, 90, 0)
amovej (q1, vel=10, acc=20)- 126 -

Programming manual(V2.10)

Motion-related Commands

7
8
9
10
11

# Maintains the q0 motion (DUPLICATE blending if the ra argument isomitted) and iterates to q1.
# Performs the next command immediately after the blending motion.
mwait(0)# Temporarily suspends the program
execution until the motion is terminated.
q99 = posj(0, 0, 0, 0, 0, 0)
movej (q99, vel=10, acc=20)# Joint motion to q99.

Related commands• wait(time)(p. 281)
• amovej()(p. 95)• amovel()(p. 98)• amovejx()(p. 101)
• amovec()(p. 104)
• amovesj()(p. 108)
• amovesx()(p. 111)
• amoveb()(p. 114)
• amove_spiral()(p. 118)
• amove_periodic()(p. 122)

3.5.2 begin_blend(radius=0)
FeaturesThis function begins the blending section. The sync motion commands (movej, movel, movec, movejx) withblending section radius execute blending using the radius set as the default argument. There is no actual
blending effect if the radius is 0. Moreover, if a blending radius that is different from the set radius is needed, theblending radius can be changed as an exception by specifying the blending radius to the motion argument.

Parameter
Parameter Name

Data TypeDefault
Value

Description

radiusfloat

0Radius for blending

ReturnValue

Description0

Success- 127 -

Programming manual(V2.10)

Motion-related Commands

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

#1
begin_blend(radius=30)# The motion commands with the following radius option sets
# the blending section to 30mm.
Q1 = posj(0,0,90,0,90,0)Q2 = posj(0,0,0,0,90,0)
movej(Q1, vel=10, acc=20)# Moves to the Q1 joint angle and is set to execute the next motion# when the global distance from the Q1 space position is 30mm.
movej(Q2, time=5)# Moves to the Q2 joint angle after the blend while maintaining thelast motion (motion iteration).
# It is set to execute the next motion# when the global distance from the Q2 space position is 30mm.
movej(Q1, v=30, a=60, r=200)# Moves to the Q1 joint angle after the blending while maintaining thelast motion (motion iteration).
# It is set to execute the next motion# when the distance from the Q1 space position is 200mm (the global
setting is not applied).
movej(Q2, v=30, a=60, ra= DR_MV_RA_OVERRIDE)# Immediately terminates the last motion and blends it to move to theQ2 joint angle.
end_blend()# Ends the batch setting of the blending sections.

Related commands• end_blend()(p. 129)• movej()(p. 54)• movel()(p. 59)• movejx()(p. 64)• movec()(p. 68)- 128 -

Programming manual(V2.10)

Motion-related Commands

3.5.3 end_blend()
FeaturesThis function ends the blending section. It means that the validity of the blending section that began with
begin_blend() ends.

ReturnValue

Description0

Success

Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

#1
begin_blend(radius=30)# The motion commands that have the following radius option set theblending section to 30mm.
Q1 = posj(0,0,90,0,90,0)Q2 = posj(0,0,0,0,90,0)
movej(Q1, vel=10, acc=20)# Moves to the Q1 joint angle and is set to execute the next motion# when the global distance from the Q1 space position is 30mm.
movej(Q2, time=5)# Immediately terminates the last motion and blends it to move to theQ2 joint angle (motion iteration).
# It is set to execute the next motion# when the global distance from the Q2 space position is 30mm.
movej(Q1, v=30, a=60, r=200)# Immediately terminates the last motion and blends it to move to theQ1 joint angle (motion iteration).
# It is set to execute the next motion# when the distance from the Q1 space position is 200mm (the global
setting is not applied).
movej(Q2, v=30, a=60, ra= DR_MV_RA_OVERRIDE)# Immediately terminates the last motion and blends it to move to theQ2 joint angle.
end_blend()# Ends the batch setting of the blending sections.

Related commands• begin_blend(radius=0)(p. 127)• movej()(p. 54)• movel()(p. 59)- 129 -

Programming manual(V2.10)

Motion-related Commands• movejx()(p. 64)• movec()(p. 68)

3.5.4 check_motion()
FeaturesThis function checks the status of the currently active motion.

Return (TBD)
Value

Description

0

DR_STATE_IDLE (no motion in action)

1

DR_STATE_INIT (motion being calculated)

2

DR_STATE_BUSY (motion in operation)

Exception
Exception

Description

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6
7
8
9
10

#1. The next motion (q99) is executed when an asynchronous motion to q0
begins decelerating
q0 = posj(0, 0, 90, 0, 90, 0)
q99 = posj(0, 0, 0, 0, 0, 0)
amovej (q0, vel=10, acc=20)# Executes the next command
immediately after the motion to q0.
while True:
if check_motion()==0:# A motion is completed.
amovej (q99, vel=10, acc=20)# Joint motion to q99.
break
if check_motion()==2:# In motionpass- 130 -

Programming manual(V2.10)

Motion-related Commands

11

mwait(0)# Temporarily suspends the program
execution until the motion is terminated.

Related commands• movej()(p. 54)• movel()(p. 59)• movejx()(p. 64)• movec()(p. 68)• movesj()(p. 74)• movesx()(p. 77)• moveb()(p. 81)• move_spiral()(p. 85)• move_periodic()(p. 89)• amovej()(p. 95)• amovel()(p. 98)• amovejx()(p. 101)
• amovec()(p. 104)
• amovesj()(p. 108)
• amovesx()(p. 111)
• amoveb()(p. 114)
• amove_spiral()(p. 118)
• amove_periodic()(p. 122)

3.5.5 stop(st_mode)
FeaturesThis function stops the currently active motion. stop time is determined by the ‘st_mode’ and robot position
does not deviate from the in-progress path.
This command is only used to stop the robot from operating and will not cause stop the program. To stop a
program from running, use additionally exit() function. Values DR_QSTOP_STO and DR_QSTOP respond to Stop
Category 1 (torque off after maximum deceleration) and 2 (maximum deceleration), but they are not linked withmotions, such as torque off, after stopping. DR_SSTOP deceleration time is about 1.5 times longer that the
maximum deceleration time. In the case of DR_HOLD, stop immediately with no deceleration time.

- 131 -

Programming manual(V2.10)

Motion-related Commands

Parameter
Parameter Name

Data TypeDefault
Value

Description

st_modeint-

stop mode• DR_QSTOP_STO: Quick stop (Stop Category 1
without STO(Safe Torque Off)• DR_QSTOP: Quick stop (Stop Category 2)• DR_SSTOP: Soft Stop
• DR_HOLD: HOLE stop

ReturnValue

Description0

Success

Negative value

Error

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example1
2
3
4#1. The motion is terminated with a soft stop 2 seconds after moving to x1
p0 = posj(-148,-33,-54,180,92,32)
movej(p0, v=30, a=30)
x1 = posx(784, 543, 570, 0, 180, 0)- 132 -

Programming manual(V2.10)

Motion-related Commands

5
6
7

amovel (x1, vel=100, acc=200)
after the motion with x1.
wait(2)
seconds.
stop(DR_SSTOP)# Executes the next command immediately# Temporarily suspends the program for 2# Stops the motion with a soft stop.

Related commands• movej()(p. 54)• movel()(p. 59)• movejx()(p. 64)• movec()(p. 68)• movesj()(p. 74)• movesx()(p. 77)• moveb()(p. 81)• move_spiral()(p. 85)• move_periodic()(p. 89)• amovej()(p. 95)• amovel()(p. 98)• amovejx()(p. 101)
• amovec()(p. 104)
• amovesj()(p. 108)
• amovesx()(p. 111)
• amoveb()(p. 114)
• amove_spiral()(p. 118)
• amove_periodic()(p. 122)

3.5.6 change_operation_speed(speed)
FeaturesThis function adjusts the operation velocity. The argument is the relative velocity in a percentage of thecurrently set velocity and has a value from 1 to 100. Therefore, a value of 50 means that the velocity is reduced
to 50% of the currently set velocity.

Parameter
Parameter Name

Data TypeDefault
Value

Description

speed

int

-

operation speed(10~100)- 133 -

Programming manual(V2.10)

Motion-related Commands

ReturnValue

Description0

Success

Negative value

Error

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6
7
8
9
10

change_operation_speed(10)change_operation_speed(100)#1. Motion with velocity specified to q0 and 20% of the specified velocity
q0 = posj(0, 0, 90, 0, 90, 0)
movej (q0, vel=10, acc=20)# Moves to q0 at a velocity of 10mm/sec
change_operation_velocity(10)# The velocities of all following
motions executed are 10% of the specified velocity.
q1 = posj(0, 0, 0, 0, 90, 0)
movej (q1, vel=10, acc=20)# Moves to q1 at a velocity of 10% of
10mm/sec.
change_operation_speed(100)# The velocities of all following motions
executed are 100% of the specified velocity.
movej (q0, vel=10, acc=20)# Moves to q0 at a velocity 100% of 10mm/sec- 134 -

Programming manual(V2.10)

Motion-related Commands

Related commands• movej()(p. 54)• movel()(p. 59)• movejx()(p. 64)• movec()(p. 68)• movesj()(p. 74)• movesx()(p. 77)• moveb()(p. 81)• move_spiral()(p. 85)• move_periodic()(p. 89)• amovej()(p. 95)• amovel()(p. 98)• amovejx()(p. 101)
• amovec()(p. 104)
• amovesj()(p. 108)
• amovesx()(p. 111)
• amoveb()(p. 114)
• amove_spiral()(p. 118)
• amove_periodic()(p. 122)

3.5.7 wait_manual_guide()FeaturesThis function enables the user to perform hand guiding (changing the position of the robot by pressing the
Direct Teach button in the cockpit or the TP) during the execution of the program. The user executes the next
command in one of the following two ways after hand guiding is completed (unless the program is terminated,
it will wait at the command until one of the following is executed after the user performs hand guiding).
1. The user presses the "OK" or "Finish" button on the "Hand Guiding Execution" popup window generated
from the TP.
2. A signal is applied to the digital input channel specified for "Manual guide release" in the safety I/Osettings.
The current TCP position and the TCP position of the hand guided robot must be in the collaborative workspacein order to execute this command properly. Run the command after specifying the hand guiding area as thecollaborative workspace and enabling it. An error is generated, and the program is terminated to ensure worker
safety if the current position or hand guiding deviates from the collaborative workspace.

- 135 -

Programming manual(V2.10)

Motion-related Commands

ReturnValue

Description0

Success

Negative value

Error

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6
7
8
9
10
11
12

# Sets up the collaborative workspace before executing the program.
# Surface 1: Point-1(1000,1000), Point-2(0,0)# Surface 2: Point-1(1000,-1000), Point-2(0,0)# Activation of domain 1 - Point(1000,0)
j00 = posj(0,0,90,0,90,0)
movej(j00,vel=20,acc=40) # Enters the collaborative workspace.
wait_manual_guide()# Direct teaching until the "Finish" button on
the popup window generated by the TP is pressed.
pos1 = get_current_posx() # Stores the directly taught point in pos1.
dposa = posx(0,0,-100,0,0,0)
movel(dposa, vel=300, acc=600, ref=DR_TOOL)# Retract 100 mm in the tool-Z direction from the taught position.

Related commands• movej()(p. 54)- 136 -

Programming manual(V2.10)

Motion-related Commands• movel()(p. 59)• movejx()(p. 64)• movec()(p. 68)• movesj()(p. 74)• movesx()(p. 77)• moveb()(p. 81)• move_spiral()(p. 85)• move_periodic()(p. 89)• amovej()(p. 95)• amovel()(p. 98)• amovejx()(p. 101)
• amovec()(p. 104)
• amovesj()(p. 108)
• amovesx()(p. 111)
• amoveb()(p. 114)
• amove_spiral()(p. 118)
• amove_periodic()(p. 122)

3.5.8 wait_nudge()
FeaturesThis function enables users to resume the execution of the program through the user’s nudge input (applying
external force to the robot) when the execution of the program is paused. When the external force greater than
the force threshold, it will proceed to the following command after the resume time, where the force threshold
and the resume time are set at the collaborative workspace setting menu. This command can be used as aninterlock during the program.
However, if the robot’s configuration is in the singularity area, or if the force is applied continuously after thenudge input, warning will be occurred for safety.
For this function is allowed to execute within the collaborative workspace, please set the collaborative
workspace, activate it, and assure the TCP position is in this workspace when this command is performed inadvance.

ReturnValue

Description0

Success

Negative value

Error- 137 -

Programming manual(V2.10)

Motion-related Commands

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6
7
8
9
10
11

# Sets up the collaborative workspace before executing the program.
# Surface 1: Point-1(1000,1000), Point-2(0,0)# Surface 2: Point-1(1000,-1000), Point-2(0,0)# Activation of domain 1 - Point(1000,0)
j00 = posj(0,0,90,0,90,0)
movej(j00,vel=20,acc=40) # Enters the collaborative workspace.
wait_nudge()# Wait for applying external force exceeding thethreshold to the robot
dposa = posx(0,0,-100,0,0,0)
movel(dposa, vel=300, acc=600, ref=DR_TOOL)# Retract 100 mm in the tool-Z direction from the taught position

Related commands• movej()(p. 54)• movel()(p. 59)• movejx()(p. 64)• movec()(p. 68)• movesj()(p. 74)• movesx()(p. 77)• moveb()(p. 81)• move_spiral()(p. 85)• move_periodic()(p. 89)• amovej()(p. 95)- 138 -

Programming manual(V2.10)

Motion-related Commands• amovel()(p. 98)• amovejx()(p. 101)
• amovec()(p. 104)
• amovesj()(p. 108)
• amovesx()(p. 111)
• amoveb()(p. 114)
• amove_spiral()(p. 118)
• amove_periodic()(p. 122)

3.5.9 enable_alter_motion(n,mode,ref,limit_dPOS,limit_dPOS_per)
Featuresenable_alter_motion() and alter_motion() functions enable to alter motion trajectory.
This function sets the configurations for altering function and allows the input quantity of alter_motion() to be
applied to motion trajectory. The unit cycle time of generating alter motion is 100msec. Cycle time(n*100msec)
can be changed through input parameter n. This function provide 2 modes(Accumulation mode, Incrementmode). Input quantity of alter_motion() can be applied to motion trajectory in two ways as accumulated value
or increment value. In accumulation mode, the input quantity means absolute altering
amount(dX,dY,dZ,dRX,dRY,dRZ) from current motion trajectory. On the contrary in increment mode, thequantity means increment value from the previous absolute altering amount. The reference coordinate can bechanged through input parameter ref. Limitations of accumulation amout and increment amount can be set
through input paramet limit_dPOS (accumulated limit) and limit_dPOS_per(increment input limit during 1
cycle). The actual alter amount is limited to these limits.

Parameters
Parameter Name

Data TypeDefault
Value

Description

n

int

None

Cycle time number

mode

Int

None

Mode
• DR_DPOS : accumulation amount• DR_DVEL : increment amount

ref

int

None

reference coordinate• DR_BASE: base coordinate• DR_WORLD: world coordinate• DR_TOOL: tool coordinate• user coordinate: user defined- 139 -

Programming manual(V2.10)

Motion-related Commands

Parameter Name

Data TypeDefault
Value

Description

limit_dPOS

list(float[2])NoneFirst value : limitation of position[mm]Second value : limitation of orientation[deg]limit_dPOS_perlist(float[2])None

Fist value : limitation of position[mm]Second value : limitation of orientation[deg]Note• _global_ref is applied if ref is None
• Accumulation amount or increment amout isn’t be limited if limit_dPOS or limit_dPOS_per isNone.
• alter_motion() can be executed only in user thread.

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6
7
8
9

def alter_thread():alter_motion(dX) #dX : amount of alter motion
dX = [10,0,0,10,0,0]
J00 = posj(0,0,90,0,90)
X1 = posx(559.0, 200, 651.5, 180, -180.0, 180)
X2 = posx(559.0, 200, 400, 180, -180.0, 180)

- 140 -

Programming manual(V2.10)

Motion-related Commands

10
11
12
13
14
15
16
17
18
19
20
21
22
23

movej(J00,vel=50,acc=100)
enable_alter_motion(n=10,mode=DR_DPOS, ref=DR_BASE, limit_dPOS=[50,90],
limit_dPOS_per=[50,50])# cycle time:(5*100)msec, mode:accumulate, reference coordination:basecoordination# Lmitation of accumulation amount :50mm,50deg# Limitation of increment amount :10mm, 10deg
th_id = thread_run(alter_thread, loop=True)
movel(X1,v=50,a=100,r=30)
movel(X2,v=50,a=100)
thread_stop(th_id)
disable_alter_motion() # deactivates alter motion

Related commands• alter_motion(pos)(p. 141)
• disable_alter_motion()(p. 143)

3.5.10 alter_motion(pos)FeaturesThis function applies altering amount of motion trajectory when the alter function is activated. The meaning of
the input values is defined in the description of enable_alter_motion().
Caution• alter_motion() can be executed only in user thread.
Note• alter_motion() can be executed only in user thread.
• Alter motion can be adjusted through setting value limit_dPOS or limit_dPOS_per inenable_alter_motion function.
• Orientation of Input pose follows fixed XYZ notation.

- 141 -

Programming manual(V2.10)

Motion-related Commands

Parameters
Parameter Name

Data TypeDefault
Value

Description

pos

list
(float[6])-position list

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

def alter_thread():alter_motion(dX) #dX : amount of alter motion
dX = [10,0,0,10,0,0]
J00 = posj(0,0,90,0,90)
X1 = posx(559.0, 200, 651.5, 180, -180.0, 180)
X2 = posx(559.0, 200, 400, 180, -180.0, 180)
movej(J00,vel=50,acc=100)
enable_alter_motion(n=5,mode=DR_DPOS, ref=DR_BASE, limit_dPOS=[50,90],
limit_dPOS_per=[10,10])# cycle time:(5*100)msec, mode:accumulate, reference coordination:basecoordination# Lmitation of accumulation amount :50mm,90deg# Limitation of increment amount :10mm, 10deg
th_id = thread_run(alter_thread, loop=True)- 142 -

Programming manual(V2.10)

Motion-related Commands

18
19
20
21
22
23

movel(X1,v=50,a=100,r=30)
movel(X2,v=50,a=100)
thread_stop(th_id)
disable_alter_motion() # deactivates alter motion

Related commands• enable_alter_motion(n,mode,ref,limit_dPOS,limit_dPOS_per)(p. 139)
• disable_alter_motion()(p. 143)

3.5.11 disable_alter_motion()
FeaturesThis function deactivates alter motion.

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6
7
8

def alter_thread():alter_motion(dX) #dX : amount of alter motion
dX = [10,0,0,10,0,0]
J00 = posj(0,0,90,0,90)
X1 = posx(559.0, 200, 651.5, 180, -180.0, 180)
X2 = posx(559.0, 200, 400, 180, -180.0, 180)

- 143 -

Programming manual(V2.10)

Motion-related Commands

9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

movej(J00,vel=50,acc=100)
enable_alter_motion(n=10,mode=DR_DPOS, ref=DR_BASE, limit_dPOS=[50,90],
limit_dPOS_per=[50,50])# cycle time:(5*100)msec, mode:accumulate, reference coordination:basecoordination# Lmitation of accumulation amount :50mm,50deg# Limitation of increment amount :10mm, 10deg
th_id = thread_run(alter_thread, loop=True)
movel(X1,v=50,a=100,r=30)
movel(X2,v=50,a=100)
thread_stop(th_id)
disable_alter_motion() # deactivates alter motion

Related commands• enable_alter_motion(n,mode,ref,limit_dPOS,limit_dPOS_per)(p. 139)
• alter_motion(pos)(p. 141)

3.5.12 check_robot_mastering()
FeaturesChecks whether the current robot is in a state that requires mastering or not.
Robot states that require mastering
When the controller power is forcibly turned off in Servo On state
When Servo On again after STO error occurs

Parameters
None

ReturnValue

Description

0

mastering completed

1

mastering need

- 144 -

Programming manual(V2.10)

Motion-related Commands

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example123

ret = check_robot_mastering()
if ret == 1:
move_home()

Related commands• move_home()28

3.6 Servo Motion
3.6.1 servoj()
Features
The command is the asynchronous motion command, and the next command is executed at the same time themotion begins. That motion follows the most recent target joint position that is continuously delivered, withinmaximum velocity, acceleration.

28 https://manual.doosanrobotics.com/display/Programming/.move_home%28%29+v2.8_rework- 145 -

Programming manual(V2.10)

Motion-related Commands

Parameters
Parameter Name

Data TypeDefault Value

Description

pos

posj

-

posj orjoint angle list

list (float[6])vel (v)

float

None

maximum velocity (to an axis) [deg/s]list (float[6])acc (a)

float

None

maximum acceleration (same to allaxes) ormaximum acceleration(acceleration to an axis) [deg/s2]

list (float[6])time (t)maximum velocity (same to all axes)
or

float

None

reach time [sec]Note• Abbreviated parameter names are supported. (v:vel, a:acc, t:time)• _global_velj is applied if vel is None. (The initial value of _global_velj is 0.0 and can be set by
set_velj.)• _global_accj is applied if acc is None. (The initial value of _global_accj is 0.0 and can be set by
set_accj.)• After time is set, If reach time can’t be keep because of condition of maximum velocity andacceleration, the reach time is adjusted automatically and notice through information
message.
Caution• Currently, it is not linked with the speed control function of the speed slide bar.
• Currently, it is not linked with check_motion(), change_operation_speed() functions.

ReturnValue

Description0

Success- 146 -

Programming manual(V2.10)

Motion-related Commands

Value

Description

Negative value

Error

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

set_velj(30)set_accj(60)
Xt=posj(0, 0, 0, 0, 0, 0)
servoj(Xt)
Xt=posj(0, 0, 0, 0, 0, 0)
target = posx(90, 0, 120, -50, 50, -90)
del_t = [3, 0.1, 3, -3, 3, -3]
while 1:for i in range(0,6):
Xt[i] = Xt[i] + del_t[i]if del_t[i] > 0:
if Xt[i] > target[i]:Xt[i] = target[i]else:if Xt[i] < target[i]:Xt[i] = target[i]servoj(Xt)

Related commands• posj(J1=0, J2=0, J3=0, J4=0, J5=0, J6=0)(p. 29)• set_velj(vel)(p. 41)- 147 -

Programming manual(V2.10)

Motion-related Commands• set_accj(acc)(p. 43)• mwait(time=0)(p. 125)

3.6.2 servol()Features
The command is the asynchronous motion command, and the next command is executed at the same time themotion begins. That motion follows the most recent target task position that is continuously delivered, withinmaximum velocity, acceleration.

Parameters
Parameter Name

Data TypeDefault Value

Description

pos

posx

-

posx orposition list

list (float[6])vel (v)

float

None

maximum velocity[mm/s] or
maximum velocity[mm/s], maximum velocity[deg/s]

list (float[2])acc (a)

float

None

maximum acceleration[mm/s2], maximum
acceleration[deg/s2]

list (float[2])time (t)floatmaximum acceleration[mm/s2] orNonereach time [sec]Note• Abbreviated parameter names are supported. (v:vel, a:acc, t:time)• _global_velx is applied if vel is None. (The initial value of _global_velx is 0.0 and can be set by
set_velj.)• _global_accx is applied if acc is None. (The initial value of _global_accx is 0.0 and can be set by
set_accj.)• After time is set, If reach time can’t be keep because of condition of maximum velocity andacceleration, the reach time is adjusted automatically and notice through information
message.

- 148 -

Programming manual(V2.10)

Motion-related Commands

Caution• Currently, it is not linked with the speed control function of the speed slide bar.
• Currently, it is not linked with the DR_VAR_VEL option among the singularity options. When set
with the DR_VAR_VEL option, it is automatically changed to DR_AVOID option and noticethrough information message.
• Currently, it is not linked with the force/compliance control function.
• Currently, it is not linked with check_motion(), change_operation_speed() functions.

ReturnValue

Description0

Success

Negative value

Error

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6
7
8
9
10
11
12

set_velj(30)set_accj(60)set_velx(50)set_accx(100)movej(posj(0,0,90,0,90,0))
Xt=posx(368, 34.5, 442.5, 50.26, -180, 50.26)
servol(Xt,v=[100, 100], a=[200,300])
Xt=posx(368, 34.5, 442.5, 50.26, -180, 50.26)
target =posx(368, 34.5, 200, 50.26, -180, 50.26)- 149 -

Programming manual(V2.10)

Motion-related Commands

13
14
15
16
17
18
19
20
21
22
23
24
25

del_t = [0, 0, -3, 0, 3, 0]
while 1:for i in range(0,6):
Xt[i] = Xt[i] + del_t[i]if del_t[i] > 0:
if Xt[i] > target[i]:Xt[i] = target[i]else:if Xt[i] < target[i]:Xt[i] = target[i]servol(Xt,v=[100, 100], a=[200,300])

Related commands• posx(X=0, Y=0, Z=0, A=0, B=0, C=0)(p. 30)• set_velx(vel1, vel2)(p. 44)• set_accx(acc1, acc2)(p. 47)• mwait(time=0)(p. 125)

3.6.3 speedj()
Features
The command is the asynchronous motion command, and the next command is executed at the same time themotion begins. That motion follows the most recent target joint velocity that is continuously delivered, withinmaximum acceleration.

Parameters
Parameter Name

Data TypeDefault Value

Descriptionvellist (float[6])-target joint velocity [deg/s]

acc (a)

float

None

maximum acceleration (same to all axes) or
maximum acceleration (acceleration to an axis) [deg/s2]

list (float[6])time (t)

float

None

reach time [sec]Note• Abbreviated parameter names are supported. (a:acc, t:time)- 150 -

Programming manual(V2.10)

Motion-related Commands• _global_accj is applied if acc is None. (The initial value of _global_accj is 0.0 and can be set by
set_accj.)• After time is set, If reach time can’t be keep because of condition of maximum and acceleration,
the reach time is adjusted automatically and notice through information message.
• If you want to stop normally during movement, input vel as [0,0,0,0,0,0] or use the stop
command.
• For safety, if a new speedj command is not transmitted for 0.1 [sec] during movement, an error
message is displayed and it stops.
Caution• Currently, it is not linked with the speed control function of the speed slide bar.
• Currently, it is not linked with check_motion(), change_operation_speed() functions.

ReturnValue

Description0

Success

Negative value

Error

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6
7

movej(posj(0,0,90,0,90,0), v=30, a=60)
v1 = 30
go_plus = True
while True:q = get_desired_posj()
if go_plus:- 151 -

Programming manual(V2.10)

Motion-related Commands

8
9
10
11
12
13
14

speedj([v1, 5, 5, 5, 5, 5], a=60)
if q[0] > 90:
go_plus = False
else:
speedj([-v1, -5, -5, -5, -5, -5], a=60)
if q[0] < -90:
go_plus = True

Related commands• posj(J1=0, J2=0, J3=0, J4=0, J5=0, J6=0)(p. 29)• set_velj(vel)(p. 41)• set_accj(acc)(p. 43)• mwait(time=0)(p. 125)
• stop(st_mode)(p. 131)

3.6.4 speedl()
Features
The command is the asynchronous motion command, and the next command is executed at the same time themotion begins. That motion follows the most recent target task velocity that is continuously delivered, withinmaximum acceleration.

Parameters
Parameter Name

Data TypeDefault Value

Descriptionvellist (float[6])-target joint velocity [deg/s]

acc (a)

float

None

maximum acceleration (same to all axes) or
maximum acceleration (acceleration to an axis) [deg/s2]

list (float[6])time (t)

float

None

reach time [sec]Note• Abbreviated parameter names are supported. (a:acc, t:time)• _global_accx is applied if acc is None. (The initial value of _global_accx is 0.0 and can be set by
set_accj.)- 152 -

Programming manual(V2.10)

Motion-related Commands• After time is set, If reach time can’t be keep because of condition of maximum and acceleration,
the reach time is adjusted automatically and notice through information message.
• If you want to stop normally during movement, input vel as [0,0,0,0,0,0] or use the stop
command.
• For safety, if a new speedj command is not transmitted for 0.1 [sec] during movement, an error
message is displayed and it stops.
Caution• Currently, it is not linked with the speed control function of the speed slide bar.
• Currently, it is not linked with the DR_VAR_VEL option among the singularity options. When set
with the DR_VAR_VEL option, it is automatically changed to DR_AVOID option and noticethrough information message.
• Currently, it is not linked with the force/compliance control function.
• Currently, it is not linked with check_motion(), change_operation_speed() functions.

ReturnValue

Description0

Success

Negative value

Error

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Example1
2
3
4

movej(posj(0,0,90,0,90,0), v=30, a=60)
x = get_desired_posx()
v_y = 250

- 153 -

Programming manual(V2.10)

Motion-related Commands

5
6
7
8
9
10
11
12
13
14
15
16
17
18

v = 5
at_max = 500
ar_max = 60
go_plus = True
while True:
xd = get_desired_posx()
if go_plus:
speedl([v, v_y, v, 30, 0, 30], [at_max, ar_max])
if xd[1] > x[1] + 200:
go_plus = False
else:
speedl([-v, -v_y, -v, -30, -0, -30], [at_max, ar_max])
if xd[1] < x[1] - 200:
go_plus = True

Related commands• posx(X=0, Y=0, Z=0, A=0, B=0, C=0)(p. 30)• set_velx(vel)(p. 46)• set_accx(acc)(p. 49)• mwait(time=0)(p. 125)
• stop(st_mode)(p. 131)

- 154 -

Programming manual(V2.10)

Auxiliary Control Commands

4 Auxiliary Control Commands
4.1 Robot Current Value
4.1.1 get_current_posj()
FeaturesThis function returns the current joint angle.

ReturnValue

Description

posj

Joint angle

Exception
Exception

Description

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

Example1

q1 = get_current_posj()

Related commands• get_desired_posj()(p. 163)

4.1.2 get_current_velj()
FeaturesThis function returns the current joint velocity.

- 155 -

Programming manual(V2.10)

Auxiliary Control Commands

ReturnValue

Description

float[6]Joint speed

Exception
Exception

Description

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

Example1

velj1 = get_current_velj()

Related commands• get_desired_velj()(p. 164)

4.1.3 get_current_posx(ref)Features
Returns the pose and solution space of the current task coordinate. The pose is based on the ref coordinate.

Parameters
Parameter Name

Data TypeDefault Value

Description

ref

Int

DR_BASEreference coordinate• DR_BASE : base coordinate• DR_WORLD : world
coordinate• user coordinate: User
definedNote• ref: DR_BASE (base coordinate)/user coordinate (globally declared user coordinate)• DR_BASE is applied when ref is omitted.

- 156 -

Programming manual(V2.10)

Auxiliary Control Commands

ReturnValue

Description

Posx

Task space pointInt

Solution space (0 ~ 7)

Robot configuration vs. solution space
Solution space

BinaryShoulder

Elbow

Wrist

0

000

Lefty

Below

No Flip

1

001

Lefty

Below

Flip

2

010

Lefty

Above

No Flip

3

011

Lefty

Above

Flip

4

100

RightyBelow

No Flip

5

101

Righty

Below

Flip

6

110

RightyAbove

No Flip

7

111

Righty

Above

Flip

Exception
Exception

Description

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

Example12
3
4
5

x1, sol = get_current_posx() #x1 w.r.t. DR_BASE
x1_wld, sol = get_current_posx(ref=DR_WORLD) #x1 w.r.t. DR_WORLD
DR_USR1=set_user_cart_coord(x1, x2, x3, pos)

- 157 -

Programming manual(V2.10)

Auxiliary Control Commands

6
7
8

set_ref_coord(DR_USR1)
x1, sol = get_current_posx(DR_USR1) #x1 w.r.t. DR_USR1

Related commands• get_desired_posx(ref)(p. 165)

4.1.4 get_current_tool_flange_posx(ref)Features
Returns the current tool flange pose based on the reference coordinate (ref). The tool flange will return totcp=(0,0,0,0,0,0).

Parameters
Parameter Name

Data TypeDefault Value

Description

ref

int

DR_BASEreference coordinate• DR_BASE : base coordinate• DR_WORLD : world
coordinate

ReturnValue

Description

posx

Pose of tool flange

Exception
Exception

Description

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

Example12345x1 = get_current_tool_flange_posx()#x1 : Flange pose base on the base coordinate(default value)x2 = get_current_tool_flange_posx(DR_BASE)#x2 : Flange pose based on the base coordinate
x3 = get_current_tool_flange_posx(DR_WORLD)- 158 -

Programming manual(V2.10)

Auxiliary Control Commands

6#x3 : Flange pose based on the world coordinate

4.1.5 get_current_velx(ref)FeaturesThis function returns the current tool velocity based on the ref coordinate.

Parameters
Parameter Name

Data TypeDefault Value

Description

ref

Int

DR_BASEreference coordinate• DR_BASE : base coordinate• DR_WORLD : world
coordinate

ReturnValue

Description

float[6]Tool velocity

Exception
Exception

Description

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

Example
1
2
3
4
5
6

velx1 = get_current_velx()# velx1 : velocity based on the base coordinate(default value)velx2 = get_current_velx(DR_BASE)# velx2 (=velx1) : velocity based on the base coordinate
velx3 = get_current_velx(DR_WORLD)#velx3 : velocity based on the world coordinate

Related commands• get_desired_velx(ref)(p. 166)

- 159 -

Programming manual(V2.10)

Auxiliary Control Commands

4.1.6 get_current_rotm(ref)FeaturesThis function returns the direction and matrix of the current tool based on the ref coordinate.

Parameters
Parameter Name

Data TypeDefault Value

Description

ref

Int

DR_BASEreference coordinate• DR_BASE : base coordinate• DR_WORLD : world coordinate

ReturnValue

Description

float[3][3]Rotation matrix

Exception
Exception

Description

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

Example1
2

rotm1 = get_current_rotm(DR_WORLD)#rotm1 : rotation matrix(3x3) based on the world coordinate# The result value is stored in a 3x3 matrix- 160 -

Programming manual(V2.10)

Auxiliary Control Commands

4.1.7 get_joint_torque()FeaturesThis function returns the sensor torque value of the current joint.

ReturnValue

Description

float[6]JTS torque value

Exception
Exception

Description

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

Example1

j_trq1 = get_joint_torque()Related commands• get_external_torque()(p. 161)
• get_tool_force(ref)(p. 162)

4.1.8 get_external_torque()FeaturesThis function returns the torque value generated by the external force on each current joint.

ReturnValue

Description

float[6]Torque value generated by an external force- 161 -

Programming manual(V2.10)

Auxiliary Control Commands

Exception
Exception

Description

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

Example1

trq_ext=get_external_torque()Related commands• get_joint_torque()(p. 161)
• get_tool_force(ref)(p. 162)

4.1.9 get_tool_force(ref)FeaturesThis function returns the external force applied to the current tool based on the ref coordinate. The force and1)

moment are based on the reference coordinate.

1)

Before V2.8 software version, moment is based on the tool coordinate.

Parameters
Parameter Name

Data TypeDefault Value

Description

ref

Int

DR_BASEreference coordinate• DR_BASE : base coordinate• DR_WORLD : world coordinate• DR_TOOL : tool coordinate

ReturnValue

Description

float[6]External force applied to the tool

- 162 -

Programming manual(V2.10)

Auxiliary Control Commands

Exception
Exception

Description

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

Example1

force_ext = get_tool_force(DR_WORLD) # force_ext: external force of thetool based on the world coordinate

Related commands• get_joint_torque()(p. 161)
• get_external_torque()(p. 161)

4.2 Robot Target Value
4.2.1 get_desired_posj()
FeaturesThis function returns the current target joint angle. It cannot be used in the movel, movec, movesx, moveb,
move_spiral, or move_periodic command.

ReturnValue

Description

posj

Joint angle

Exception
Exception

Description

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_INVALID)

Invalid command- 163 -

Programming manual(V2.10)

Auxiliary Control Commands

Example1

jp1 = get_desired_posj()

Related commands• get_current_posj()(p. 155)

4.2.2 get_desired_velj()
FeaturesThis function returns the current target joint velocity. It cannot be used in the movel, movec, movesx, moveb,
move_spiral, or move_periodic command.

ReturnValue

Description

float[6]Target joint velocity

Exception
Exception

Description

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_INVALID)

Invalid command

Example1

velj1 = get_desired_velj()

Related commands• get_current_velj()(p. 155)

- 164 -

Programming manual(V2.10)

Auxiliary Control Commands

4.2.3 get_desired_posx(ref)FeaturesThis function returns the target pose of the current tool. The pose is based on the ref coordinate.

Parameters
Parameter Name

Data TypeDefault Value

Description

ref

Int

DR_BASEreference coordinate• DR_BASE : base coordinate• DR_WORLD : world coordinate• user coordinate: User definedNote• ref: DR_BASE (base coordinate)/user coordinate (globally declared user coordinate)• DR_BASE is applied when ref is omitted.

ReturnValue

Description

float[6]Tool velocity

Exception
Exception

Description

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

Example
1
2
3
4
5
6
7
8

x1 = get_desired_posx() #x1 w.r.t. DR_BASE
x2 = posx(100, 0, 0, 0, 0, 0)x3 = posx(0, 0, 20, 20, 20, 20)
pos = x3
DR_USR1=set_user_cart_coord(x1, x2, x3, pos)
set_ref_coord(DR_USR1)
xa = get_desired_posx(DR_USR1) #xa w.r.t. DR_USR1- 165 -

Programming manual(V2.10)

Auxiliary Control Commands

9xb = get_desired_posx(DR_WORLD) #xb w.r.t. DR_WORLD

Related commands• get_desired_posx(ref)(p. 165)

4.2.4 get_desired_velx(ref)FeaturesThis function returns the target velocity of the current tool based on the ref coordinate. It cannot be used in the
movej, movejx, or movesj command.

Parameters
Parameter Name

Data TypeDefault Value

Description

ref

Int

DR_BASEreference coordinate• DR_BASE : base coordinate• DR_WORLD : world
coordinate

ReturnValue

Description

float[6]Tool velocity

Exception
Exception

Description

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_INVALID)

Invalid command

Example12
3

vel_x1 = get_desired_velx()#vel_x1 : desired velocity of the tool based on the basecoordinate(default value)
vel_x2 = get_desired_velx(DR_BASE)- 166 -

Programming manual(V2.10)

Auxiliary Control Commands

4
56#vel_x2 : desired velocity of the tool based on the base coordinate
vel_x3 = get_desired_velx(DR_WORLD)#vel_x3 : desired velocity of the tool based on the world

Related commands• get_current_velx(ref)(p. 159)

4.3 Control State Value
4.3.1 get_control_mode()
FeaturesThis function returns the current control mode.

ReturnValue

Description

intControl mode
3 : Position control mode
4 : Torque control mode

Exception
Exception

Description

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

Example1mode = get_control_mode()

4.3.2 get_control_space()
FeaturesThis function returns the current control space.

- 167 -

Programming manual(V2.10)

Auxiliary Control Commands

ReturnValue

Description

intControl mode
1 : Joint space control
2 : Task space control

Exception
Exception

Description

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

Example1

x1 = get_control_space()

4.3.3 get_current_solution_space()
FeaturesThis function returns the current solution space value.

ReturnValue

Description

int

Solution space (0 ~ 7)

Exception
Exception

Description

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred- 168 -

Programming manual(V2.10)

Auxiliary Control Commands

Example1sol = get_current_solution_space()

Related commands• get_solution_space(pos)(p. 169)

4.3.4 get_solution_space(pos)FeaturesThis function obtains the solution space value for the entered pos(posj).

Parameters
Parameter Name

Data TypeDefault Value

Description

pos

posj

-

posj orposition list

list (float[6])ReturnValue

Description

0~7

Solution space

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully- 169 -

Programming manual(V2.10)

Auxiliary Control Commands

Example12
3

q1 = posj(0, 0, 0, 0, 0, 0)
sol1 = get_solution_space(q1)sol2 = get_solution_space([10, 20, 30, 40, 50, 60])

Related commands• get_current_solution_space()(p. 168)

4.3.5 get_orientation_error(xd, xc, axis)
FeaturesThis function returns the orientation error value between the arbitrary poses xd and xc of the axis.

Parameters
Parameter Name

Data TypeDefault Value

Description

xd

posx

-

posx orposition list

list (float[6])
xc

posx

-

posx orposition list

list (float[6])
axis

int

-

axis
• DR_AXIS_X: x-axis• DR_AXIS_Y: y-axis• DR_AXIS_Z: z-axis

ReturnValue

Description

float

Orientation error value- 170 -

Programming manual(V2.10)

Auxiliary Control Commands

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Example12
3

xd = posx(0, 0, 0, 0, 0, 0)
xc = posx(10, 20, 30, 40, 50, 60)diff = get_orientation_error(xd, xc, DR_AXIS_X)

Related commands• get_current_rotm(ref)(p. 160)

- 171 -

Programming manual(V2.10)

Other Settings Command

5 Other Settings Command
5.1 Tool/Workpiece Settings
5.1.1 get_workpiece_weight()
FeaturesThis function measures and returns the weight of the workpiece.
CautionIn the Non-FTS A model, this function cannot be used.

ReturnValue

Description

Positive value

Measured weight

Negative value

Error

Exception
Exception

Description

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Example1weight = get_workpiece_weight()

Related commands• reset_workpiece_weight()(p. 173)

- 172 -

Programming manual(V2.10)

Other Settings Command

5.1.2 reset_workpiece_weight()
FeaturesThis function initializes the weight data of the material to initialize the algorithm before measuring the weightof the material.

ReturnValue

Description0

Success

Negative value

Error

Exception
Exception

Description

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Example1

reset_workpiece_weight()

Related commands• get_workpiece_weight()(p. 172)5.1.3 set_workpiece_weight(weight=0.0, cog=[0.0,0.0,0.0],
cog_ref=DR_CUR_TCP, add_up=DR_REPLACE, start_time=None,transition_time=None)
Features
In addition to the tool weight/center of gravity at the end of the robot, set the weight/center of gravity of thework piece and other information. The weight and center of gravity of the entire payload is reflected by
combining the set tool weight/center of gravity and the work piece's weight/center of gravity. It can be used inapplications where the type of workpiece is frequently varied or the weight needs to be dynamically changed.

- 173 -

Programming manual(V2.10)

Other Settings Command

Caution• Workpiece weight change is allowed only when both Collision Detection and TCP SLF Violation
check are mute or deactivated during Auto Mode.
• In the current version, Collision Detection considers the function mute when Collision
Sensitivity is overridden to 0 and TCP SLF considers the function mute when the TCP SLF Limitis overridden to the maximum. This override can be set using Collision Sensitivity Reduction
Zone and Custom Zone.
• Otherwise, trigger an SS1 protective stop unless the workpiece weight is set to zero.
• If the robot stops due to an error and needs to be manually restored, place the robot in thedesired position in the Recovery Mode and unload the workpiece through Servo On and I/O
operation while the corresponding zones are activated in Auto Mode.
• When changing the set tool weight, the workpiece weight is initialized to 0.

Parameters
Parameter Name

Data TypeDefault Value

Description

weightint

0

Weight [kg]coglist(float[3])[0, 0, 0]Center of gravity of the workpiece (x,y, z) [mm]cog_ref

int

DR_CUR_TCP

Reference coordinates of center ofgravity position,
DR_CUR_TCP : TCP coordinates,
DR_FLANGE : FLANGE coordinates,

add_upint

DR_REPLACE

DR_REPLACE(0): Replace workpiece
DR_ADD(1): Add workpiece
DR_REMOVE(2): Remove workpiecestart_time

float

None

Starting time of changing workpiece
weight [sec]transition_time

float

None

Transition time of changing
workpiece weight [sec]Note• Workpiece weight cannot exceed the maximum payload weight (margin 10%) for each model.
The same is true for the weight of total payload.

- 174 -

Programming manual(V2.10)

Other Settings Command• The length (x, y, z) of the center of gravity of the workpiece cannot exceed 1000 mm. The sameis true for the length of the center of gravity of the entire payload.
• It is possible to change the weight of the workpiece after the set time through start_time.
• Transition_time allows you to gradually change the weight of the workpiece throughtransition_time.
• When using the set_tool and set_workpiece_weight functions in succession, you must use thewait(transition_time) function as much as transition_time between them. Otherwise, there may
be errors in the weight change.

ReturnValue

Description0

Success

Negative value

Error

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6
7
8

# Replace 1 kgf workpiece weight at the origin of the current TCP frame
set_workpiece_weight(1)# Add 0.5 kgf workpiece weight at the origin of the current TCP frame. In
total, 1.5kgf
set_workpiece_weight(0.5, add_up=DR_ADD)# Remove 0.1 kgf workpiece weight at [0, 0, 10] in the current TCP frame.
In total, 1.4kgf
set_workpiece_weight(0.1, [0, 0, 10], add_up=DR_REMOVE)# Remove 0.1 kgf workpiece weight at [0, 0, 10] in the flange frame. In
total, 1.3kgf
set_workpiece_weight(0.1, [0, 0, 10], DR_FLANGE, DR_REMOVE)- 175 -

Programming manual(V2.10)

Other Settings Command

9
10
11

# Reset. And the weight transition is being occurred after 0.1 sec for 0.2
sec
set_workiece_weight(0, start_time=0.1, transition_time=0.2)

Related Commands• set_tool(name, start_time, transition_time)(p. 177)

5.1.4 set_tool_shape(name)FeaturesThis function activates the tool shape information of the entered name among the tool shape information
registered in the Teach Pendant.

Parameters
Parameter Name

Data TypeDefault Value

Description

namestring-Tool name registered in the Teach
Pendant

ReturnValue

Description0

Success

Negative value

Error

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully- 176 -

Programming manual(V2.10)

Other Settings Command

Example1

set_tool_shape("tool_shape1")# Activate the geometry of "tool_shape1".

Related commands• set_tcp(name)(p. 50)

5.1.5 set_tool(name, start_time, transition_time)
Features
Teach Pendant>Workcell Manager>Activate the Tool Weight workcell item with the entered name from among
the Tool Weight workcell items registered in the robot.
Tool weight can be changed after setting time(start_time) and during setting time(transition_time).

Parameters
Parameter Name

Data TypeDefault Value

Description

namestring-

The name of the tool weightregistered in the Workcell
Manager.

start_time

float

None

Tool weight is changed after
setting timetransition_time

float

None

Tool weight is changed during
setting time

Note
• When using the set_tool and set_workpiece_weight functions in succession, you must use thewait(transition_time) function as much as transition_time between them. Otherwise, there may
be errors in the weight change.

ReturnValue

Description0

Success- 177 -

Programming manual(V2.10)

Other Settings Command

Value

Description

Negative value

Error

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Example1
2

set_tool ("tool1",start_time=1,transition_time=2)# After 1s and then aActivate the information of "tool1" registered in TP
during 2s.

Related commands• set_tcp(name)(p. 50)

5.2 Control Mode Settings
5.2.1 set_singularity_handling(mode)
Features
Allows the user to select a response policy when a path deviation occurs due to a singularity in task motion. The
mode can be set as follows• Automatic avoidance mode(Default) : DR_AVOID• Path first mode : DR_TASK_STOP• Variable velocity mode : DR_VAR_VEL
The default setting is automatic avoidance mode, which reduces instability caused by singularity, but reduces
path tracking accuracy. In case of path first setting, if there is possibility of instability due to singularity, awarning message is output after deceleration and then the corresponding task is terminated. In case of variable- 178 -

Programming manual(V2.10)

Other Settings Command

velocity mode setting, TCP velocity would be changed in singular region to reduce instability and maintain pathtracking accuracy.

Parameters
Parameter Name

Data TypeDefault
Value

Description

mode

int

DR_AVOID

DR_AVOID : Automatic avoidance mode
DR_TASK_STOP : Deceleration/ Warning/ Task
termination
DR_VAR_VEL : Variable velocity mode

ReturnValue

Description0

Success

Negative value

Error

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6

P1 = posx(400,500,800,0,180,0)P2 = posx(400,500,500,0,180,0)P3 = posx(400,500,200,0,180,0)
set_singularity_handling (DR_AVOID) # Automatic avoidance mode forsingularity
movel(P1, vel=10, acc=20)
set_velx(30)- 179 -

Programming manual(V2.10)

Other Settings Command

7
8
9
10
11

set_accx(60)set_singularity_handling(DR_TASK_STOP) # Task motion path firstmovel(P2)
set_singularity_handling(DR_VAR_VEL) # Variable velocity mode forsingularity
movel(P3)

Related commands• movel()(p. 59)• movec()(p. 68)• movesx()(p. 77)• moveb()(p. 81)• move_spiral()(p. 85)• amovel()(p. 98)• amovec()(p. 104)
• amovesx()(p. 111)
• amoveb()(p. 114)
• amove_spiral()(p. 118)

5.2.2 set_singular_handling_force(mode)
Features
The program is terminated by default through error processing when compliance or force control are usedwithin the singularity area. It is possible to ignore error processing within the singularity area by changing theMode setting.
• Error Processing : DR_SINGULARITY_ERROR• Ignore Error Processing : DR_SINGULARITY_IGNORE

Caution• Compliance and force control within the singularity area are not recommended. The force
estimate in a particular direction can be inaccurate.

- 180 -

Programming manual(V2.10)

Other Settings Command

Parameters
Parameter Name

Data TypeDefault Value

Description

mode

int

DR_SINGULARITY_ERROR

DR_SINGULARITY_ERROR: Error processing
DR_SINGULARITY_IGNOR
E : Ignore error processing

ReturnValue

Description0

Success

Negative value

Error

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6
7
8
9
10
11
12

set_ref_coord(DR_BASE)
P0 = posj(0, 0, 90, 0, 90, 0)
movej(P0,vel=30,acc=60)#Ignoring error when entering singularity
set_singular_handling_force(DR_SINGULARITY_IGNORE)
task_compliance_ctrl()
set_stiffnessx([500, 500, 500, 100, 100, 100], time=0.5)
fd = [0, 0, 30, 0, 0, 0]
fctrl_dir= [0, 0, 1, 0, 0, 0]
set_desired_force(fd, dir=fctrl_dir, mod=DR_FC_MOD_REL)- 181 -

Programming manual(V2.10)

Other Settings Command

13

release_compliance_ctrl()

Related Commands• task_compliance_ctrl(stx, time)(p. 187)
• set_stiffnessx(stx, time)(p. 188)
• set_desired_force(fd, dir, time, mod)(p. 190)
• release_compliance_ctrl()(p. 186)

5.2.3 set_palletizing_mode(mode)
Features
During palletizing application motion, path tracking and velocity can be maintained around the wrist singularity
point using this function. there is no instability in wrist singular region when B in motion command is set to
0deg or 180deg.
• Deactivate mode : DR_OFF• Activate mode : DR_ON

Caution• Setting tool orientation, B must be set to 0deg or 180deg when setting tcp information. If thiscondition don’t be satisfied, Error is occurred when using this function.
• Normally velocity don’t be changed in this mode. But if current joint velocity exceed allowable
max joint velocity, velocity can be reduced automatically.
• In case of H seriese model, Rx, Ry moment control is restricted and external moment value ofeach Rx, Ry direction is 0.

Parameters
Parameter Name

Data TypeDefault Value

Description

mode

int

DR_ON

DR_OFF : Deactivate mode
DR_ON : Activate mode

ReturnValue

Description0

Success- 182 -

Programming manual(V2.10)

Other Settings Command

Value

Description

Negative value

Error

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6
7

set_singularity_handling(DR_VAR_VEL)
movej(posj(0,0,90,0,90,0),vel=30,acc=60)
set_palletizing_mode(DR_ON)
movel(posx(559,34.5,-400,45,180,45),vel=500,acc=1000)
set_palletizing_mode(DR_OFF)

Related Commands• set_singularity_handling(mode)(p. 178)

5.2.4 set_motion_end(mode)
FeaturesThis command sets whether to operate the function to check the stop status of the robot after motion iscompleted. Stop time between consecutive motions decreases if it set to deactivate mode (DR_CHECK_OFF)and can be used for purposes of decreasing the overall work time. It is recommended to set it to DR_CHECK_ON
when the tool is heavy and an accurate stop position is required for motion commands driven with highacceleration.

- 183 -

Programming manual(V2.10)

Other Settings Command

Caution• It is not possible to change the mode, during the blending movements between consecutive
motions without stopping.
• In the case of continuous motion that does not require a stop state, using motion blending ismore effective in reducing tact time.
• After the program is finished, it is initialized to the default value again

Parameters
Parameter Name

Data TypeDefault Value

Description

mode

int

DR_CHECK_ON

DR_CHECK_OFF(0) : Deactivate mode
DR_CHECK_ON(1) : Activate mode

ReturnValue

Description0

Success

Negative value

Error

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Example1
2
3
4

set_motion_end(DR_CHECK_OFF)
movej(posj(0,0,90,0,90,0) ,vel=30,acc=60,mod = DR_MV_MOD_ABS )while 1:

- 184 -

Programming manual(V2.10)

Other Settings Command

5
6

movej(posj(0,0,10,0,10,0) ,vel=30,acc=60,,mod = DR_MV_MOD_REL )movej(posj(0,0,-10,0,-10,0) ,vel=30,acc=60,,mod = DR_MV_MOD_REL )Related Commands• movel()(p. 59)• movec()(p. 68)• movesx()(p. 77)• moveb()(p. 81)• move_spiral()(p. 85)• amovel()(p. 98)• amovec()(p. 104)
• amovesx()(p. 111)
• amoveb()(p. 114)
• amove_spiral()(p. 118)

- 185 -

Programming manual(V2.10)

Force/Stiffness Control and Other User-Friendly Features

6 Force/Stiffness Control and Other User-Friendly Features
6.1 Force/Compliance Control
6.1.1 release_compliance_ctrl()
FeaturesThis function terminates compliance control and begins position control at the current position.

ReturnValue

Description0

Success

Negative value

Error

Exception
Exception

Description

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Example123
45P0 = posj(0,0,90,0,90,0)
movej(P0)task_compliance_ctrl()
set_stiffnessx([100, 100, 300, 100, 100, 100])
release_compliance_ctrl()

Related commands• task_compliance_ctrl(stx, time)(p. 187)
• set_stiffnessx(stx, time)(p. 188)

- 186 -

Programming manual(V2.10)

Force/Stiffness Control and Other User-Friendly Features

6.1.2 task_compliance_ctrl(stx, time)
FeaturesThis function begins task compliance control based on the preset reference coordinate system.
CautionIn the Non-FTS A model, the data type of the stx parameter is changed to float[3] (rotational stiffness
cannot be input)

Parameters (Stiffness TBD)
Parameter Name

Data TypeDefault Value

Descriptionstx

float[6][3000, 3000, 3000, 200,
200, 200]

Three translational
stiffnesses
Three rotational stiffnesses

time

float

0

Stiffness varying time [sec]Range: 0 - 1.0* Linear transition during thespecified time

ReturnValue

Description0

Success

Negative value

Error

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred- 187 -

Programming manual(V2.10)

Force/Stiffness Control and Other User-Friendly Features

Exception

Description

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6
7
8
9
10

P0 = posj(0,0,90,0,90,0)
movej(P0)task_compliance_ctrl()# Begins with the default stiffness
set_stiffnessx([500, 500, 500, 100, 100, 100], time=0.5)# Switches to the user-defined stiffness for 0.5 sec.
release_compliance_ctrl()
task_compliance_ctrl([500, 500, 500, 100, 100, 100])# Begins with the user-defined stiffness.
release_compliance_ctrl()

Related commands• set_stiffnessx(stx, time)(p. 188)
• release_compliance_ctrl()(p. 186)

6.1.3 set_stiffnessx(stx, time)
FeaturesThis function sets the stiffness value based on the global coordinate (refer to set_ref_coord()). The stiffness
linearly changes for a given time from the current stiffness or default value to STX.The user-defined ranges of
the translational stiffness and rotational stiffness are 0-20000N/m and 0-400Nm/rad, respectively.

User-defined ranges of stiffness- M/H Series: Translation(0~20000N/m), Rotation(0~1000Nm/rad)- A Series: Translation(0~10000N/m), Rotation(0~300Nm/rad)CautionIn the Non-FTS A model, the data type of the stx parameter is changed to float[3] (rotational stiffness
cannot be input)- 188 -

Programming manual(V2.10)

Force/Stiffness Control and Other User-Friendly Features

Parameters
Parameter Name

Data TypeDefault Value

Descriptionstx

float[6][500, 500, 500, 100,
100, 100]Three translational
stiffnesses
Three rotational stiffnesses

time

float

0

Stiffness varying time [sec]Range: 0 - 1.0* Linear transition during thespecified time

ReturnValue

Description0

Success

Negative value

Error

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Example1
2
3
4
5

set_ref_coord(DR_WORLD)# Global coordinate is the world coordinate
x0 = posx(0, 0, 90, 0, 90, 0)
movej(x0)task_compliance_ctrl()
stx = [1, 2, 3, 4, 5, 6]- 189 -

Programming manual(V2.10)

Force/Stiffness Control and Other User-Friendly Features6
7

set_stiffnessx(stx) # Set the stiffness value based on the global
coordinate(world coordinate)
release_compliance_ctrl()

Related commands• task_compliance_ctrl(stx, time)(p. 187)
• release_compliance_ctrl()(p. 186)

6.1.4 set_desired_force(fd, dir, time, mod)FeaturesThis function define the s target force, direction, translation time, and mode for force control based on the
global coordinate.
CautionIn the Non-FTS A model, the data types of fd and dir parameters arechanged to float[3]. (Rotational parameter input is not allowed)

Parameters
Parameter Name

Data TypeDefault Value

Description

Fdfloat[6][0, 0, 0, 0, 0, 0]

Three translational target forces
Three rotational target moments

dirint[6][0, 0, 0, 0, 0, 0]

Force control in the corresponding direction if
1
Control compliance of corresponding
direction if value is 0

time

float

0

Transition time of target force to take effect[sec]
Range: 0 - 1.0

mod

int

DR_FC_MOD_ABS

DR_FC_MOD_ABS: Force control withabsolute value
DR_FC_MOD_REL: force control with relativevalue to initial state (the instance when thisfunction is called)- 190 -

Programming manual(V2.10)

Force/Stiffness Control and Other User-Friendly Features

ReturnValue

Description0

Success

Negative value

Error

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Note• The value of external force refers to the sensor measurement at terminating the force control(control mode transition to compliance control) by the command release_force().
Therefore, the variation in external force can occur if the option mod=DR_FC_MOD_REL isapplied.
• Tool weight and external force value refer to the sensor measurement regardless of the settingfor ‘mod’
CautionTo retain the accuracy in force control, it is recommended to start force control with setting
mod=DR_FC_MOD_REL near the contact point.

Example1
2
3

4# Example # 1# Executed in the global coordinate(tool coordinate)# Zero force control in the z-axis direction of the tool, moment control
in the z-axis direction of the tool, and compliance control in the otherdirections# Force control with the relative value to the sensor measurement atstarting the force control- 191 -

Programming manual(V2.10)

Force/Stiffness Control and Other User-Friendly Features

5
6
7
8
9
10
11
12
13
14
15
16
17
18

19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55

set_ref_coord(DR_TOOL)
x0 = posx(0, 0, 90, 0, 90, 0)
movej(x0)task_compliance_ctrl(stx=[500, 500, 500, 100, 100, 100])
fd = [0, 0, 0, 0, 0, 10]
fctrl_dir= [0, 0, 1, 0, 0, 1]
set_desired_force(fd, dir=fctrl_dir, mod=DR_FC_MOD_REL)# Example #2# 1. Move to initial posj: [J1, J2, J3, J4, J5, J6] = [0, 0, 90, 0, 90, 0]# 2. Approach to the position to start force control: move -100mm along
Base-z direction# 3. Start force control : apply -20N force along Base–z direction# 4. Force & compliance control after detecting external force : while
maintaining -20N force along Base-z direction (force control), move 200mm
along Base-y direction.
# 5. Retract 150mm in Base-z direction and move to initial posj
# 1. Move to initial posj
q0 = posj(0.0, 0.0, 90.0, 0.0, 90.0, 0.0)
set_velj(30.0)
set_accj(60.0)
movej(q0)# 2. Approach to the position to start force control
set_velx(75.0)
set_accx(100.0)
delta_approach = [0.0, 0.0, -100.0, 0.0, 0.0, 0.0]
movel(delta_approach, mod=DR_MV_MOD_REL)# 3. Start force control (apply -20N force along Base–z direction)
k_d = [3000.0, 3000.0, 3000.0, 200.0, 200.0, 200.0]
task_compliance_ctrl(k_d)
force_desired = 20.0
f_d = [0.0, 0.0, -force_desired, 0.0, 0.0, 0.0]
f_dir = [0, 0, 1, 0, 0, 0]
set_desired_force(f_d, f_dir)# 4. Force & compliance control after detecting external force
force_check = 20.0
force_condition = check_force_condition(DR_AXIS_Z, max=force_check)
while (force_condition):force_condition = check_force_condition(DR_AXIS_Z, max=force_check)if force_condition == 0:
break
delta_motion = [0.0, 200.0, 0.0, 0.0, 0.0, 0.0]
movel(delta_motion, mod=DR_MV_MOD_REL)# 5. Retract 150mm in Base-z direction and move to initial posj
release_force()
wait(0.5)
delta_retract = [0.0, 0.0, 150.0, 0.0, 0.0, 0.0]
release_compliance_ctrl()- 192 -

Programming manual(V2.10)

Force/Stiffness Control and Other User-Friendly Features

56
57

movel(delta_retract, mod=DR_MV_MOD_REL)
movej(q0)

Related commands• release_force(time=0)(p. 193)
• task_compliance_ctrl(stx, time)(p. 187)
• set_stiffnessx(stx, time)(p. 188)
• release_compliance_ctrl()(p. 186)

6.1.5 release_force(time=0)
FeaturesThis function reduces the force control target value to 0 through the time value and returns the task space toadaptive control.

Parameters
Parameter Name

Data TypeDefault Value

Description

time

float

0

Time needed to reduce theforce
Range: 0 - 1.0

ReturnValue

Description0

Success

Negative value

Error

Exception
Exception

Description

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully- 193 -

Programming manual(V2.10)

Force/Stiffness Control and Other User-Friendly Features

Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

j0 = posj(0, 0, 90, 0, 90, 0)
x0 = posx(0, 0, 0, 0, 0, 0)
x1 = posx(0, 500, 700, 0, 180, 0)x2 = posx(300, 100, 700, 0, 180, 0)x3 = posx(300, 100, 500, 0, 180, 0)
set_velx(100,20)
set_accx(100,20)
movej(j0, vel=10, acc=10)
movel(x2)task_compliance_ctrl(stx = [500, 500, 500, 100, 100, 100])
fd = [0, 0, 0, 0, 0, 10]
fctrl_dir= [0, 0, 1, 0, 0, 1]
set_desired_force(fd, dir=fctrl_dir, time=1.0)
movel(x3, v=10)
release_force(0.5)
release_compliance_ctrl()

Related commands• set_desired_force(fd, dir, time, mod)(p. 190)
• task_compliance_ctrl(stx, time)(p. 187)
• set_stiffnessx(stx, time)(p. 188)
• release_compliance_ctrl()(p. 186)

6.1.6 get_force_control_state()
Features
It monitors the state of compliance and force control.

Return[singularity, mode, stx, fd, ref]Value

Description

singularity

Risk : 0 < 1 < 2
0 : Safe section
1 : Stage 1 risk section of the singularity area
2 : Stage 2 risk section of the singularity area

- 194 -

Programming manual(V2.10)

Force/Stiffness Control and Other User-Friendly Features

Value

Description

mode

Information of 6 modes x, y, z, rx, ry and rz (sequential)
0 : Compliance control
1 : Force control
2 : NoneStx

6 in the order of x, y, z, rx, ry and rz
Information of set target stiffness

fd

6 in the order of x, y, z, rx, ry and rz
Information of set target force

refInformation of set target force
0 : Base coordinate
1 : Tool coordinate
2 : World coordinate
101 ~ 120 : User coordinate

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data error

DR_Error (DR_ERROR_VALUE)

Invalid parameter value

DR_Error (DR_ERROR_RUNTIME)C Extension module error

DR_Error (DR_ERROR_STOP)

Program terminated forcibly

Example
1
2
3
4
5
6
7
8

set_ref_coord(DR_BASE)
P0 = posj(0, 0, 90, 0, 90, 0)
movej(P0,vel=30,acc=60)
task_compliance_ctrl()
set_stiffnessx([500, 500, 500, 100, 100, 100], time=0.5)
while True:- 195 -

Programming manual(V2.10)

Force/Stiffness Control and Other User-Friendly Features

9
10
11
12

[singularity, mod, stx, fd, ref]=get_force_control_state()
tp_log("s={0}, m={1}, k={2}, f={3}, r={4}".format(singularity,mod,stx,fd,ref))
wait(0.5)
release_compliance_ctrl()

Related Commands• set_singular_handling_force(mode)(p. 180)
• task_compliance_ctrl(stx, time)(p. 187)
• set_stiffnessx(stx, time)(p. 188)
• set_desired_force(fd, dir, time, mod)(p. 190)
• release_compliance_ctrl()(p. 186)

6.1.7 set_damping_factor(damping_factor, time)
Features
In force control, This function sets the damping factor based on the global coordinate (refer to set_ref_coord())

Parameters
Parameter Name

Data TypeDefault Value

Description

damping_factor

float[6][1.0, 1.0, 1.0, 1.0, 1.0,
1.0](Translation x, y, z), (Rotation x, y, z)0Damping factor varying time [sec]

time

float

Range: 0.1 - 2.0

Range: 0 - 1.0* Linear transition during thespecified time

• When the damping factor is set to the default value (1.0), it operates with the default damping
value set according to the robot model.
• When the damping factor is set, a value proportional to the default damping value is applied
during force control.
• The damping factor is applied only during force control. It is applied as a default value forcompliance control.
• This function is supported only for the M series. It cannot be used for A series and H series.
• If the damping factor is set to less than 1.0, the robot may vibrate depending on the contact
surface. Please use it carefully.

- 196 -

Programming manual(V2.10)

Force/Stiffness Control and Other User-Friendly Features

ReturnValue

Description0

Success

Negative value

Error

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

# 1. Move to initial posj
q0 = posj(0.0, 0.0, 90.0, 0.0, 90.0, 0.0)
set_velj(30.0)
set_accj(60.0)
movej(q0)# 2. Start force control (apply -20N force along Base–z direction)
k_d = [3000.0, 3000.0, 3000.0, 200.0, 200.0, 200.0]
task_compliance_ctrl(k_d)
force_desired = 20.0
f_d = [0.0, 0.0, -force_desired, 0.0, 0.0, 0.0]
f_dir = [0, 0, 1, 0, 0, 0]
d_f = [1.0, 1.0, 0.8, 1.0, 1.0, 1.0]
set_desired_force(f_d, f_dir)
set_damping_factor(d_f)
wait(2.0)
release_force()
wait(0.5)
release_compliance_ctrl()- 197 -

Programming manual(V2.10)

Force/Stiffness Control and Other User-Friendly Features

Related commands• set_force_factor(force_factor, time)(p. 198)
• set_desired_force(fd, dir, time, mod)(p. 190)
• release_force(time=0)(p. 193)

6.1.8 set_force_factor(force_factor, time)
Features
In force control, This function sets the force factor based on the global coordinate (refer to set_ref_coord())

Parameters
Parameter Name

Data TypeDefault Value

Description

force_factor

float[6][1.0, 1.0, 1.0, 1.0, 1.0,
1.0](Translation x, y, z), (Rotation x, y, z)

0Force factor varying time [sec]

time

float

Range: 0.1 - 2.0

Range: 0 - 1.0* Linear transition during thespecified time

• When the force factor is set to the default value (1.0), it operates with the default damping value
set according to the model.
• Setting the force factor below 1.0 reduces the setting time to follow the target force value, but
may increase vibration.
• Setting the force factor above 1.0 may reduce vibration but increase the setting time to follow
the target force value.
• The force factor setting is applied only during force control. It is applied as a default value forcompliance control.
• This function is supported only for the M series. It cannot be used for A series and H series.
• If the force factor is set to less than 1.0, the robot may vibrate depending on the contact
surface. Please use it carefully.

- 198 -

Programming manual(V2.10)

Force/Stiffness Control and Other User-Friendly Features

ReturnValue

Description0

Success

Negative value

Error

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

# 1. Move to initial posj
q0 = posj(0.0, 0.0, 90.0, 0.0, 90.0, 0.0)
set_velj(30.0)
set_accj(60.0)
movej(q0)# 2. Start force control (apply -20N force along Base–z direction)
k_d = [3000.0, 3000.0, 3000.0, 200.0, 200.0, 200.0]
task_compliance_ctrl(k_d)
force_desired = 20.0
f_d = [0.0, 0.0, -force_desired, 0.0, 0.0, 0.0]
f_dir = [0, 0, 1, 0, 0, 0]
d_f = [1.0, 1.0, 0.8, 1.0, 1.0, 1.0]
f_f = [1.0, 1.0, 1.2, 1.0, 1.0, 1.0]
set_desired_force(f_d, f_dir)
set_damping_factor(d_f)
set_force_factor(f_f)
wait(2.0)
release_force()
wait(0.5)
release_compliance_ctrl()- 199 -

Programming manual(V2.10)

Force/Stiffness Control and Other User-Friendly Features

Related commands• task_compliance_ctrl(stx, time)(p. 187)
• release_compliance_ctrl()(p. 186)

6.2 User-friendly Functions
6.2.1 parallel_axis(x1, x2, x3, axis, ref)FeaturesThis function matches the normal vector of the plane consists of points(x1, x2, x3) based on the refcoordinate(refer to get_normal(x1, x2, x3)) and the designated axis of the tool frame. The current position is
maintained as the TCP position of the robot.

Parameters
Parameter Name

Data TypeDefault Value

Description

x1

posx

-

posx orposition list

list (float[6])
x2

posx

-

posx orposition list

list (float[6])
x3

posx

-

posx orposition list

list (float[6])
axis

int

-

axis
• DR_AXIS_X: x-axis• DR_AXIS_Y: y-axis• DR_AXIS_Z: z-axis

ref

int

DR_BASEreference coordinate• DR_BASE: base coordinate• DR_WORLD: world
coordinate• user coordinate : user difined- 200 -

Programming manual(V2.10)

Force/Stiffness Control and Other User-Friendly Features

ReturnValue

Description0

Success

Negative value

Error

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6
7

x0 = posx(0, 0, 90, 0, 90, 0)
movej(x0)x1 = posx(0, 500, 700, 30, 0, 90)
x2 = posx(500, 0, 700, 0, 0, 45)
x3 = posx(300, 100, 500, 45, 0, 45)parallel_axis(x1, x2, x3, DR_AXIS_X, DR_WORLD)# match the tool x axis and the normal vector of the plane consists ofpoints(x1,x2,x3) # based on the world coordinate

Related commands• get_normal(x1, x2, x3)(p. 314)
• parallel_axis(vect, axis, ref)(p. 202)• parallel_axis(x1, x2, x3, axis, ref)(p. 200)
• align_axis(vect, pos, axis, ref)(p. 205)
• align_axis(x1, x2, x3, pos, axis, ref)(p. 203)

- 201 -

Programming manual(V2.10)

Force/Stiffness Control and Other User-Friendly Features

6.2.2 parallel_axis(vect, axis, ref)FeaturesThis function matches the given vect direction based on the ref coordinate and the designated axis of the tool
frame. The current position is maintained as the TCP position of the robot.

Parameters
Parameter Name

Data TypeDefault Value

Description

vect

list (float[3])-vector

axis

int

-

axis
• DR_AXIS_X: x-axis• DR_AXIS_Y: y-axis• DR_AXIS_Z: z-axis

ref

int

DR_BASEreference coordinate• DR_BASE: basecoordinate• DR_WORLD: world
coordinate• user coordinate: user
definedReturnValue

Description0

Success

Negative value

Error

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid- 202 -

Programming manual(V2.10)

Force/Stiffness Control and Other User-Friendly Features

Exception

Description

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Example123
4x0 = posx(0, 0, 90, 0, 90, 0)
movej(x0)parallel_axis([1000, 700, 300], DR_AXIS_X, DR_WORLD)# match the tool x axis and the vector([1000,700,300]) based on the world
coordinate

Related commands• movej()(p. 54)• parallel_axis(x1, x2, x3, axis, ref)(p. 200)
• align_axis(vect, pos, axis, ref)(p. 205)
• align_axis(x1, x2, x3, pos, axis, ref)(p. 203)6.2.3 align_axis(x1, x2, x3, pos, axis, ref)FeaturesThis function matches the normal vector of the plane consists of points(x1, x2, x3) based on the refcoordinate(refer to get_normal(x1, x2, x3)) and the designated axis of the tool frame. The robot TCP moves tothe pos position.

Parameters
Parameter Name

Data TypeDefault Value

x1

posx

-

posx

posx orposition list

list (float[6])x2Description-

posx orposition list

list (float[6])- 203 -

Programming manual(V2.10)

Force/Stiffness Control and Other User-Friendly Features

Parameter Name

Data TypeDefault Value

x3

posx

-

posx

-

int

posx orposition list

list (float[6])axisposx orposition list

list (float[6])posDescription-axis• DR_AXIS_X: x-axis• DR_AXIS_Y: y-axis• DR_AXIS_Z: z-axis

ref

int

DR_BASEreference coordinate• DR_BASE: basecoordinate• DR_WORLD: world
coordinate• user coordinate: user
definedReturnValue

Description0

Success

Negative value

Error

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully- 204 -

Programming manual(V2.10)

Force/Stiffness Control and Other User-Friendly Features

Example
1
2
3
4
5
6
7
8
9
10

p0 = posj(0,0,45,0,90,0)
movej(p0, v=30, a=30)
x1 = posx(0, 500, 700, 30, 0, 0)x2 = posx(500, 0, 700, 0, 0, 0)x3 = posx(300, 100, 500, 0, 0, 0)
pos = posx(400, 400, 500, 0, 0, 0)align_axis(x1, x2, x3, pos, DR_AXIS_X, DR_BASE)# match the tool x axis and the normal vector in the plane consists ofpoints(x1, x2,# x3) based on the base coordinate

Related commands• movej()(p. 54)• get_normal(x1, x2, x3)(p. 314)
• align_axis(vect, pos, axis, ref)(p. 205)• parallel_axis(vect, axis, ref)(p. 202)• parallel_axis(x1, x2, x3, axis, ref)(p. 200)

6.2.4 align_axis(vect, pos, axis, ref)FeaturesThis function matches the given vect direction based on the ref coordinate and the designated axis of the tool
frame. The robot TCP moves to the pos position.

Parameters
Parameter Name

Data TypeDefault Value

Description

vect

list (float[3])-vector

pos

posx
-

posx orposition list

-

axis

list (float[6])
axis

int

• DR_AXIS_X: x-axis• DR_AXIS_Y: y-axis• DR_AXIS_Z: z-axis- 205 -

Programming manual(V2.10)

Force/Stiffness Control and Other User-Friendly Features

ReturnValue

Description0

Success

Negative value

Error

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6

p0 = posj(0,0,45,0,90,0)
movej(p0, v=30, a=30)vect = [10, 20, 30]
pos = posx(100, 500, 700, 45, 0, 0)align_axis(vect, pos, DR_AXIS_X)

Related commands• movej()(p. 54)• align_axis(x1, x2, x3, pos, axis, ref)(p. 203)• parallel_axis(vect, axis, ref)(p. 202)• parallel_axis(x1, x2, x3, axis, ref)(p. 200)

- 206 -

Programming manual(V2.10)

Force/Stiffness Control and Other User-Friendly Features

6.2.5 is_done_bolt_tightening(m=0, timeout=0, axis=None)
FeaturesThis function monitors the tightening torque of the tool and returns True if the set torque (m) is reached within
the given time and False if the given time has passed.

Parameters
Parameter Name

Data TypeDefault Value

Description

m

float

0

Target torquetimeoutfloat

0Monitoring duration [sec]

axis

int

-

axis
• DR_AXIS_X: x-axis• DR_AXIS_Y: y-axis• DR_AXIS_Z: z-axis

ReturnValue

Description0

Success

Negative value

Error

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Example1p0 = posj(0,0,90,0,90,0)- 207 -

Programming manual(V2.10)

Force/Stiffness Control and Other User-Friendly Features

2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

movej(p0, v=30, a=30)
task_compliance_ctrl()
xd = posx(559, 34.5, 651.5, 0, 180.0, 60)
amovel(xd, vel=50, acc=50) # Bolt tightening motion
res = is_done_bolt_tightening(10, 5, DR_AXIS_Z)# Returns True if the tightening torque of 10Nm is reached within 5
seconds.
# Returns False otherwise.
if res==True:# some action comes here for the case that bolt tightening is done
x=1
else:
# some action comes here for the case that it fails
x=2

Related commands• movej()(p. 54)• amovel()(p. 98)

6.2.6 calc_coord(x1, x2, x3, x4, ref, mod)FeaturesThis function returns a new user cartesian coordinate system by using up to 4 input poses ([x1]~[x4]), input
mode [mod] and the reference coordinate system [ref]. The input mode is only valid when the number of input
robot poses is 2.
In the case that the number of input poses is 1, the coordinate system is calculated using the position andorientation of x1.
In the case that the number of input poses is 2 and the input mode is 0, X-axis is defined by the direction from x1
to x2, and Z-axis is defined by the projection of the current Tool-Z direction onto the plane orthogonal to the xaxis. The origin is the position of x1.
In the case that the number of input poses is 2 and the input mode is 1, X-axis is defined by the direction from x1
to x2, and Z-axis is defined by the projection of the z direction of x1 onto the plane orthogonal to the X-axis. The
origin is the position of x1.
In the case that the number of input poses is 3, X-axis is defined by the direction from x1 to x2. If a vector v is the
direction from x1 to x3, Z-axis is defined by the cross product of X-axis and v (X-axis cross v). The origin is the
position of x1.
In the case that the number of input poses is 4, the definition of axes is identical to the case that the number of
input poses is 3, but the origin is the position of x4- 208 -

Programming manual(V2.10)

Force/Stiffness Control and Other User-Friendly Features

Parameters
Parameter Name

Data TypeDefault Value

Description

x1, x2, x3, x4

posx

-

Posx orposition list-

reference coordinate

list (float[6])
ref

int

• DR_BASE: basecoordinate• DR_WORLD: world
coordinate
mod

int

-

input mode
(only valid when thenumber of input poses is2)• 0: defining z-axis
based on thecurrent Tool-z
direction• 1: defining z-axis
based on the z
direction of x1

ReturnValue

Description

posx

Successful coordinate calculation
Position information of the calculated coordinate

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully- 209 -

Programming manual(V2.10)

Force/Stiffness Control and Other User-Friendly Features

Example
1
2
3
4
5
6
7
8
9
10
11
12
13

pos1 = posx(500, 30, 500, 0, 0, 0)
pos2 = posx(400, 30, 500, 0, 0, 0)
pos3 = posx(500, 30, 600, 45, 180, 45)
pos4 = posx(500, -30, 600, 0, 180, 0)
pose_user1 = calc_coord(pos1, ref=DR_BASE, mod=0)
pose_user21 = calc_coord(pos1, pos2, ref=DR_WORLD, mod=0)%% Define z-axis based on the Tool-z direction.
pose_user22 = calc_coord(pos1, pos2, ref=DR_BASE, mod=1)%% Define z-axis based on the z direction of pos1
pose_user3 = calc_coord(pos1, pos2, pos3, ref=DR_BASE, mod=0)
pose_user4 = calc_coord(pos1, pos2, pos3, pos4, ref=DR_WORLD, mod=0)
ucart1 = set_user_cart_coord(pose_user1, ref=DR_BASE)
ucart2 = set_user_cart_coord(pose_user21, ref=DR_WORLD)

Related commands• set_user_cart_coord(pos, ref)(p. 210)
• set_user_cart_coord(u1, v1, pos, ref)(p. 213)
• set_user_cart_coord(x1, x2, x3, pos, ref)(p. 211)6.2.7 set_user_cart_coord(pos, ref)FeaturesThis function set a new user cartesian coordinate system using input pose [pos] and reference coordinate
system[ref]. Up to 100 user coordinate systems can be set including the coordinate systems set within Workcell
Item. Since the coordinate system set by this function is removed when the program is terminated, setting newcoordinate systems within Workcell Item is recommended for maintaining the coordinate information.

Parameters
Parameter Name

Data TypeDefault Value

Description

pos

posx

-

coordinate information(position and orientation)-reference coordinate

list (float[6])
ref

int

• DR_BASE: basecoordinate• DR_WORLD: world
coordinate- 210 -

Programming manual(V2.10)

Force/Stiffness Control and Other User-Friendly Features

ReturnValue

Description

Positive integer

Successful coordinate setting
Set coordinate ID (101 - 200)

-1

Failed coordinate setting

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Example1
2
3
4

pos1 = posx(10, 20, 30, 0, 0, 0)
pos2 = posx(30, 50, 70, 45, 180, 45)
user_id1 = set_user_cart_coord(pos1, ref=DR_BASE)
user_id2 = set_user_cart_coord(pos2, ref=DR_WORLD)

Related commands• set_ref_coord(coord)(p. 52)

6.2.8 set_user_cart_coord(x1, x2, x3, pos, ref)FeaturesThis function sets a new user cartesian coordinate system using [x1], [x2], and [x3] based on ref coordinate
system[ref]. Creates a user coordinate system with ux, uy, and uz as the vector for each axis and origin positionis the position of [pos] based on [ref]. 1)ux is defined as the unit vector of x1x2 , uz is defined as the unit vector
defined by the cross product of x1x2 and x1x3 (x1x2 cross x1x3). uy is can be determined by right hand rule (uzcross ux). Up to 100 user coordinate systems can be set including the coordinate systems set within Workcell- 211 -

Programming manual(V2.10)

Force/Stiffness Control and Other User-Friendly Features

Item. Since the coordinate system set by this function is removed when the program is terminated, setting newcoordinate systems within Workcell Item is recommended for maintaining the coordinate information.
1)

In software versions lower than M2.0.2, ux is used as the unit vector of x2x1

Parameters
Parameter Name

Data TypeDefault Value

Description

x1

Posx

-

posx orposition list-

posx orposition list-

posx orposition list-

posx orposition list

DR_BASEreference coordinate

list (float[6])x2Posxlist (float[6])

x3

Posx
list (float[6])

pos

Posx
list (float[6])

ref

int

• DR_BASE: base coordinate• DR_WORLD: world
coordinate

ReturnValue

Description

Positive integer

Successful coordinate setting
Set coordinate ID (101 - 200)

-1

Failed coordinate setting- 212 -

Programming manual(V2.10)

Force/Stiffness Control and Other User-Friendly Features

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6
7

x1 = posx(0, 500, 700, 0, 0, 0) # Ignores the Euler angle.
x2 = posx(500, 0, 700, 0, 0, 0)x3 = posx(300, 100, 500, 0, 0, 0)x4 = posx(300, 110, 510, 0, 0, 0)
pos = posx(10, 20, 30, 0, 0, 0)
user_tc1 = set_user_cart_coord(x1, x2, x3, pos, ref=DR_BASE)
user_tc2 = set_user_cart_coord(x2, x3, x4, pos, ref=DR_WORLD)

Related commands• set_ref_coord(coord)(p. 52)

6.2.9 set_user_cart_coord(u1, v1, pos, ref)FeaturesThis function sets a new user cartesian coordinate system using [u1] and [v1] based on [ref] coordinate system.
The origin position the position of [pos] based on the [ref] coordinate while the direction of x-axis and y-axis
bases are given in the vectors u1 and v1, respectively. Other directions are determined by u1 cross v1. If u1 andv1 are not orthogonal, v1’, that is perpendicular to u1 on the surface spanned by u1 and v1, is set as the vector
in the y-axis direction. Up to 100 user coordinate systems can be set including the coordinate systems set within
Workcell Item. Since the coordinate system set by this function is removed when the program is terminated,setting new coordinate systems within Workcell Item is recommended for maintaining the coordinate
information.

- 213 -

Programming manual(V2.10)

Force/Stiffness Control and Other User-Friendly Features

Parameters
Parameter Name

Data TypeDefault Value

Description

u1

float[3]-X-axis unit vector

v1

float[3]-Y-axis unit vector

pos

posx

-

posx orlist (float[6])
ref

int

position list
DR_BASEreference coordinate• DR_BASE: basecoordinate• DR_WORLD: world
coordinate

ReturnValue

Description

Positive integer

Successful coordinate setting
Set coordinate ID (101 - 200)

-1

Failed coordinate setting

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Example1

u1 = [1, 1, 0]- 214 -

Programming manual(V2.10)

Force/Stiffness Control and Other User-Friendly Features

2
3
4
5

v1 = [-1, 1, 0]
pos = posx(10, 20, 30, 0, 0, 0)
user_tc1 = set_user_cart_coord(u1, v1, pos)user_tc2 = set_user_cart_coord(u1, v1, pos, ref=DR_WORLD)

Related commands• set_ref_coord(coord)(p. 52)

6.2.10 overwrite_user_cart_coord(id, pos, ref, apply_mod)
FeaturesThis function changes the pose and reference coordinate system of the requested user coordinate system [id]with the [pos] and [ref], respectively.

Parameters
Parameter Name

Data TypeDefault Value

Description

id

int

-

coordinate ID

pos

posx

-

posx orlist (float[6])
ref

int

position list
DR_BASEreference coordinate• DR_BASE: basecoordinate• DR_WORLD: world
coordinate

apply_mod

int

DR_TEMPORARY

DR_TEMPORARY(0) : Valid
only during program
execution
DR_PERMANENT(1) : Valideven after program ends

information
If apply_mod is 0, the user coordinate system is changed and maintained only when the program is
executed, and if it is 1, the user coordinate system information stored in the host controller itself ischanged.

- 215 -

Programming manual(V2.10)

Force/Stiffness Control and Other User-Friendly Features

ReturnValue

Description

Positive integer

Successful coordinate setting
Set coordinate ID (101 - 200)

-1

Failed coordinate setting

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Exception
1
2
3
4
5
6

pose_user1 = posx(30, 40, 50, 0, 0, 0)
id_user = set_user_cart_coord(pose_user1, ref=DR_BASE)
pose_user2 = posx(100, 150, 200, 45, 180, 0)
overwrite_user_cart_coord(id_user, pose_user2, ref=DR_BASE)
pose_user3 = posx(100, 150, 200, 45, 180, 0)
overwrite_user_cart_coord(id_user, pose_user3, ref=DR_BASE, apply_mod=DR_P
ERMANENT)

Related commands• set_user_cart_coord(pos, ref)(p. 210)
• set_user_cart_coord(u1, v1, pos, ref)(p. 213)
• set_user_cart_coord(x1, x2, x3, pos, ref)(p. 211)6.2.11 get_user_cart_coord(id)FeaturesThis function returns the pose and reference coordinate system of the requested user coordinate system [id].

- 216 -

Programming manual(V2.10)

Force/Stiffness Control and Other User-Friendly Features

Parameters
Parameter Name

Data TypeDefault Value

Description

id

int

-

coordinate ID

ReturnValue

Description

posx

Position and orientation information of thecoordinate to get

refReference coordinate of the coordinate to get

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Example1
2
3

pose_user1 = posx(10, 20, 30, 0, 0, 0)
id_user = set_user_cart_coord(pose_user1, ref=DR_BASE)
pose, ref = get_user_cart_coord(id_user)

Related commands• set_user_cart_coord(pos, ref)(p. 210)
• set_user_cart_coord(u1, v1, pos, ref)(p. 213)
• set_user_cart_coord(x1, x2, x3, pos, ref)(p. 211)

- 217 -

Programming manual(V2.10)

Force/Stiffness Control and Other User-Friendly Features

6.2.12 check_position_condition(axis, min, max, ref, mod, pos)
FeaturesThis function checks the status of the given position. This condition can be repeated with the while or if
statement. Axis and pos of input paramets are based on the ref coordinate.
In case of ref=DR_TOOL, pos should be defined in BASE coordinate.

Parameters
Parameter Name

Data TypeDefault Value

Description

axis

int

-

axis
• DR_AXIS_X: x-axis• DR_AXIS_Y: y-axis• DR_AXIS_Z: z-axis

min

float

DR_COND_NONE

Minimum value

max

float

DR_COND_NONE

Maximum value

ref

int

None

reference coordinate• DR_BASE : basecoordinate• DR_WORLD : world
coordinate• DR_TOOL : tool
coordinate• user coordinate:
User defined

mod

int

DR_MV_MOD_ABS

Movement basis• DR_MV_MOD_ABS:
Absolute• DR_MV_MOD_REL:
Relative

pos

posx

-

list (float[6])posx orposition list

Note
• The absolution position is used if the mod is DR_MV_MOD_ABS.

- 218 -

Programming manual(V2.10)

Force/Stiffness Control and Other User-Friendly Features• The pos position is used if the mod is DR_MV_MOD_REL.
• Pos is meaningful only if the mod is DR_MV_MOD_REL.

ReturnValue

Description

True

The condition is True.

False

The condition is False.

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6
7
8
9
10
11

CON1= check_position_condition(DR_AXIS_X, min=-5, max=0, ref=DR_WORLD)
CON2= check_position_condition(DR_AXIS_Y, max=700)
CON3= check_position_condition(DR_AXIS_Z, min=-10, max=-5) # -10≤z≤-5
CON4= check_position_condition(DR_AXIS_Z, min=30) # 30≤z
CON5= check_position_condition(DR_AXIS_Z,min=-10,max=-5, ref=DR_BASE) #-10≤z≤-5
CON6= check_position_condition(DR_AXIS_Z,min=-10,max=-5, mod=DR_MV_MOD_ABS) # -10≤z≤-5
posx1 = posx(400, 500, 800, 0, 180,0)
CON7= check_position_condition(DR_AXIS_Z,min=-10,max=-5,mod =DR_MV_MOD_REL, pos=posx1) # posx1_(z)-10≤z≤ posx1_(z)-5

Related commands• check_force_condition(axis, min, max, ref)(p. 220)• check_orientation_condition(axis, min, max, ref, mod)(p. 222)

- 219 -

Programming manual(V2.10)

Force/Stiffness Control and Other User-Friendly Features• check_orientation_condition(axis, min, max, ref, mod, pos)(p. 224)
• set_ref_coord(coord)(p. 52)

6.2.13 check_force_condition(axis, min, max, ref)FeaturesThis function checks the status of the given force. It disregards the force direction and only compares the sizes.
This condition can be repeated with the while or if statement. Measuring the force and 1)moment, axis is basedon the ref coordinate.
1)

Before V2.8 software version, measuring the moment, axis is based on the tool coordinate.

Parameters
Parameter Name

Data TypeDefault Value

Description

axis

int

-

axis
• DR_AXIS_X: x-axis• DR_AXIS_Y: y-axis• DR_AXIS_Z: z-axis• DR_AXIS_A: x-axis
rotation• DR_AXIS_B: y-axis
rotation• DR_AXIS_C: z-axis
rotation

min

float

DR_COND_NONE

Minimum value (min ≥ 0)

max

float

DR_COND_NONE

Maximum value (max ≥ 0)

ref

int

None

reference coordinate• DR_BASE : basecoordinate• DR_WORLD : world
coordinate• DR_TOOL : tool
coordinate• user coordinate:
User defined- 220 -

Programming manual(V2.10)

Force/Stiffness Control and Other User-Friendly Features

ReturnValue

Description

True

The condition is True.

False

The condition is False.

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6
7
8

fcon1 = check_force_condition(DR_AXIS_Z, min=5, max=10, ref=DR_WORLD)# 5 ≤f_z≤10
while (fcon1):
fcon2 = check_force_condition(DR_AXIS_C, min=30)
pcon1 = check_position_condition(DR_AXIS_X, min=0, max=0.1)# 30≤m_z# 0≤x≤0.1

if (fcon2 and pcon1):
break

Related commands• check_position_condition(axis, min, max, ref, mod, pos)(p. 218)• check_orientation_condition(axis, min, max, ref, mod)(p. 222)• check_orientation_condition(axis, min, max, ref, mod, pos)(p. 224)
• set_ref_coord(coord)(p. 52)- 221 -

Programming manual(V2.10)

Force/Stiffness Control and Other User-Friendly Features

6.2.14 check_orientation_condition(axis, min, max, ref, mod)FeaturesThis function checks the difference between the current pose and the specified pose of the robot end effector. It
returns the difference between the current pose and the specified pose in rad with the algorithm thattransforms it to a rotation matrix using the "AngleAxis" technique. It returns True if the difference is positive (+)
and False if the difference is negative (-). It is used to check if the difference between the current pose and therotating angle range is + or -. For example, the function can use the direct teaching position to check if thedifference from the current position is + or - and then create the condition for the orientation limit. Thiscondition can be repeated with the while or if statement• Setting Min only: True if the difference is + and False if • Setting Min and Max: True if the difference from min is - while the difference from max is + and False
otherwise• Setting Max only: True if the maximum difference is + and False otherwise

Parameters
Parameter Name

Data TypeDefault Value

Description

axis

int

-

axis
• DR_AXIS_A: x-axis rotation• DR_AXIS_B: y-axis rotation• DR_AXIS_C: z-axis rotation

min

posx

-

posx orposition list

list (float[6])- 222 -

Programming manual(V2.10)

Force/Stiffness Control and Other User-Friendly Features

Parameter Name

Data TypeDefault Value

Description

max

posx

-

posx orposition list

list (float[6])
ref

int

None

reference coordinate• DR_BASE : base coordinate• DR_WORLD : world
coordinate• DR_TOOL : tool coordinate• user coordinate: User defined

mod

int

DR_MV_MOD_ABS

Movement basis• DR_MV_MOD_ABS: Absolute

ReturnValue

Description

True

The condition is True.

False

The condition is False.

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Example1
2
3
4

posx1 = posx(400,500,800,0,180,30)
posx2 = posx(400,500,500,0,180,60)
CON1= check_orientation_condition(DR_AXIS_C, min=posx1, max= posx2)- 223 -

Programming manual(V2.10)

Force/Stiffness Control and Other User-Friendly Features

5
6
7
8
9
10
11
12
13
14

# If the current task coordinate posxc = posx(400, 500, 500, 0, 180, 40)# CON1=True since posx1 Rz=30 < posxc Rz=40 < posx2 Rz=60
CON2= check_orientation_condition(DR_AXIS_C, min=posx1)# If the current task coordinate posxc = posx(400, 500, 500, 0, 180, 15)# CON2=False since posx1 Rz=30 > posxc Rz=15
CON3= check_orientation_condition(DR_AXIS_C, max= posx2)# If the current task coordinate posxc = posx(400, 500, 500, 0, 180, 75)# CON2=False since posx1 Rz=75 > posxc Rz=60

Related commands• check_position_condition(axis, min, max, ref, mod, pos)(p. 218)• check_force_condition(axis, min, max, ref)(p. 220)• check_orientation_condition(axis, min, max, ref, mod)(p. 222)• check_orientation_condition(axis, min, max, ref, mod, pos)(p. 224)
• set_ref_coord(coord)(p. 52)

6.2.15 check_orientation_condition(axis, min, max, ref, mod, pos)
FeaturesThis function checks the difference between the current pose and the rotating angle range of the robot end
effector. It returns the difference (in rad) between the current pose and the rotating angle range with thealgorithm that transforms it to a rotation matrix using the "AngleAxis" technique. It returns True if the differenceis positive (+) and False if the difference is negative (-). It is used to check if the difference between the current
pose and the rotating angle range is + or -. For example, the function can be used to set the rotating angle range
to min and max at any reference position, and then determine the orientation limit by checking if the difference
from the current position is + or -. This condition can be repeated with the while or if statement• Setting Min only: True if the difference is + and False if • Setting Min and Max: True if the difference from min is - while the difference from max is + and False if the
opposite.
• Setting Max only: True if the maximum difference is + and False otherwise- 224 -

Programming manual(V2.10)

Force/Stiffness Control and Other User-Friendly Features

Note
Range of rotating angle: Refers to the relative angle range (min, max) basded on the set axis from thegiven position. The reference coordinate is defined according to the given position based on ref.

Parameters
Parameter Name

Data TypeDefault Value

Description

axis

int

-

axis
• DR_AXIS_X: x-axis rotation• DR_AXIS_Y: y-axis rotation• DR_AXIS_Z: z-axis rotation

min

float

DR_COND_NONE

Minimum value

max

float

DR_COND_NONE

Maximum value

ref

int

None

reference coordinate• DR_BASE : base coordinate• DR_WORLD : world coordinate• DR_TOOL : tool coordinate• user coordinate: User defined

mod

int

DR_MV_MOD_REL

Movement basis• DR_MV_MOD_REL: Relative

pos

posx

-

posx orposition list

- 225 -

Programming manual(V2.10)

Force/Stiffness Control and Other User-Friendly Features

Parameter Name

Data TypeDefault Value

Description

list (float[6])ReturnValue

Description

True

The condition is True.

False

The condition is False.

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6
7
8

posx1 = posx(400,500,800,0,180,15)
CON1= check_orientation_condition(DR_AXIS_C, min=-5, mod=DR_MV_MOD_REL,
pos=posx1, DR_WORLD)# If the current task coordinate posxc = posx(400, 500, 500, 0, 180, 40)# CON1=True since posx1 Rz=15 – (min=5) < posxc Rz=40
CON1= check_orientation_condition(DR_AXIS_C, max=5, mod=DR_MV_MOD_REL, pos=p
osx1)# If the current task coordinate posxc = posx(400, 500, 500, 0, 180, 40)# CON1=False since posxc Rz=40 > posx1 Rz=15 + (max=5)

Related commands• check_position_condition(axis, min, max, ref, mod, pos)(p. 218)• check_force_condition(axis, min, max, ref)(p. 220)• check_orientation_condition(axis, min, max, ref, mod)(p. 222)

- 226 -

Programming manual(V2.10)

Force/Stiffness Control and Other User-Friendly Features• check_orientation_condition(axis, min, max, ref, mod, pos)(p. 224)
• set_ref_coord(coord)(p. 52)

6.2.16 coord_transform(pose_in, ref_in, ref_out)
FeaturesThis function transforms given task position expressed in reference coordinate, ‘ref_in’ to task position
expressed in reference coordinate, ‘ref_out’. It returns transformed task position. It supports calculation of
coordinate transformation for the following cases.
• (ref_in) world reference coordinate → (ref_out) world reference coordinate• (ref_in) world reference coordinate → (ref_out) base reference coordinate• (ref_in) world reference coordinate → (ref_out) tool reference coordinate• (ref_in) world reference coordinate → (ref_out) user reference coordinate• (ref_in) base reference coordinate → (ref_out) base reference coordinate• (ref_in) base reference coordinate → (ref_out) tool reference coordinate• (ref_in) base reference coordinate → (ref_out) user reference coordinate• (ref_in) tool reference coordinate → (ref_out) world reference coordinate• (ref_in) tool reference coordinate → (ref_out) base reference coordinate• (ref_in) tool reference coordinate → (ref_out) tool reference coordinate• (ref_in) tool reference coordinate → (ref_out) user reference coordinate• (ref_in) user reference coordinate → (ref_out) world reference coordinate• (ref_in) user reference coordinate → (ref_out) base reference coordinate• (ref_in) user reference coordinate → (ref_out) tool reference coordinate• (ref_in) user reference coordinate → (ref_out) user reference coordinate

Parameters
Parameter Name

Data TypeDefault Value

Description

pose_in

posx

-

posx

ref_infloat

DR_COND_NONE

reference coordinate before
transformation• DR_BASE : basecoordinate• DR_WORLD : world
coordinate• DR_TOOL : tool
coordinate• user coordinate: User
defined- 227 -

Programming manual(V2.10)

Force/Stiffness Control and Other User-Friendly Features

Parameter Name

Data TypeDefault Value

Description

ref_out

float

DR_COND_NONE

reference coordinate after
transformation• DR_BASE : basecoordinate• DR_WORLD world
coordinate• DR_TOOL : tool
coordinate• user coordinate: User
definedReturnValue

Description

pos

posx

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6

base_pos = posx(400,500,800,0,180,15)# If task position based on base reference coordinate base_pos =posx(400,500,800,0,180,15)
tool_pos = coord_transform(base_pos, DR_BASE, DR_TOOL)# Transform task position(base_pos) expressed in base reference coordinate
to task position expressed in tool reference coordinate# This command returns task position expressed in tool reference
coordinate and the result value is stored in tool_pos- 228 -

Programming manual(V2.10)

Force/Stiffness Control and Other User-Friendly Features

Related commands• set_user_cart_coord(pos, ref)(p. 210)
• set_user_cart_coord(u1, v1, pos, ref)(p. 213)
• set_user_cart_coord(x1, x2, x3, pos, ref)(p. 211)
• get_current_posx(ref)(p. 156)
• get_desired_posx(ref)(p. 165)
• set_ref_coord(coord)(p. 52)- 229 -

Programming manual(V2.10)

System Commands

7 System Commands
7.1 IO Related
7.1.1 set_digital_output(index, val =None)
FeaturesThis function sends a signal at the digital contact point of the controller. A value saved in the digital output
register is output as a digital signal.

Parameters
Parameter Name

Data TypeDefault Value

Description

index

int

-

I/O contact number mounted
on the controller• Val argument existing: A
number between 1 and
16• No val argument: 1 ~ 16 ,-1 ~ -16(A positive number means ON
while a negative number means
OFF.)

val

int

-

I/O value• ON: 1
• OFF: 0Note
If val is omitted, positive numbers become ON and negative numbers become OFF depending on thesign (+/-) of the index.

ReturnValue

Description0

Success- 230 -

Programming manual(V2.10)

System Commands

Value

Description

Negative value

FailedException
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Example1
2
3
4

set_digital_output(1, ON)# No. 1 contact ON
set_digital_output(16, OFF) # No. 16 contact OFF
set_digital_output(3)#No. 3 contact ON (A positive number means ON
if the argument val is omitted.)
set_digital_output(-3)#No. 3 contact OFF (A negative number means
OFF if the argument val is omitted.)

7.1.2 set_digital_outputs(bit_list)
FeaturesThis function sends a signal to multiple digital output contact points of the controller.
The digital signals of the contact points defined in bit_list are output at one.

Parameters
Parameter Name

Data TypeDefault
Value

Description

bit_list

list (int)-

List of multiple output contacts• The positive contact number outputs ON: 1~16
• The negative contact number outputs OFF:-1~-16- 231 -

Programming manual(V2.10)

System Commands

ReturnValue

Description0

Success

Negative value

FailedException
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example1
2
3
4

set_digital_outputs(bit_list=[1,2,3,4,5,6,7,8]) # Contact number 1-8 ON
set_digital_outputs([-1,-2,-3,-4,-5,-6,-7,-8])# Contact number 1-8 OFF
set_digital_outputs([1,-2,3])# Contact no. 1 ON, no. 2 OFF,and no. 3 ON
set_digital_outputs([4,-9,-12])# Contact no. 4 ON, no. 9 OFF,and no. 12 OFF

7.1.3 set_digital_outputs(bit_start, bit_end, val)
FeaturesThis function sends multiple signals at once from the digital output start contact point (bit_start) to the end
contact point (bit_end) of the controller.

- 232 -

Programming manual(V2.10)

System Commands

Parameters
Parameter Name

Data TypeDefault
Value

Description

bit_start

int-

Beginning contact number for output signal (1~16)

bit_endint-

Ending contact number for output signal (1~16)

val

int

-

Output value

Note• Bit_end must be a larger number than bit_start.
• Val is the value of the combination of bits where bit_start =LSB and bit_end=MSB.
Ex) bit_start =1, bit_end=4, val=0b1010 # No. 4=ON, no. 3=OFF, no. 2=ON, and no. 1=OFF

ReturnValue

Description0

Success

Negative value

FailedException
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully- 233 -

Programming manual(V2.10)

System Commands

Example
1
2
3
4
5
6
7
8

# Outputs contact 1=ON, contact 2=ON, contact 3=OFF, and contact 4=OFF.
set_digital_outputs(bit_start=1, bit_end=4, val=0b0011) # 0b means abinary number.
# Outputs contact 3=ON and contact 4=OFF.
set_digital_outputs(bit_start=3, bit_end=4, val=0b01) # 0b means a binary
number.
# Outputs the ON signal from contacts 1 through 8.
set_digital_outputs(1, 8, 0xff)
hexadecimal number.

# 0x means a

7.1.4 set_digital_output(index, val=None, time=None, val2=None)
FeaturesThis function sends a signal at the digital contact point of the controller. A value saved in the digital output
register is output as a digital signal. After sending out the specified signal for the set time, the next signal is sentout.

Parameters
Parameter Name

Data TypeDefault
Value

Description

index

int

-

I/O contact number mounted on the controller• Val argument existing: A number between 1 and
16• No val argument: 1 ~ 16 , -1 ~ -16(A positive number means ON while a negative number
means OFF.)

val

int

-

I/O value• ON: 1
• OFF: 0

time

float

-

Time(0.01 ~ 3,000,000)

val2

int

-

I/O value• ON: 1
• OFF: 0- 234 -

Programming manual(V2.10)

System Commands

Note
If val is omitted, the positive number becomes ON and the negative number OFF according to the sign of
the argument index.

ReturnValue

Description0

Success

Negative value

FailedException
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Example1
2

set_digital_output(1, ON, 2.0, OFF) # No. 1 contact ON, OFF after 2
seconds
set_digital_output(5, OFF, 0.5, OFF)# No. 16 contact OFF, ON after 0.5
seconds

7.1.5 get_digital_input(index)
FeaturesThis function reads the signals from digital contact points of the controller and reads the digital input contact
value.

- 235 -

Programming manual(V2.10)

System Commands

Parameters
Parameter Name

Data TypeDefault Value

Description

index

int

-

A number 1 - 16 which means the contact number of I/
O mounted on the controller.

ReturnValue

Description

1

ON

0

OFF

Negative value

FailedException
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example12

in1 = get_digital_input(1)in8 = get_digital_input(8)# Reads the no. 1 contact# Reads the no. 8 contact- 236 -

Programming manual(V2.10)

System Commands

7.1.6 get_digital_inputs(bit_list)
FeaturesThis function reads the signals from multiple digital contact points of the controller. The digital signals of thecontact points defined in bit_list are input at one.

Parameters
Parameter Name

Data TypeDefault
Value

Description

index

list (int)-

List of contact points to readA number 1-16 which means the I/O contact number
mounted on the controller.

ReturnValue

Description

int (>=0)

Multiple contacts to be read at once(the value of the combination of the bit list where bit_start =LSB and bit_end=MSB)

Negative number

FailedException
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully- 237 -

Programming manual(V2.10)

System Commands

Example
1
2
3
4
5
6
7

# input contacts: No. 1=OFF, No. 2=OFF, No. 3=ON, and No. 4=ON
res = get_digital_inputs(bit_list=[1,2,3,4])#res expected value = 0b1100 (binary number), 12 (decimal number), or 0x0C
(hexadecimal number)# input contacts: No. 5=ON, No. 6=ON, No. 7=OFF, and No. 8=ON
res = get_digital_inputs([5,6,7,8])#res expected value = 0b1011 (binary number), 11 (decimal number), or 0x0B
(hexadecimal number)

7.1.7 get_digital_inputs(bit_start, bit_end)
FeaturesThis function reads multiple signals at once from the digital input start contact point (start_index) to the end
contact point (end_index) of the controller.

Parameters
Parameter Name

Data TypeDefault
Value

Description

bit_start

int-

Beginning contact number for input signals (1-16)

bit_endint-

Ending contact number for input signals (1-16)

Note
Bit_end must be a larger number than bit_start.

ReturnValue

Description

int (>=0)

Multiple contacts to be read at once
Value of the combination of bits where bit_start =LSB and bit_end=MSB.

Negative number

Failed- 238 -

Programming manual(V2.10)

System Commands

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example1
2
3# input contacts: No. 1=OFF, No. 2=OFF, No. 3=ON, and No. 4=ON
res = get_digital_inputs(bit_start=1, bit_end=4)#res expected value = 0b1100 (binary number), 12 (decimal number), or 0x0C
(hexadecimal number)

7.1.8 wait_digital_input(index, val, timeout=None)
FeaturesThis function waits until the signal value of the digital input register of the controller becomes val (ON or OFF).
The waiting time can be changed with a timeout setting. The waiting time ends, and the result is returned if the
waiting time has passed. This function waits indefinitely if the timeout is not set.

Parameters
Parameter Name

Data TypeDefault
Value

Description

index

int

-

A number 1 - 16 which means the I/O index mounted on
the controller.

- 239 -

Programming manual(V2.10)

System Commands

Parameter Name

Data TypeDefault
Value

Description

value

int

-

I/O value• ON : 1• OFF : 0

timeout

float-

Waiting time (sec)This function waits indefinitely if the timeout is not set.

ReturnValue

Description0

Success-1

Failed (time-out)

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example1
2
3

wait_digital_input(1, ON) # Indefinite wait until the no. 1 contact
becomes ON
wait_digital_input(2, OFF) # Indefinite wait until the no. 2 contact
becomes OFF
res = wait_digital_input(1, ON, 3) # Wait for up to 3 seconds until theno. 1 contact becomes ON- 240 -

Programming manual(V2.10)

System Commands

4
5# Waiting is terminated and res = 0 if the no. 1 contact becomes ON
within 3 seconds.
# Waiting is terminated and res = -1 if the no. 1 contact does not
become ON within 3 seconds.

7.1.9 set_tool_digital_output(index, val=None)
FeaturesThis function sends the signal of the robot tool from the digital contact point.
Caution
Depending on the robot model or flange board version, the range of theindex parameter may change.

Parameters
Parameter Name

Data TypeDefault
Value

Description

index

int

-

I/O contact number mounted on the robot arm• Val argument existing: A number between 1 and 6• No val argument: 1 ~ 6 , -1 ~ -6
(A positive number means ON while a negative number
means OFF.)

val

int

-

I/O value: The value to output

Note
If val is omitted, positive numbers become ON and negative numbers become OFF depending on thesign (+/-) of the index.

ReturnValue

Description0

Success

Negative value

Error- 241 -

Programming manual(V2.10)

System Commands

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example1
2
3
4

set_tool_digital_output(1, ON) # Sets the no. 1 contact of the robot arm
ON
set_tool_digital_output(6, OFF) # Sets the no. 6 contact of the robot arm
OFF
set_tool_digital_output(3#No. 3 contact ON (A positive number means
ON if the argument val is omitted.)
set_tool_digital_output(-3)#No. 3 contact OFF (A negative number
means OFF if the argument val is omitted.)

7.1.10 set_tool_digital_outputs(bit_list)
FeaturesThis function sends the signal of the robot tool from the digital contact point. The digital signals of the contact
points defined in bit_list are output at one.

Parameters
Parameter Name

Data TypeDefault
Value

Description

bit_list

list (int)-

List of multiple output contacts• The positive contact number outputs ON: 1~6• The negative contact number outputs OFF: -1~-6- 242 -

Programming manual(V2.10)

System Commands

ReturnValue

Description0

Success

Negative value

Error

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example1
2
3

set_tool_digital_outputs(bit_list=[1,2,3,4,5,6])# Sets the contacts
1-6 ON
set_tool_digital_outputs([-1,-2,-3,-4,-5,-6])# Sets the contacts
1-6 OFF
set_digital_outputs([1,-2,3])# Contact no. 1 ON, no. 2 OFF,and no. 3 ON

7.1.11 set_tool_digital_outputs(bit_start, bit_end, val)
FeaturesThis function sends the signal of the robot tool from the digital contact point. The multiple signals from the firstcontact point (bit_start) to the last contact point (bit_end) are output at one.

- 243 -

Programming manual(V2.10)

System Commands

Parameters
Parameter
Name

Data
Type

Default
Value

Description

bit_start

int-

Beginning contact number for output signal (1~6)

bit_endint-

Ending contact number for output signal (1~6)

Val

int

-

Output value

Note• Bit_end must be a larger number than bit_start.
• Val is the value of the combination of bits where bit_start =LSB and bit_end=MSB.
Ex) bit_start =1, bit_end=4, val=0b1010 # No. 4=ON, no. 3=OFF, no. 2=ON, and no. 1=OFF

ReturnValue

Description0

Success

Negative value

Error

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully- 244 -

Programming manual(V2.10)

System Commands

Example
1
2
3
4
5
6
7
8

# Outputs contact 1=ON, contact 2=ON, contact 3=OFF, and contact 4=OFF.
set_tool_digital_outputs(bit_start=1, bit_end=4, val=0b0011) # 0b means abinary number.
# Outputs contact 3=ON and contact 4=OFF.
set_tool_digital_outputs(bit_start=3, bit_end=4, val=0b01) # 0b means abinary number.
# Outputs the ON signal from contacts 1 through 8.
set_tool_digital_outputs(1, 8, 0xff)
hexadecimal number.

# 0x means a

7.1.12 set_tool_digital_output(index, val=None, time=None, val2=None)
FeaturesThis function sends the signal of the robot tool from the digital contact point. After sending out the specified
signal for the set time, the next signal is sent out.
Caution
Depending on the robot model or flange board version, the range of theindex parameter may change.

Parameters
Parameter Name

Data TypeDefault Value

Description

index

int

-

I/O contact number mounted on the robot arm• Val argument existing: A number between 1 and
6• No val argument: 1 ~ 6 , -1 ~ -6
(A positive number means ON while a negative number
means OFF.)

val

int

-

I/O value• ON: 1
• OFF: 0

time

float

-

Time(0.01 ~ 3,000,000)- 245 -

Programming manual(V2.10)

System Commands

Parameter Name

Data TypeDefault Value

Description

val2

int

-

I/O value• ON: 1
• OFF: 0Note
If val is omitted, the positive number becomes ON and the negative number OFF according to the sign of
the argument index.

ReturnValue

Description0

Success

Negative value

Error

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example1

set_tool_digital_output(1, ON, 2.0, OFF)the robot arm ON, OFF after 2 seconds- 246 -

# Sets the no. 1 contact ofProgramming manual(V2.10)

System Commands

2

set_tool_digital_output(5, OFF, 0.5, ON)
the robot arm OFF, ON after 0.5 seconds# Sets the no. 5 contact of

7.1.13 get_tool_digital_input(index)
FeaturesThis function reads the signal of the robot tool from the digital contact point.

Parameters
Parameter Name

Data TypeDefault
Value

Description

index

int

-

I/O contact number (1-6) mounted on the robot tool

ReturnValue

Description

1

ON

0

OFF

Negative value

FailedException
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully- 247 -

Programming manual(V2.10)

System Commands

Example12

get_tool_digital_input(1)get_tool_digital_input(6)# Reads the no. 1 contact of tool I/O# Reads the no. 6 contact of tool I/O

7.1.14 get_tool_digital_inputs(bit_list)
FeaturesThis function reads the signal of the robot tool from the digital contact point.
The digital signals of the contact points defined in bit_list are input at one.

Parameters
Parameter Name

Data TypeDefault Value

Description

bit_list

list (int)-

List of contact points to read
• (I/O contact numbers(1-6) mounted on the
robot arm)

ReturnValue

Description

int (>=0)

Multiple contacts to be read at once (the value ofthe combination of the bit list where bit_start =LSBand bit_end=MSB)

Negative number

FailedException
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred- 248 -

Programming manual(V2.10)

System Commands

Exception

Description

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6
7

# input contacts: No. 1=OFF, No. 2=OFF, and No. 3=ON
res = get_tool_digital_inputs(bit_list=[1,2,3]) # Reads the contacts 1, 2,
and 3 at once.
#res expected value = 0b100 (binary number), 4 (decimal number), or 0x04
(hexadecimal number)# input contacts: No. 4=ON, No. 5=ON, and No. 6=OFF
res = get_tool_digital_inputs([4,5,6])#res expected value = 0b011 (binary number), 3 (decimal number), or 0x03
(hexadecimal number)

7.1.15 get_tool_digital_inputs(bit_start, bit_end)
FeaturesThis function reads the signal of the robot tool from the digital contact point. The multiple signals from the firstcontact point (start_index) to the last contact point (end_index) are input at one.

Parameters
Parameter Name

Data TypeDefault
Value

Description

bit_start

int-

Beginning contact number for input signals (1~6)

bit_endint-

Ending contact number for input signals (1~6)

ReturnValue

Description

int (>=0)

Multiple contacts to be read at once
Value of the combination of bits where bit_start =LSB and bit_end=MSB.

Negative number

Failed- 249 -

Programming manual(V2.10)

System Commands

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6
7

# input contacts: No. 1=OFF, No. 2=OFF, and No. 3=ON
res = get_tool_digital_inputs(bit_start=1, bit_end=3)#res expected value = 0b100 (binary number), 4 (decimal number), or 0x04
(hexadecimal number)# input contacts: No. 4=ON, No. 5=ON, and No. 6=OFF
res = get_tool_digital_inputs(4, 6)#res expected value = 0b011 (binary number), 3 (decimal number), or 0x03
(hexadecimal number)

7.1.16 wait_tool_digital_input(index, val, timeout=None)
FeaturesThis function waits until the digital input signal value of the robot tool becomes val (ON or OFF). The waitingtime can be changed with a timeout setting. The waiting time ends, and the result is returned if the waiting time
has passed. This function waits indefinitely if the timeout is not set.

- 250 -

Programming manual(V2.10)

System Commands

Parameters
Parameter Name

Data TypeDefault
Value

Description

index

int

-

A number in 1 - 6 which means the I/O index mounted
on the robot arm

value

int

-

I/O value• ON : 1• OFF : 0

timeout

float-

Waiting time (sec)This function waits indefinitely if the timeout is not set.

ReturnValue

Description0

Success-1

Failed (time-out)

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully- 251 -

Programming manual(V2.10)

System Commands

Example
1
2
3
4
5
6

wait_tool_digital_input(1, ON) # Indefinite wait until the no. 1 contact
becomes ON
wait_tool_digital_input(2, OFF) # Indefinite wait until the no. 2 contact
becomes OFF
res = wait_tool_digital_input(1, ON, 3) # Wait for up to 3 seconds until
the no. 1 contact becomes ON# Waiting is terminated and res = 0 if the no. 1 contact becomes ON
within 3 seconds.
# Waiting is terminated and res = -1 if the no. 1 contact does not
become ON within 3 seconds.

7.1.17 set_mode_analog_output(ch, mod )FeaturesThis function sets the channel mode of the controller analog output.

Parameters
Parameter Name

Data Type

Defau
lt
Value

ch

int

-

mod

int

-

Description• 1 : channel 1• 2 : channel 2
analog io mode
• DR_ANALOG_CURRENT: Current mode
• DR_ANALOG_VOLTAGE: Voltage mode

ReturnValue

Description0

Success

Negative value

Failed- 252 -

Programming manual(V2.10)

System Commands

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example12
3
45# Sets analog_output channel 1 to the current mode.
set_mode_analog_output(ch=1, mod=DR_ANALOG_CURRENT)# Sets analog_output channel 2 to the voltage mode.
set_mode_analog_output(ch=2, mod=DR_ANALOG_VOLTAGE)

7.1.18 set_mode_analog_input(ch, mod )FeaturesThis function sets the channel mode of the controller analog input.

Parameters
Parameter Name

Data TypeDefault
Value

ch

int

-

mod

int

-

Description• 1 : channel 1• 2 : channel 2
analog io mode
• DR_ANALOG_CURRENT: Current mode
• DR_ANALOG_VOLTAGE: Voltage mode

- 253 -

Programming manual(V2.10)

System Commands

ReturnValue

Description0

Success

Negative value

FailedException
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example12
3
45# Sets analog_input channel 1 to the current mode.
set_mode_analog_input(ch=1, mod=DR_ANALOG_CURRENT)# Sets analog_input channel 2 to the voltage mode.
set_mode_analog_input(ch=2, mod=DR_ANALOG_VOLTAGE)

7.1.19 set_analog_output(ch, val)
FeaturesThis function outputs the channel value corresponding to the controller analog output.

- 254 -

Programming manual(V2.10)

System Commands

Parameters
Parameter Name

Data TypeDefault
Value

Description

ch

int

-

• 1 : channel 1• 2 : channel 2

val

float

-

analog output value• Current mode: 4.0~20.0 [mA]
• Voltage mode: 0~10.0 [V]ReturnValue

Description0

Success

Negative value

FailedException
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example1
2
3

set_mode_analog_output(ch=1, mod=DR_ANALOG_CURRENT) #out ch1=current mode
set_mode_analog_output(ch=2, mod=DR_ANALOG_VOLTAGE) #out ch1=voltage mode

- 255 -

Programming manual(V2.10)

System Commands

4
5

set_analog_output(ch=1, val=5.2)
set_analog_output(ch=2, val=10.0)# Outputs 5.2 mA to channel 1# Outputs 10V to channel 2

7.1.20 get_analog_input(ch)FeaturesThis function reads the channel value corresponding to the controller analog input.

Parameters
Parameter Name

Data TypeDefault
Value

ch

int

-

Description• 1 : channel 1• 2 : channel 2

ReturnValue

Description

float

The analog input value of the specified channel• Current mode: 4.0~20.0 [mA]
• Voltage mode: 0~10.0 [V]

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully- 256 -

Programming manual(V2.10)

System Commands

Example12
345

set_mode_analog_input(ch=1, mod=DR_ANALOG_CURRENT)
mode
set_mode_analog_input(ch=2, mod=DR_ANALOG_VOLTAGE)
mode
Cur = get_analog_input(1)channel 1
Vol = get_analog_input(2)channel 2#input ch1=current#input ch2=voltage# Reads the analog input current value of# Reads the analog input voltage value of

7.1.21 set_output(port_type, index, val=None, time=None, val2=None)
FeaturesThis function sends a signal at the digital / analog contact point of the controller / flange.
Caution
Depending on the current flange board version and robot model, the parameters may change. Pleasefamiliarize yourself with the manual.

Parameters
Parameter
Name

Data TypeDefault
Value

Description

port_type

int-

type of contact point• DR_CONTROLLER_DIGITAL : 0• DR_FLANGE_DIGITAL : 1• DR_CONTROLLER_ANALOG : 2- 257 -

Programming manual(V2.10)

System Commands

Parameter
Name

Data TypeDefault
Value

Description

index

int

-

I/O contact number mounted on the controller(It also serves as a
Chnnel for the Analog output)• when the port_type is DR_CONTROLLER_DIGITAL• Val argument existing: A number between 1 and 16• No val argument: 1 ~ 16 , -1 ~ -16(A positive number
means ON while a negative number means OFF.)• when the port_type is DR_FLANGE_DIGITAL• when the model of robot is M/H with old flange• Val argument existing: A number between 1 and
6• No val argument: 1 ~ 6 , -1 ~ -6(A positive
number means ON while a negative number
means OFF.)• when the model of robot is A
• Val argument existing: A number between 1 and
2• No val argument: 1 ~ 2 , -1 ~ -2(A positive
number means ON while a negative number
means OFF.)• when the model of robot is M/H with new flange• Val argument existing: A number between 1 and
4• No val argument: 1 ~ 4, -1 ~ -4(A positive number
means ON while a negative number means OFF.)• when the port_type is DR_CONTROLLER_ANALOG• 1 ~ 2(channel)

val

float

None

I/O value• when the port_type is 0 or 1(digital)• ON : 1• OFF : 0
• when the port_type is 2(analog)• current mode : 4.00 ~ 20.00(mA)• voltage mode : 0.00 ~ 10.00(V)

time

float

None

Time information (available only if the port_type is 0, 1)• 0.01 ~ 3,000,000(sec)

val2

int

None

I/O value• ON : 1• OFF : 0Note

- 258 -

Programming manual(V2.10)

System Commands

If val is omitted, positive numbers become ON and negative numbers become OFF depending on thesign (+/-) of the index.

ReturnValue

Description0

Success

Negative value

FailedException
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Example12
3
4

set_output(1, -1) ## set_tool_digital_output(-1)
set_output(0, 2, OFF, 3, ON) ## set_digital_output(2, OFF, 3, ON)
set_mode_analog_output(ch=2, mod=DR_ANALOG_VOLTAGE) #out ch1=voltage mode
set_output(2, 1, 10.0) ## set_analog_output(2, 10)

7.1.22 get_input(port_type, index)
FeaturesThis function sends a signal at the digital / analog contact point of the controller / flange.
Caution
Depending on the current flange board version and robot model, the parameters may change. Pleasefamiliarize yourself with the manual.

- 259 -

Programming manual(V2.10)

System Commands

Parameters
Parameter Name

Data TypeDefault Value

Description

port_type

int-

type of contact point• DR_CONTROLLER_DIGITAL : 0• DR_FLANGE_DIGITAL : 1• DR_CONTROLLER_ANALOG : 2• DR_CONTROLLER_FLANGE : 3- 260 -

Programming manual(V2.10)

System Commands

Parameter Name

Data TypeDefault Value

Description

index

int

-

I/O contact number mounted on thecontroller(It also serves as a Chnnel for
the Analog output)• when the port_type is
DR_CONTROLLER_DIGITAL• Val argument existing: A
number between 1 and
16• No val argument: 1 ~16 , -1 ~ -16(A positive
number means ON
while a negative
number means OFF.)• when the port_type is
DR_FLANGE_DIGITAL• when the model ofrobot is M/H with oldflange• Val argument
existing: A
number between
1 and 6
• No val argument:
1 ~ 6 , -1 ~ -6(Apositive number
means ON whilea negative
number means
OFF.)• when the model ofrobot is A
• Val argument
existing: A
number between
1 and 2
• No val argument:
1 ~ 2 , -1 ~ -2(Apositive number
means ON whilea negative
number means
OFF.)• when the model ofrobot is M/H with newflange• Val argument
existing: A
number between
1 and 4

- 261 -

Programming manual(V2.10)

System Commands

Parameter Name

Data TypeDefault Value

Description• No val argument:
1 ~ 4, -1 ~ -4(Apositive number
means ON whilea negative
number means
OFF.)• when the port_type is
DR_CONTROLLER_ANALOG• 1 ~ 2(channel)• when the port_type is
DR_FLANGE_ANALOG(Onlyavailable on new flanges)• 1 ~ 2(A model)• 1 ~ 4(M/H model)

Note
If val is omitted, positive numbers become ON and negative numbers become OFF depending on thesign (+/-) of the index.

ReturnValue

Description

1(Digital)ON0(Digital)
OFF

float

(Analog)
Current mode : 4.0 ~ 20.0(mA)
Voltage mode : 0.0 ~ 10.0(V)

Negative value

Failed- 262 -

Programming manual(V2.10)

System Commands

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Example1
2
3

res1 = get_input(0, 1) ## get_digital_input(1)res2 = get_input(2, 1) ## get_analog_input(1)res3 = get_input(3, 1) ## get_tool_analog_input(1)7.1.23 wait_input(port_type, index, val, timeout=None, condition=None)
Features
It waits until the signal value received from the digital/analog contact of the controller/flange becomes val. The
wait time can be changed with the timeout setting, and the result is returned as soon as the wait state ends
after the specified amount of time has elapsed. However, if timeout is not set, it will wait indefinitely.
Caution
Depending on the current flange board version and robot model, the parameters may change. Pleasefamiliarize yourself with the manual.

Parameters
Parameter Name

Data TypeDefault Value

Description

port_type

int-

type of contact point• DR_CONTROLLER_DIGITAL : 0• DR_FLANGE_DIGITAL : 1• DR_CONTROLLER_ANALOG : 2• DR_FLANGE_ANALOG : 3- 263 -

Programming manual(V2.10)

System Commands

Parameter Name

Data TypeDefault Value

Description

index

int

-

I/O contact number mounted on thecontroller(It also serves as a Chnnel for the
Analog output)• when the port_type is
DR_CONTROLLER_DIGITAL• Val argument existing: A
number between 1 and 16• No val argument: 1 ~ 16 , -1 ~-16(A positive number means
ON while a negative number
means OFF.)• when the port_type is
DR_FLANGE_DIGITAL• when the model of robot is M/
H with old flange• Val argument existing:
A number between 1
and 6• No val argument: 1 ~6 , -1 ~ -6(A positive
number means ON
while a negative
number means OFF.)• when the model of robot is A
• Val argument existing:
A number between 1
and 2• No val argument: 1 ~
2 , -1 ~ -2(A positive
number means ON
while a negative
number means OFF.)• when the model of robot is M/
H with new flange• Val argument existing:
A number between 1
and 4• No val argument: 1 ~4, -1 ~ -4(A positive
number means ON
while a negative
number means OFF.)• when the port_type is
DR_CONTROLLER_ANALOG• 1 ~ 2(channel)• when the port_type is
DR_FLANGE_ANALOG(Only available
on new flanges)• 1 ~ 2(A model)- 264 -

Programming manual(V2.10)

System Commands

Parameter Name

Data TypeDefault Value

Description• 1 ~ 4(M/H model)

val

float

-

I/O value• when the port_type is 0 or 1(digital)• ON : 1• OFF : 0
• when the port_type is 2(analog)• current mode : 4.00 ~20.00(mA)• voltage mode : 0.00 ~ 10.00(V)timeout

float

None

waiting time [sec]If not set, wait indefinitely

condition

int

None

Analog value comparison condition• DR_ANALOG_CONDITION_UPPER: 0• Wait until the received analog
input is greater than or equal
to the val parameter.
• DR_ANALOG_CONDITION_LOWER : 1• Wait until the received analog
input is less than or equal tothe val parameter

Note
If val is omitted, positive numbers become ON and negative numbers become OFF depending on thesign (+/-) of the index.

ReturnValue

Description0

Success-1

Failed(time-out)- 265 -

Programming manual(V2.10)

System Commands

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Example1
2
3

wait_input(0, 1, ON) # wait_digital_input(1, ON)
wait_input(1, 2, ON) # wait_tool_digital_input(2, ON)
wait_input(2, 1, 4.0, DR_ANALOG_CONDITION_LOWER) # wait_analog_input(1,DR_ANALOG_CONDITION_LOWER, 4.0)

7.1.24 wait_analog_input(ch, condition, val, timeout=None)
Features
It waits until the signal value of the analog input channel of the controller becomes val (float value). The wait
time can be changed with the timeout setting, and the result is returned as soon as the wait state ends after the
specified amount of time has elapsed. However, if timeout is not set, it will wait indefinitely.

Parameters
Parameter Name

Data TypeDefault Value

Description

ch

int

-

1 : channel 1
2 : channel 2

condition

int-

Analog value comparison condition• DR_ANALOG_CONDITION_UPPER: 0• Wait until the received analog input isgreater than or equal to the val parameter.
• DR_ANALOG_CONDITION_LOWER : 1• Wait until the received analog input is lessthan or equal to the val parameter- 266 -

Programming manual(V2.10)

System Commands

Parameter Name

Data TypeDefault Value

val

float

-

timeout

float

None

Description• current mode : 4.00 ~ 20.00(mA)• voltage mode : 0.00 ~ 10.00(V)waiting time [sec]If not set, wait indefinitely

ReturnValue

Description0

Success-1

Failed(time-out)

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Example1

wait_analog_input(1, DR_ANALOG_CONDITION_UPPER, 5.0, 4) ## Wait until
analog data received through ch 1 is equal to or greater than 5.0

7.1.25 wait_tool_analog_input(ch, condition, val, timeout=None)
FeaturesThis function sends a signal at the digital contact point of the controller. A value saved in the digital output
register is output as a digital signal.

- 267 -

Programming manual(V2.10)

System Commands

CautionThis command is only available for new flanges.

Parameters
Parameter
Name

Data TypeDefault
Value

Description

ch

int

-

I/O contact number mounted on the controller• Val argument existing: A number between 1 and 16• No val argument: 1 ~ 16 , -1 ~ -16(A positive number means ON while a negative number
means OFF.)conditionint-

I/O value• ON: 1
• OFF: 0

val

float

-

timeout

float

None

• current mode : 4.00 ~ 20.00(mA)• voltage mode : 0.00 ~ 10.00(V)waiting time [sec]If not set, wait indefinitely

ReturnValue

Description0

Success-1

Failed (time-out)

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid- 268 -

Programming manual(V2.10)

System Commands

Exception

Description

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Example1

wait_tool_analog_input(1, DR_ANALOG_CONDITION_UPPER, 5.0, 4) ## Wait until
analog data received through ch 1 is equal to or greater than 5.0

7.2 TP Interface
7.2.1 tp_popup(message, pm_type=DR_PM_MESSAGE, button_type=0)
FeaturesThis function provides a message to users through the Teach Pendant. The higher level controller receives thestring and displays it in the popup window, and the window must be closed by a user’s confirmation.

Parameters
Parameter
Name

Data TypeDefault Value

Description

messagestring-Message provided to the user
• Messages are limited to within 256 bytes.
• It is recommended that the text be concise. For
long text, some content is omitted with anellipsis (…).
• Formatting-related code such as newline (\n) or
carriage return (\r) is not allowed.

pm_typebutton_type

int

int

DR_PM_MESSA
GE

Message type0

button type of TP pop message• DR_PM_MESSAGE• DR_PM_WARNING• DR_PM_ALARM• 0 : show Stop & Resume button• 1 : show Stop button- 269 -

Programming manual(V2.10)

System Commands

ReturnValue

Description0

Success

Negative value

FailedException
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6
7

tp_popup("move done", DR_PM_MESSAGE)
tp_popup("Error!! ", DR_PM_ALARM)
a=1
b=2
c=3
tp_popup("a={0}, b={1}, c={2}".format(a,b,c) ,DR_PM_MESSAGE)
tp_popup("critical error!! ", DR_PM_ALARM, 1)

7.2.2 tp_log(message)
FeaturesThis function records the user-written log to the Teach Pendant.

- 270 -

Programming manual(V2.10)

System Commands

Parameters
Parameter
Name

Data
Type

Default
Value

Description

messagestring-

Log message• Messages are limited to within 256 bytes.
• It is recommended that the text be concise. For long text,
some content is omitted with an ellipsis (…).
• Formatting-related code such as newline (\n) or carriage
return (\r) is not allowed.

ReturnValue

Description0

Success

Negative value

FailedException
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example1

tp_log("movej() is complete! ")- 271 -

Programming manual(V2.10)

System Commands

7.2.3 tp_get_user_input(message, input_type)FeaturesThis function receives the user input data through the Teach Pendant.

Parameters
Parameter
Name

Data TypeDefault
Value

Description

messagestring-Character string message to be displayed on the TP user
input window• Messages are limited to within 256 bytes.
• It is recommended that the text be concise. For longtext, some content is omitted with an ellipsis (…).
• Formatting-related code such as newline (\n) or
carriage return (\r) is not allowed.

input_type

int-

TP user input message type
• DR_VAR_INT: Integer type
• DR_VAR_FLOAT: Real number type
• DR_VAR_STR: Character string• DR_VAR_BOOL: Boolean

ReturnValue

Description

User input data

User input data received from the TP

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully- 272 -

Programming manual(V2.10)

System Commands

Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

q1 = posj(10, 10, 10, 10, 10, 10)
q2 = posj(20, 20, 20, 20, 20, 20)
q3 = posj(30, 30, 30, 30, 30, 30)
q4 = posj(40, 40, 40, 40, 40, 40)
q5 = posj(50, 50, 50, 50, 50, 50)
q6 = posj(60, 60, 60, 60, 60, 60)
int_y= tp_get_user_input("message1", input_type= DR_VAR_INT)
if int_y==1:# Moves to q1 if the TP user input is 1.
movej(q1, vel=30, acc=30)
else:# Moves to q2 if the TP user input is not 1.
movej(q2, vel=30, acc=30)
float_y= tp_get_user_input("message2", input_type= DR_VAR_FLOAT)
if float_y==3.14:# Moves to q3 if the TP user input is 3.14.
movej(q3, vel=30, acc=30)
else:# Moves to q4 if the TP user input is not 3.14.
movej(q4, vel=30, acc=30)
str_y= tp_get_user_input("message3", input_type= DR_VAR_STR)
if str_y=="a":# Moves to q5 if the TP user input is "a".
movej(q5, vel=30, acc=30)
else:# Moves to q6 if the TP user input is not "a".
movej(q6, vel=30, acc=30)
bool_y= tp_get_user_input("message3", input_type= DR_VAR_BOOL)
if bool_y==True:# Moves to q5 if the TP user input is "True or 1".
movej(q5, vel=30, acc=30)
else:# Moves to q6 if the TP user input is "False or 0"
movej(q6, vel=30, acc=30)

7.3 Thread
7.3.1 thread_run(th_func_name, loop=False)
FeaturesThis function creates and executes a thread. The features executed by the thread are determined by thefunctions specified in th_func_name.

Note
The following constraints are applied when using the thread command.

- 273 -

Programming manual(V2.10)

System Commands• Up to 4 threads can be used.
• The following motion command cannot be used to move the robot in the thread.
• movej, amovej, movejx, amovejx, movel, amovel, movec, amovec, movesj, amovesj,• movesx, amovesx, moveb, amoveb, move_spiral, amove_spiral,• move_periodic, amove_periodic, move_home• The thread commands do not operate normally when the loop=Ture during thread_run and theblock is an indefinite loop within the thread function. (The thread is normally stopped when thestop command is executed through the TP.)

Parameters
Parameter Name

Data TypeDefault Value

Description

th_func_namecallable-

Name of the function run by
the thread

loop

bool

False

Flag indicates whether the
thread will be repeated• True: Repeated callingof th_func_name(interval 0.01second)• False: One-time callingof th_func_name

ReturnValue

Description

int

Registered thread ID

Negative value

FailedException
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred- 274 -

Programming manual(V2.10)

System Commands

Exception

Description

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6
7
8
9
10
11
12
13

#----- Thread -------------------------------------def fn_th_func():
if check_motion()==0:# No motion in action
set_digital_output(1, OFF)else:
set_digital_output(1, ON)#----- Main routine ---------------------------------th_id = thread_run(fn_th_func, loop=True) # Thread run
while 1:# do something…
wait(0.1)

7.3.2 thread_stop(th_id)
FeaturesThis function terminates a thread.
The program is automatically terminated when the DRL program is terminated even if the thread_stop()command is not used.

Parameters
Parameter Name

Data TypeDefault Value

Description

th_id

int

-

Thread ID to stop

ReturnValue

Description0

Success

Negative value

Failed- 275 -

Programming manual(V2.10)

System Commands

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6
7
8
9
10

def fn_th_func():
if check_motion()==0:# No motion in action
set_digital_output(1, OFF)else:
set_digital_output(1, ON)#----- Main routine -------------------------------------th_id = thread_run(fn_th_func, loop=True)# do something…
thread_stop(th_id) # Stops the thread.

7.3.3 thread_pause(th_id)
FeaturesThis function temporarily suspends a thread.

Parameters
Parameter Name

Data TypeDefault Value

Description

th_id

int

-

Thread ID to suspend

ReturnValue

Description0

Success- 276 -

Programming manual(V2.10)

System Commands

Value

Description

Negative value

FailedException
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6
7
8
9
10
11

def fn_th_func():
if check_motion()==0:# No motion in action
set_digital_output(1, OFF)else:
set_digital_output(1, ON)#----- Main routine -------------------------------------th_id = thread_run(fn_th_func, loop=True)# do something…
thread_pause(th_id) # Suspends the thread.

7.3.4 thread_resume(th_id)
FeaturesThis function resumes a temporarily suspended thread.

Parameters
Parameter Name

Data TypeDefault Value

Description

th_id

int

-

Suspended thread ID to
be resumed- 277 -

Programming manual(V2.10)

System Commands

ReturnValue

Description0

Success

Negative value

FailedException
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14

def fn_th_func():
if check_motion()==0:# No motion in action
set_digital_output(1, OFF)else:
set_digital_output(1, ON)#----- Main routine -------------------------------------th_id = thread_run(fn_th_func, loop=True)# do something…
thread_pause(th_id) # Suspends the thread.
# do something…
thread_resume(th_id) # Resumes the suspended thread.

7.3.5 thread_state(th_id)
FeaturesThis function checks the status of a thread.

- 278 -

Programming manual(V2.10)

System Commands

Parameters
Parameter Name

Data TypeDefault Value

Description

th_id

int

-

Thread ID to check thestatusReturnValue

Description

1

RUN (TH_STATE_RUN)

2

PAUSE (TH_STATE_PAUSE)

3

STOP (TH_STATE_STOP)

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

Example
1
2
3
4
5
6
7
8
9
10
11

def fn_th_func():
if check_motion()==0:# No motion in action
set_digital_output(1, OFF)else:
set_digital_output(1, ON)
th_id = thread_run(fn_th_func, loop=True)
state1 = thread_state(th_id)
thread_pause(th_id)
state2 = thread_state(th_id)

7.3.6 Integrated example - ThreadThis example explains how to use the thread.

- 279 -

Programming manual(V2.10)

System Commands

Example 1: Thread example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45

#----- thread 1: client comm. --------------------def fn_th_client():
global g_sock
global g_cmd
res, rx_data = client_socket_read(g_sock)
if res > 0:g_cmd = rx_data.decode() #decode: Converts byte type into a string.
else: # Communication error
client_socket_close(g_sock)exit() # Terminates the program.
wait(0.1)
return 0#----- thread 2: check IO ------------------------def fn_th_check_io():
if get_digital_input(1) == ON:exit() # Terminates the program.
wait(0.1)
return 0#----- main --------------------------------------g_sock = client_socket_open("192.168.137.2", 20002) # Connects to theserver.
g_cmd = ""g_th_id1 = thread_run(th_client, loop=True)# Runs the th_client thread.
g_th_id2 = thread_run(th_check_io, loop=True) # Runs the th_check_io
thread.
p1 = posj(0, 0, 90, 0, 90, 0)
p2 = posj(10, 0, 90, 0, 90, 0)
p3 = posj(20, 0, 90, 0, 90, 0)
while 1:
if g_cmd == "a":g_cmd = ""movej(p1,vel=100,acc=100)
client_socket_write(g_sock, b"end")
if g_cmd == "b":g_cmd = ""movej(p2,vel=100,acc=100)
client_socket_write(g_sock, b"end")
if g_cmd == "c":g_cmd = ""movej(p3,vel=100,acc=100)
client_socket_write(g_sock, b"end")wait(0.1)

th_client thread: Converts the data received from the server into a string and saves it in g_cmd.

- 280 -

Programming manual(V2.10)

System Commands

th_check_io thread: Checks the state of contact no. 1 and terminates the program if it is ON.
main: Connects to the server.
2 threads run: th_client and th_check_io
If "a" is received from the server, it moves to p1 and sends "end" to the servers.
If "b" is received from the server, it moves to p2 and sends "end" to the servers.
If "c" is received from the server, it moves to p3 and sends "end" to the servers.

7.4 Others
7.4.1 wait(time)
FeaturesThis function waits for the specified time.

Parameters
Parameter Name

Data TypeDefault Value

Description

Time

Float

-

Time [sec]ReturnValue

Description0

Success

Negative value

Error

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred- 281 -

Programming manual(V2.10)

System Commands

Exception

Description

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6

wait(1.3)# Waits for 1.3 seconds.

while 1: # Checks contact no. 1 every 0.1 second.
if get_digital_input(1) == ON:
set_digital_output(1, ON)wait(0.1)

7.4.2 exit()
FeaturesThis function terminates the currently running program.

ReturnValue

Description0

Success

Exception
Exception

Description

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

Example1exit()

7.4.3 sub_program_run(name)Features
It executes a subprogram saved as a separate file.

- 282 -

Programming manual(V2.10)

System Commands

Parameter
Parameter Name

Data TypeDefault Value

Description

namestring-Name of subprogram

ReturnValue

Description

moduleModule object of executed subprogram

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error (DR_ERROR_RUNTIME)C Extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Note• The first line of the subprogram must have the phrase "from DRCF import *".
• When programming with a teaching pendant, this phrase is automatically inserted.
• If the global variable names of the main program and subprograms are the same, they operate
as different variables. Variables cannot be referenced by each other.
• If you need to share variables between the main program and subprograms, use systemvariables.
• System variables are set through the teaching pendant. Please refer to the user manual for
detailed usage.

Example1
2
3# subprogramA and subprogramB must be created and saved in advance.
<subProgramA.drl>- 283 -

Programming manual(V2.10)

System Commands

4
5
6
7
8
9
10
11
12
13
14
15
16
17

from DRCF import *movej([0,0,90,0,90,0], vel=30, acc=30)<subProgramB.drl>
from DRCF import *movej[(10,0,90,0,90,0), vel=30, acc=30)<main program>
while True:
var_select = tp_get_user_input("Select File", DR_VAR_INT)
if var_select == 0:
sub_program_run("subProgramA") # execute subProgramA
elif var_select == 1:
sub_program_run("subProgramB") # execute subProgramB

7.4.4 drl_report_line(option)
FeaturesThis command is used to turn ON / OFF the execution line display function when the DRL script is running. Whenthe run line display function is turned OFF, the time required to execute the run line display function is reduced,
which significantly speeds up the execution of the DRL.
CautionThe following features do not operate in the section where the execution line display function is turnedOFF.
• Execution time display by line
• Variable monitoring• System Variable Update• Step by Step in Debug mode
• Brake Point in Debug mode

Parameter
Parameter Name

Data TypeDefault Value

Description

optionInt-

Whether to display the DRL execution line
ON(1)OFF(0)- 284 -

Programming manual(V2.10)

System Commands

ReturnValue

Description

None

-

Example
1
2
3
4
5
6
7
8
9

x=0
y=0
drl_report_line(OFF)while x < 1000:
execution)x += 1
execution)
drl_report_line(ON)x=0y=0# Execution line display function OFF# Execution line not displayed (speed up# Execution line not displayed (speed up# Execution line display function ON# Execution line shown# Execution line shown

7.4.5 set_fm(key, value)
FeaturesThis command is used when interworking is required for information on variables (global variables, systemvariables, etc.) created when the program is executed, in addition to the system information already definedand linked with KT Smart Factory.

CautionPlease note that this function will not work if the linkage information is not set in the KT Smart
Factory menu in the Setup menu.
The KT Smart Factory menu only appears when setting up KT-specific licenses.

Parameter
Parameter Name

Data TypeDefault Value

Description

key

string-Data Name- 285 -

Programming manual(V2.10)

System Commands

Parameter Name

Data TypeDefault Value

Description

value

int

-

Interlocking Data Variable

float

Possible data types

string• Integer data
• Real data
• string data

ReturnValue

Description

None

-

Example
1
2
3
4
5
6
7
8

count = 0
movej(posj(0, 0, 90, 0,90,0), vel=30, acc=30)
while True:
movej(posj(0, 0, -90, 0,90,0), vel=30, acc=30)
movej(posj(0, 0, 90, 0,90,0), vel=30, acc=30)
count = count + 1
set_fm(“TotalCount”, count)

7.4.6 get_robot_model()FeaturesThis is a command to read the model name of the robot.

ReturnValue

Description

model nameReturns the model name in String type.

"M1013", "M0617", "M0609", "M1509","A0307", "A0307S", "A0509", "A0509S", "A0912", "A0912S""H2515", "H2017”- 286 -

Programming manual(V2.10)

System Commands

Example
1
2
3
4
5
6

model = get_robot_model()if model =="M1013":
set_velj(30)else:
set_velj(50)7.4.7 get_robot_serial_num()FeaturesThis is a command to read the serial number of the robot.

ReturnValue

Description

serial_number

Returns the serial number in String type.
Serial number: 6-character string consisting of numbers andEnglish characters

Example1

serial_num = get_robot_serial_num()

7.4.8 check_robot_jts()
FeaturesThis is a command to check whether the robot is equipped with a joint torque sensor.

ReturnValue

Description0

Success

Negative value

Error- 287 -

Programming manual(V2.10)

System Commands

Example1
2
3
4

if check_robot_jts() != True:
movej([0,0,90,0,90,0], 60, 30)
else:
movej([0,0,0,0,0,0], 60, 30)

7.4.9 check_robot_fts()
FeaturesThis is a command to check whether the robot is equipped with a force torque sensor.

ReturnValue

Description0

Success

Negative value

Error

Example1
2
3
4

if check_robot_fts() != True:
movej([0, 0, 90, 0, 90, 0], 60, 30)
else:
movej([0, 0, 0, 0, 0, 0], 60, 30)

7.4.10 start_timer()
FeaturesThis is a command to measure the execution time of the simulation program of the controller. When used withthe end_timer() command, it returns the execution time of the script between the two functions.
CautionThis function is for measuring motion execution time in Windows environment and Linux environment.
When measuring in Real mode in an emulator (virtual controller) environment, incorrect values may bereturned.

- 288 -

Programming manual(V2.10)

System Commands

ReturnValue

Description0

Success

Negative value

Error

Example1
2
3
4

start_timer()wait(1)t= end_timer()
tp_log("tttt={0} sec".format(t))

Related Commands• end_timer()(p. 289)

7.4.11 end_timer()
FeaturesThis is a command to measure the execution time of the simulation program of the controller. When used withthe start_timer() command, it returns the execution time of the script between the two functions.

CautionThis function is for measuring motion execution time in Windows environment and Linux environment.
When measuring in Real mode in an emulator (virtual controller) environment, incorrect values may bereturned.

ReturnValue

Description

float

Measured time information (process execution time)- 289 -

Programming manual(V2.10)

System Commands

Example1
2
3
4

start_timer()wait(1)t= end_timer()
tp_log("tttt={0} sec".format(t))

Related Commands• start_timer()(p. 288)

- 290 -

Programming manual(V2.10)

Mathematical Function

8 Mathematical Function
8.1 Basic Function
8.1.1 ceil(x)FeaturesThis function returns the smallest integer value of integers equal to or larger than x. It truncates up to theinteger.

Parameters
Parameter Name

Data TypeDefault
Value

Description

x

float

-

-

ReturnValue

Description

rounded integer-

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

8.1.2 floor(x)FeaturesThis function returns the largest integer value of integers equal to or smaller than x. It rounds down to thenearest one.

- 291 -

Programming manual(V2.10)

Mathematical Function

Parameters
Parameter Name

Data TypeDefault
Value

Description

x

float

-

-

ReturnValue

Description

rounded integer-

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

8.1.3 pow(x, y)
Features
Return x raised to the power of y.

Parameters
Parameter Name

Data TypeDefault
Value

x

float

-

y

float

-

Description

ReturnValue

Description

x raised to the powery-- 292 -

Programming manual(V2.10)

Mathematical Function

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

8.1.4 sqrt(x)FeaturesThis function returns the square root of x.

Parameters
Parameter
Name

Data
Type

Default Value

Description

x

float

-

-

ReturnValue

Description

the square root of x

Success

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occured.

8.1.5 log(x, b)
FeaturesThis function returns the log of x with base b.

- 293 -

Programming manual(V2.10)

Mathematical Function

Parameters
Parameter Name

Data TypeDefault
Value

Description

x

float

-

-

b

float

-

base, e (natural logarithm)

ReturnValue

Description

the logarithm of f to
the base of b.

-

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occured

8.1.6 d2r(x)FeaturesThis function returns the x degrees value to radians.

Parameters
Parameter Name

Data TypeDefault Value

Description

x

float

-

The angle in degrees

ReturnValue

Description

The angle in radians-- 294 -

Programming manual(V2.10)

Mathematical Function

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

8.1.7 r2d(x)FeaturesThis function returns the x radians value to degrees.

Parameters
Parameter Name

Data Type

x

float

Default
Value

Description

The angle in radians

ReturnValue

Description

The angle in degrees-

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occured

8.1.8 random()
FeaturesThis function returns a random number between 0 and 1.

- 295 -

Programming manual(V2.10)

Mathematical Function

ReturnValue

Description

random number

Random number between 0 and 1 (float)

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

8.2 Trigonometric functions
8.2.1 sin(x)FeaturesThis function returns the sine value of x radians.

Parameters
Parameter Name

Data TypeDefault
Value

Description

x

float

-

-

ReturnValue

Description

the sine of x-

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred- 296 -

Programming manual(V2.10)

Mathematical Function

8.2.2 cos(x)FeaturesThis function returns the sine value of x radians.

Parameters
Parameter Name

Data TypeDefault
Value

Description

x

float

-

-

ReturnValue

Description

the cosine of x-

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

8.2.3 tan(x)FeaturesThis function returns the tangent value of x radians.

Parameters
Parameter Name

Data TypeDefault
Value

Description

x

float

-

-

- 297 -

Programming manual(V2.10)

Mathematical Function

ReturnValue

Description

the tangent of x-

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

8.2.4 asin(x)FeaturesThis function returns the arc sine value of x radians.

Parameters
Parameter Name

Data TypeDefault
Value

x

float

-

Description

ReturnValue

Description

the arc sine of x-

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred- 298 -

Programming manual(V2.10)

Mathematical Function

8.2.5 acos(x)FeaturesThis function returns the arc cosine value of x radians.

Parameters
Parameter Name

Data TypeDefault
Value

Description

x

float

-

-

ReturnValue

Description

the arc cosine of x-

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

8.2.6 atan(x)FeaturesThis function returns the arc tangent value of x radians.

Parameters
Parameter Name

Data TypeDefault
Value

Description

x

float

-

-

- 299 -

Programming manual(V2.10)

Mathematical Function

ReturnReturnDescription

the arc tangent of x-

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

8.2.7 atan2(y, x)
FeaturesThis function returns the arc tangent value of y/x radians.

Parameters
Parameter Name

Data TypeDefault Value

Description

y

float

-

-

x

float

-

-

ReturnValue

Description

the arc tangent of y/x

The result is between -pi and pi

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred- 300 -

Programming manual(V2.10)

Mathematical Function

8.3 Linear algebra
8.3.1 norm(x)FeaturesThis function returnesthe L2 norm of x.

Parameters
Parameter Name

Data TypeDefault Value

Descriptionx

float[3]-Point coordinate (x, y, z)

ReturnValue

Description

float

Size of the point coordinate vector

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

8.3.2 rotx(angle)
FeaturesThis function returns a rotation matrix that rotates by the angle value along the x-axis.

Parameters
Parameter Name

Data TypeDefault
Value

Description

angle

float

0

Rotating angle [deg]- 301 -

Programming manual(V2.10)

Mathematical Function

ReturnValue

Description

float[3][3]Rotation matrix

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

Example1rotm = rotx(30)8.3.3 roty(angle)
FeaturesThis function returns a rotation matrix that rotates by the angle value along the y-axis.

Parameters
Parameter Name

Data type

Default
Value

Description

angle

float

0

Rotating angle [deg]ReturnValue

Description

float[3][3]Rotation matrix- 302 -

Programming manual(V2.10)

Mathematical Function

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

Example1rotm = roty(30)8.3.4 rotz(angle)
FeaturesThis function returns a rotation matrix that rotates by the angle value along the z-axis.

Parameters
Parameter Name

Data TypeDefault
Value

Description

angle

float

0

Rotating angle [deg]ReturnValue

Description

float[3][3]Rotation matrix

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred- 303 -

Programming manual(V2.10)

Mathematical Function

Example1rotm = rotz(30)8.3.5 rotm2eul(rotm)
FeaturesThis function receives a rotation matrix and returns the Euler angle (zyz order) to degrees. Of the Euler angle (rx,ry, rz) returned as a result, ry is always a positive number.

Parameters
Parameter Name

Data TypeDefault
Value

Description

rotm

Float[3][3]-Rotation matrix

ReturnValue

Description

float[3]ZYZ Euler angle [deg]Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

Example1
2

rotm = [[1,0,0],[0,0.87,-0.5],[0,0.5,0.87]]
eul = rotm2eul(rotm)- 304 -

Programming manual(V2.10)

Mathematical Function

8.3.6 rotm2rotvec(rotm)
FeaturesThis function receives a rotation matrix and returns the rotation vector (angle/axis representation).

Parameters
Parameter Name

Data TypeDefault Value

Description

rotm

float[3][3]-Rotation matrix

ReturnValue

Description

float[3]rotation vector

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

Example1
2

rotm = [[1,0,0],[0,0.87,-0.5],[0,0.5,0.87]]
eul = rotm2rotvec(rotm)

8.3.7 eul2rotm([alpha,beta,gamma])
FeaturesThis function transforms a Euler angle (zyz order) to a rotation matrix.

- 305 -

Programming manual(V2.10)

Mathematical Function

Parameters
Parameter Name

Data TypeDefault
Value

Description

eul

float[3][0 0 0]Euler angle (zyz) [deg]ReturnValue

Description

float[3][3]Rotation matrix

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

Example12

eul = [90, 90, 0]
rotm = eul2rotm (eul)8.3.8 eul2rotvec([alpha,beta,gamma])
FeaturesThis function transforms a Euler angle (zyz order) to a rotation vector.

Parameters
Parameter Name

Data TypeDefault
Value

Description

eul

float[3][0 0 0]Euler angle (zyz) [deg]- 306 -

Programming manual(V2.10)

Mathematical Function

ReturnValue

Description

float[3]rotation vector

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

Example12

eul = [90, 90, 0]
rotvec = eul2rotvec (eul)8.3.9 eul2rpy([alpha,beta,gamma])
FeaturesThis function receives Euler angle zyz and returns Euler angle zyx as a degree.

Parameters
Parameter Name

Data TypeDefault
Value

Description

eul

float[3][0 0 0]Euler angle (zyz) [deg]ReturnValue

Description

float[3]Euler angle (zyx) [deg]※ Return in order of roll (Rx), pitch (Ry), yaw (Rz)- 307 -

Programming manual(V2.10)

Mathematical Function

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

Example12

eul = [10, 20, 30]
rpy = eul2rpy(eul)8.3.10 rpy2eul([roll,pitch,yaw])
FeaturesThis function receives Euler angle zyx and returns Euler angle zyz as a degree.

Parameters
Parameter Name

Data TypeDefault
Value

Descriptionrpy

float[3][0 0 0]Euler angle (zyx) [deg]ReturnValue

Description

float[3]Euler angle (zyz) [deg]※ Return in order of alpha(A), beta(B), gamma(C)Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred- 308 -

Programming manual(V2.10)

Mathematical Function

Example1
2

rpy = [10, 20, 30]
eul = rpy2eul(rpy)8.3.11 rotvec2eul([rx,ry,rz])
FeaturesThis function transforms a rotation vector to a Euler angle (zyz).

Parameters
Parameter Name

Data TypeDefault
Value

Description

rotvecfloat[3]-rotation vector

ReturnValue

Description

float[3]ZYZ Euler angle [deg]Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

Example1
2

rotvec = [0.7854, 0, 0]
eul = rotvec2eul(rotvec) # eul=[45,0,0]- 309 -

Programming manual(V2.10)

Mathematical Function

8.3.12 rotvec2rotm([rx,ry,rz])
FeaturesThis function transforms a rotation vector to a rotation matrix.

Parameters
Parameter Name

Data TypeDefault
Value

Description

rotvecfloat[3]-rotation vector

ReturnValue

Description

float[3][3]Rotation matrix

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

Example1rotm = rotvec2eul([0.7854,0,0])8.3.13 htrans(posx1,posx2)
FeaturesThis function returns the pose corresponding to T1*T2 assuming that the homogeneous transformation
matrices obtained from posx1 and posx2 are T1 and T2, respectively.

- 310 -

Programming manual(V2.10)

Mathematical Function

Parameters
Parameter Name

Data TypeDefault
Value

Description

posx1

posx

-

posx orlist(float[6])
posx2

posx
list
(float[6])position list [mm, deg]-

posx orposition list [mm, deg]

ReturnValue

Description

posx[mm, deg]

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

Example1
2
3

posx1 = [100, 20, 300, 90, 0, 180]
posx2 = [200, 50, 100, 90, 30, 150]
posx = htrans(posx1,posx2)- 311 -

Programming manual(V2.10)

Mathematical Function

8.3.14 get_intermediate_pose(posx1,posx2,alpha)FeaturesThis function returns posx located at alpha of the linear transition from posx1 to posx2. It returns posx1 if alphais 0, the median value of two poses if alpha is 0.5, and posx2 if alpha is 1.

Parameters
Parameters Name

Data TypeDefault
Value

Description

posx1

posx

-

posx orlist(float[6])
posx2

posx

position list [mm, deg]-list
(float[6])
alpha

float

posx orposition list [mm, deg]-

0.0 ≤ alpha ≤ 1.0

ReturnValue

Description

posx[mm, deg]

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

Example1
2
3
4

posx1 = [100, 20, 300, 90, 0, 180]
posx2 = [200, 50, 100, 90, 30, 150]
alpha = 0.5
posx = get_intermediate_pose(posx1,posx2,alpha)- 312 -

Programming manual(V2.10)

Mathematical Function

8.3.15 get_distance(posx1, posx2)
FeaturesThis function returns the distance between two pose positions in [mm].

Parameters
Parameter Name

Data TypeDefault
Value

Description

posx1

posx

-

posx orlist(float[6])
posx2

posx
list
(float[6])position list [mm]-posx orposition list [mm]ReturnValue

Description

float

[mm]

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

Example1
2
3

posx1 = [100, 20, 300, 90, 0, 180]
posx2 = [200, 50, 100, 90, 30, 150]
dis_posx = get_distance(posx1, posx2)- 313 -

Programming manual(V2.10)

Mathematical Function

8.3.16 get_normal(x1, x2, x3)
FeaturesThis function returns the normal vector of a surface consisting of three points (posx) in the task space. This
direction is clockwise.

Parameters
Parameter Name

Data TypeDefault
Value

Description

x1

posx

-

posx orlist(float[6])
x2

posx

position list-

list
(float[6])
x3

posx

posx orposition list-

list
(float[6])posx orposition list

ReturnValue

Description

float[3]normal vector

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid- 314 -

Programming manual(V2.10)

Mathematical Function

Exception

Description

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example1234

x1 = posx(0, 500, 700, 30, 0, 90)
x2 = posx(500, 0, 700, 0, 0, 45)
x3 = posx(300, 100, 500, 45, 0, 45)
vect = get_normal(x1, x2, x3)

8.3.17 add_pose(posx1,posx2)
FeaturesThis function obtains the sum of two poses.

Parameters
Parameter Name

Data TypeDefault
Value

Description

posx1

posx

-

posx orlist(float[6])
posx2

posx
list
(float[6])position list [mm, deg]-

posx orposition list [mm, deg]

- 315 -

Programming manual(V2.10)

Mathematical Function

ReturnValue

Description

posx[mm, deg]

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

Example1
2
3

posx1 = [100, 20, 300, 90, 0, 180]
posx2 = [200, 50, 100, 90, 30, 150]
add_posx = add_pose(posx1, posx2)

8.3.18 subtract_pose(posx1,posx2)
FeaturesThis function obtains the difference between two poses.

Parameters
Parameter Name

Data TypeDefault
Value

Description

posx1

posx

-

posx orlist(float[6])position list [mm, deg]

- 316 -

Programming manual(V2.10)

Mathematical Function

Parameter Name

Data TypeDefault
Value

Description

posx2

posx

-

posx orlist(float[6])position list [mm, deg]

ReturnValue

Description

posx[mm, deg]

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

Example1
2
3

posx1 = [100, 20, 300, 90, 0, 180]
posx2 = [200, 50, 100, 90, 30, 150]
subtract_posx = subtract_pose(posx1, posx2)

8.3.19 inverse_pose(posx1)
FeatureThis function returns the posx value that represents the inverse of posx.

- 317 -

Programming manual(V2.10)

Mathematical Function

Parameter
Parameter Name

Data TypeDefault
Value

Description

posx1

posx

-

posx orlist(float[6])position list [mm, deg]

ReturnValue

Description

posx[mm, deg]

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

Example1
2

posx1 = [100, 20, 300, 90, 0, 180]
inv_posx = inverse_pose(posx1)

8.3.20 dot_pose(posx1, posx2)
FeaturesThis function obtains the inner product of the translation component when two poses are given.

Parameters
Parameter Name

Data TypeDefault Value

Description

posx1

posx

-

posx orlist (float[6])position list [mm, deg]

- 318 -

Programming manual(V2.10)

Mathematical Function

Parameter Name

Data TypeDefault Value

Description

posx2

posx

-

posx orlist (float[6])position list [mm, deg]

ReturnValue

Description

float

Inner product of two poses.

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

Example1
2
3

posx1 = [100, 20, 300, 90, 0, 180]
posx2 = [200, 50, 100, 90, 30, 150]
res= dot_pose(posx1, posx2)

8.3.21 cross_pose(posx1, posx2)
FeaturesThis function obtains the outer product of the translation component when two poses are given.

Parameters
Parameter Name

Data TypeDefault
Value

Description

posx1

posx

-

posx orlist(float[6])position list [mm, deg]

- 319 -

Programming manual(V2.10)

Mathematical Function

Parameter Name

Data TypeDefault
Value

Description

posx2

posx

-

posx orlist(float[6])position list [mm, deg]

ReturnValue

Description

float[3]Outer product of two poses.

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

Example1
2
3

posx1 = [100, 20, 300, 90, 0, 180]
posx2 = [200, 50, 100, 90, 30, 150]
res= cross_pose(posx1, posx2)

8.3.22 unit_pose(posx1)
FeaturesThis function obtains the unit vector of the given posx translation component.

Parameters
Parameter Name

Data TypeDefault
Value

Description

posx1

posx

-

posx orlist(float[6])position list [mm, deg]

- 320 -

Programming manual(V2.10)

Mathematical Function

ReturnValue

Description

float[3]Unit vector of the given posx

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

Example1
2

posx1 = [100, 20, 300, 90, 0, 180]
res = unit_pose(posx1)- 321 -

Programming manual(V2.10)

External Communication Commands

9 External Communication Commands
9.1 Serial
9.1.1 serial_open(port=None, baudrate=115200, bytesize=DR_EIGHTBITS,
parity=DR_PARITY_NONE, stopbits=DR_STOPBITS_ONE)
FeaturesThis function opens a serial communication port.

Parameters
Parameter Name

Data TypeDefault
Value

port

stringNonebaudrate

int

115200Description• D-SUB(9 pin) Connection : “COM”• USB to Serial Connection : “COM_USB”
Baud rate
2400, 4800, 9600, 19200, 38400, 57600, 115200

bytesize

int8

Number of data bits
• DR_FIVEBITS: 5• DR_SIXBITS: 6• DR_SEVENBITS: 7• DR_EIGHTBITS: 8

paritystr"N"

Parity checking• DR_PARITY_NONE: "N"• DR_PARITY_EVEN: "E"• DR_PARITY_ODD: "O"• DR_PARITY_MARK: "M"• DR_PARITY_SPACE: "S"

stopbits

int1

Number of stop bits
• DR_STOPBITS_ONE =1• DR_STOPBITS_ONE_POINT_FIVE = 1.5• DR_STOPBITS_TWO = 2- 322 -

Programming manual(V2.10)

External Communication Commands

ReturnValue

Description

serial.Serial instance

Successful connection

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

Serial.SerialException error occurred

Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

# When connected to serial port D-SUB (9 pin)
ser = serial_open(port="COM", baudrate=115200, bytesize=DR_EIGHTBITS,
parity=DR_PARITY_NONE, stopbits=DR_STOPBITS_ONE)
res = serial_write(ser, b"123ABC")
serial_close(ser)# When a USB to serial device is connected to a USB port
ser = serial_open(port="COM_USB", baudrate=115200, bytesize=DR_EIGHTBITS,
parity=DR_PARITY_NONE, stopbits=DR_STOPBITS_ONE)
res = serial_write(ser, b"123ABC")
serial_close(ser)9.1.2 serial_close(ser)FeaturesThis function closes a serial communication port.

- 323 -

Programming manual(V2.10)

External Communication Commands

Parameters
Parameter Name

Data TypeDefault
Value

Description

serserial.Serial-

Serial instance

ReturnValue

Description0

Successful closing of a serial port

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

Example
1
2
3
4
5
6

ser = serial_open(port="COM", baudrate=115200, bytesize=DR_EIGHTBITS,
parity=DR_PARITY_NONE, stopbits=DR_STOPBITS_ONE)
res = serial_write(ser, b"123456789")
serial_close(ser)9.1.3 serial_state(ser)Featuers
This function returns the status of a serial communication port.

Parameters
Parameter Name

Data TypeDefault
Value

Description

serserial.Serial-

Serial instance- 324 -

Programming manual(V2.10)

External Communication Commands

ReturnValue

Description

1

Serial port opened0

Serial port closed

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

Example
1
2
3
4
5
6

ser = serial_open(port="COM", baudrate=115200, bytesize=DR_EIGHTBITS,
parity=DR_PARITY_NONE, stopbits=DR_STOPBITS_ONE)
state = serial_state(ser)serial_close(ser)9.1.4 serial_set_inter_byte_timeout(ser, timeout=None)
FeaturesThis function sets the timeout between the bytes (inter-byte) when reading and writing to the port.

Parameters
Parameter Name

Data TypeDefault
Value

Description

serserial.Serial-

Serial instancetimeout

float

None

Timeout between bytes during reading or writing• Continued processing of data that wasprocessed before the timeout• None: inter-byte timeout not specified- 325 -

Programming manual(V2.10)

External Communication Commands

ReturnValue

Description0

Success

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

Example
1
2
3
4
5
6

ser = serial_open(port="COM", baudrate=115200, bytesize=DR_EIGHTBITS,
parity=DR_PARITY_NONE, stopbits=DR_STOPBITS_ONE)
res = serial_set_inter_byte_timeout(ser, 0.1)
serial_close(ser)9.1.5 serial_write(ser, tx_data)
FeaturesThis function writes the data (tx_data) to a serial port.

Parameters
Parameter Name

Data TypeDefault
Value

Description

serserial.Serial-

Serial instancetx_databyte-

Data to be transmitted• The data type must be a byte.
• Refer to the example below.

- 326 -

Programming manual(V2.10)

External Communication Commands

ReturnValue

Description0

Success-1

The port is not open.

-2

serial.SerialException error occurred

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

Example
1
2
3
4
5
6
7
8
9
10

ser = serial_open(port="COM", baudrate=115200, bytesize=DR_EIGHTBITS,
parity=DR_PARITY_NONE, stopbits=DR_STOPBITS_ONE)
serial_write(ser, b"123456789") # b means the byte type.
# Convert string to byte
msg = “abcd”# msg is a string variable
serial_write(ser, msg.encode()) # encode() converts string type to byte
type
serial_close(ser)9.1.6 serial_read(ser, length=-1, timeout=-1)
FeaturesThis function reads the data from a serial port.

- 327 -

Programming manual(V2.10)

External Communication Commands

Parameters
Parameter Name

Data TypeDefault
Value

Description

Ser

serial.Serial-

Serial instance

Lengthint-1

Number of bytes to read
• -1: Not specitied(The number of bytes to read is
not specified)• n(>=0): The specified number of byte is read.

timeout

int-1

Read waiting timefloat

• -1: Indefinite wait
• n(>0): n seconds

ReturnValue(res, rx_data)

DescriptionresnNumber of bytes of the received data

-1

The port is not open.

-2

serial.SerialException error occurred

rx_data

Number of bytes read (byte type)

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

Example1

ser = serial_open(port="COM", baudrate=115200, bytesize=DR_EIGHTBITS,- 328 -

Programming manual(V2.10)

External Communication Commands

2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

parity=DR_PARITY_NONE, stopbits=DR_STOPBITS_ONE)
res, rx_data = serial_read(ser)#Wait indefinitely until data is received
res, rx_data = serial_read(ser, timeout=3)#Wait until data is received, set a 3 seconds timeout# If received within 3 seconds, the read data is returned immediately# Return the value read so far after 3 seconds have elapsed
res, rx_data = serial_read(ser, length=100)# Wait indefinitely until reading 100 bytes
res, rx_data = serial_read(ser, length=100, timeout=3)#Wait until reading 100byte, set 3 seconds timeout# If 100 bytes are received within 3 seconds, the read data is returned
immediately.
# Return the value read so far after 3 seconds have elapsed# Convert the received byte type to string typerx_msg = rx_data.decode()# rx_data is a byte type and decode() is used to convert it to a stringtype.
# For example, if rx_data = b”abcd”, then rx_msg=”abcd”.
res, rx_data = serial_close(ser)9.1.7 serial_get_count()
FeaturesThis function reads the number of devices connected to USB to Serial.

ReturnValue (port_info, device_name)

Description

count

Number of connected serial ports

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error occurred- 329 -

Programming manual(V2.10)

External Communication Commands

Exception

Description

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

Example12
3
4
5

count = serial_get_count() # read number of connected serial ports
for i in range(count):
port_info, device_name = serial_get_info(i+1)
tp_popup("i={}, port ={}, dev ={}".format(i, port_info, device_name))

9.1.8 serial_get_info(id)FeaturesThis function reads the port information and device name of the connected USB to Serial.

Parameters
Parameter Name

Data TypeDefault
Value

Description

id

int

1

ID of "USB to Serial" to read (1-10)

ReturnValue (port_info, device_name)

Description

port_info

Port information (NULL means no device is connected)

device_nameDevice name (NULL means no device is connected)

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error occurred- 330 -

Programming manual(V2.10)

External Communication Commands

Exception

Description

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

Example1
2
3
4

port_info, device_name = serial_get_info(1) #1 connected device
information#port_info = "COM_USB"
ser = serial_open(port=port_info, baudrate=115200, bytesize=DR_EIGHTBITS,
parity=DR_PARITY_NONE, stopbits=DR_STOPBITS_ONE)

9.1.9 Combined Example - Serial
This is an example for performing a self-loop-back test on RXD (#2 pin) andTXD (#3 pin) are connected with the serial port.

Example 1 : Self-loop-back test example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

# serial port open
# if D-SUB (9pin) is connected: port="COM"# if USB is connected with USB to Serial: port="COM_USB"
ser = serial_open(port="COM_USB", baudrate=115200, bytesize=DR_EIGHTBITS,
parity=DR_PARITY_NONE, stopbits=DR_STOPBITS_ONE)wait(1)# SEND DATA : "123ABC"
res = serial_write(ser, b"123ABC") # b means byte typewait(1)# READ DATA
res, rx_data = serial_read(ser)# RXD and TXD are H/W connected res=6 (byte) rx_data = b"123ABC" arerecevied
tp_popup("res ={0}, rx_data={1}".format(res, rx_data))# close corresponding serial port
serial_close(ser)Received data is collected as is and the result is outputted as a TP pop-up message.
If executed properly, it outputs a result of res=6 rx_data = b’123ABC’.

- 331 -

Programming manual(V2.10)

External Communication Commands

Example 2 : Various packet transmission examples
Transmission packet: “MEAS_START” +data1[4byte]+data2[4byte]
data1: Converts integer to 4 bytes ex) 1 → 00000001
data2: Converts integer to 4 bytes ex) 2 → 00000002
ex) In case data1=1, data2=2: “MEAS_START”+00000001+00000002
Actual Packet: 4D4541535F53544152540000000100000002
Received packet: res=18, rx_data=“MEAS_START”+00000001+00000002
Extract rxd1 : Convert 10th to 14th byte into integer
Extract rxd2 : Convert 14th to 18th byte into integer

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

ser = serial_open(port="COM_USB", baudrate=115200, bytesize=DR_EIGHTBITS,
parity=DR_PARITY_NONE, stopbits=DR_STOPBITS_ONE)wait(1)
send_data = b"MEAS_START" # b means byte typedata1 =1
data2 =2
send_data += (data1).to_bytes(4, byteorder='big')
send_data += (data2).to_bytes(4, byteorder='big')# SEND DATA
res = serial_write(ser, send_data)wait(1)# READ DATA
# RXD, TXD are connected by H/W, so send_data is received as it isres, rx_data = serial_read(ser)tp_popup("res ={0}, rx_data={1}".format(res, rx_data))
rxd1 = int.from_bytes(rx_data[10:10+4], byteorder='big', signed=True)
rxd2 = int.from_bytes(rx_data[14:14+4], byteorder='big', signed=True)
tp_popup("res={0}, rxd1={1}, rxd2={2}".format(res, rxd1, rxd2))#Close the serial port
serial_close(ser)Connect the USB to serial device to the USB port and send byte type send_data.
Since RXD(2pin) and TXD(3pin) are connected to receive the transmitted data as it is,
res = 18, rx_data has the same packet as send_data.
Extract rxd1 : Convert 10th to 14th byte into integer- 332 -

Programming manual(V2.10)

External Communication Commands

Extract rxd2 : Convert 14th to 18th byte into integer
The end result will be res=18, rxd1=1, rxd2=2

9.2 Tcp/Client
9.2.1 client_socket_open(ip, port)
FeaturesThis function creates a socket and attempts to connect it to a server (ip, port).
It returns the connected socket when the client is connected.

Parameters
Parameter Name

Data TypeDefault
Value

Description

ip

str

-

Server IP address: (E.g.) “192.168.137.200”

port

int

-

Server Port number (e.g.) 20002

ReturnValue

Description

socket.socket
instance

Successful connection

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

socket.error occurred during a connection- 333 -

Programming manual(V2.10)

External Communication Commands

Example
1
2
3
4
5
6
7
8

sock = client_socket_open("192.168.137.200", 20002)# An indefinite connection is attempted to the server(ip="192.168.137.200", port=20002).
# The connected socket is returned if the connection is successful.
# The data is read, written, and closed using the returned socket as shown
below.
client_socket_write(sock, b"123abc")# Sends data to the server (brepresents the byte type).
res, rx_data = client_socket_read(sock) # Receives the data from theserver.
client_socket_close(sock)# Closes the connection to theserver.

9.2.2 client_socket_close(sock)FeaturesThis function terminates communication with the server. To reconnect to the server, the socket must be closedwith client_socket_close(sock) and reopened.

Parameters
Parameter Name

Data TypeDefault
Value

Description

sock

socket.socket-

Socket instance returned from client_socket_open()

ReturnValue

Description0

Successful disconnection

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred- 334 -

Programming manual(V2.10)

External Communication Commands

Exception

Description

DR_Error (DR_ERROR_RUNTIME)

socket.error occurred during disconnection

Example
1
2
3
4
5
6

sock = client_socket_open("192.168.137.200", 20002)# An indefinite connection is attempted to the server(ip="192.168.137.200", port=20002).
# do something…
client_socket_close(sock)# Closes the connection to the server.

9.2.3 client_socket_state(sock)FeaturesThis function returns the socket connection status.To know the connection status with the server, check the
return value of client_socket_read or client_socket_write (see Example 2).

Parameters
Parameter Name

Data TypeDefault Value

Description

sock

socket.socket-

Socket instance returned
from client_socket_open()

ReturnValue

Description

1

Socket normal state

0

Socket abnormal state

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred- 335 -

Programming manual(V2.10)

External Communication Commands

Example12345

sock = client_socket_open("192.168.137.200", 20002)
state = client_socket_state(sock) # Reads the socket state.
client_socket_close(sock)Example 2
1
2
3
4
5
6
7
8
9

sock = client_socket_open("192.168.137.200", 20002)
res, rx_data =client_socket_read(sock)
tp_log("[RX] res={0}, rx_data ={1}".format(res, rx_data))
if (res < 0):tp_log("[RX] server disconnect") #When the server connection is
disconnectedclient_socket_close(sock)exit()
client_socket_close(sock)

9.2.4 client_socket_write(sock, tx_data)
FeaturesThis function transmits data to the server.

Parameters
Parameter Name

Data TypeDefault Value

Description

sock

socket.socket-

Socket instance returned fromclient_socket_open()tx_databyte-

Data to be transmitted• The data type must be a byte.
• Refer to the example below.

- 336 -

Programming manual(V2.10)

External Communication Commands

ReturnValue

Description0

Success-1

The server is not connected.

-2Server is disconnected, or
socket.error occurred during a data transfer

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

Example
1
2
3
4
5
6
7
8

sock = client_socket_open("192.168.137.200", 20002)
client_socket_write(sock, b"1234abcd") # b means the byte type.
msg = "abcd" # msg is a string variable.
client_socket_write(sock, msg.encode()) # encode() converts a string typeto a byte type.
client_socket_close(sock)

9.2.5 client_socket_read(sock, length=-1, timeout=-1)
FeaturesThis function receives data from the server.

Parameters
Parameter Name

Data TypeDefault
Value

Description

sock

socket.socket-Socket instance returned from client_socket_open()- 337 -

Programming manual(V2.10)

External Communication Commands

Parameter Name

Data TypeDefault
Value

Description

lengthint-1

Number of bytes of the received data
• -1 : Not specified (The number of bytes to readis not specified.)• n(>=0) : The specified number of bytes is read.

timeout

int-1

Waiting time for receipt

float• -1 : Indefinite wait
• n(>0) : n seconds

ReturnValue (res, rx_data)

Description

res

>0

Number of bytes of the received data

-1

The server is not connected.

-2

Socket.error occurred during data reception-3

Timeout during data reception

rx_data

Received data (byte type)

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

Example1
2
3

sock = client_socket_open("192.168.137.200", 20002)
res, rx_data = client_socket_read(sock)is received- 338 -

# Indefinite wait until the data

Programming manual(V2.10)

External Communication Commands

4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

# Reads all received data since the length is omitted.
# Waits indefinitely until the data is received since timeout is omitted.
# (res = size of received data, rx_data=received data) is returned when
the data is received.
res, rx_data = client_socket_read(sock, timeout=3) # Waits for up to 3
seconds until the data is received.
# (res = size of received data, rx_data=received data) is returned if thedata is received within 3 seconds.
# (res = -3, rx_data=None) is returned if the data is not received within
3 seconds.
res, rx_data = client_socket_read(sock, length=64)
the received data.

# Reads 64 bytes ofres, rx_data = client_socket_read(sock, length=64, timeout=3)# Reads 64 bytes of the received data within the 3-second timeout.
rx_msg = rx_data.decode() # rx_data is a byte type and can be converted toa string type# using decode().
# For example, if rx_data = b"abcd",# rx_msg= "abcd".
client_socket_close(sock)

9.2.6 Integrated example (Tcp/Client)
Assume that server IP = 192.168.137,200 and open port =20002
and that the received packets are sent to the client as they are (mirroring).

Example 1 : Example of a default TCP client
1
2
3
4
5
6
7
8
9
10

# Assume server IP = 192.168.137,200 and open port =20002.
g_sock = client_socket_open("192.168.137.200", 20002)
tp_popup("connect O.K!",DR_PM_MESSAGE)
while 1:client_socket_write(g_sock, b"abcd") # The string "abcd" is sent in abyte type.
wait(0.1)
res, rx_data = client_socket_read(g_sock) # Waits for the data from theserver.
tp_popup("res={0}, rx_data ={1}".format(res, rx_data), DR_PM_MESSAGE)
wait(0.1)

The example connects to the server and sends the string "abcd". (b converts the string to a byte type.)
The message received from the server is output to the TP.
res = 4 and rx_data=b"abcd" since the server transmits the received data as is.

- 339 -

Programming manual(V2.10)

External Communication Commands

Example 2 : Examples of a packet transfer
Transmission packet: “MEAS_START" +data1[4byte]+data2[4byte]• data1: Conversion of the integer to 4 byte. ex) 1 → 00000001• data2: Conversion of the integer to 4 byte. ex) 2 → 00000002
ex) data1=1 and data2=2: “MEAS_START"+00000001+00000002• Actual packet: 4D4541535F53544152540000000100000002• Received packet: res=18, rx_data=“MEAS_START"+00000001+00000002• rxd1 extraction: Conversion of 10th - 14th bytes to an integer• rxd2 extraction: Conversion of 14th - 18th bytes to an integer

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

g_sock = client_socket_open("192.168.137.100", 20002)
tp_popup("connect O.K!",DR_PM_MESSAGE)
send_data = b"MEAS_START"
data1 =1
data2 =2
send_data += (data1).to_bytes(4, byteorder='big')
send_data += (data2).to_bytes(4, byteorder='big')client_socket_write(g_sock, send_data)wait(0.1)
res, rx_data = client_socket_read(g_sock)
tp_popup("res={0}, rx_data ={1}".format(res, rx_data), DR_PM_MESSAGE)
rxd1 = int.from_bytes(rx_data[10:10+4], byteorder='big', signed=True)
rxd2 = int.from_bytes(rx_data[14:14+4], byteorder='big', signed=True)
tp_popup("res={0}, rxd1={1}, rxd2={2}".format(res, rxd1, rxd2),
DR_PM_MESSAGE)
client_socket_close(g_sock)

The example connects to the server and sends a byte type send_data.
res = 18 and rx_data=send_data since the server transmits the received data as is.
• rxd1 extraction: Conversion of 10th - 14th bytes to an integer• rxd2 extraction: Conversion of 14th - 18th bytes to an integer
The final result is res=18, rxd1=1, and rxd2=2.

- 340 -

Programming manual(V2.10)

External Communication Commands

Example 3 : Reconnection
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

def fn_reconnect():
global g_sockclient_socket_close(g_sock)
g_sock = client_socket_open("192.168.137.200", 20002)
returng_sock = client_socket_open("192.168.137.200", 20002)
tp_popup("connect O.K!",DR_PM_MESSAGE)
client_socket_write(g_sock, b"abcd")
wait(0.1)
while 1:
res, rx_data = client_socket_read(g_sock)
if res < 0:fn_reconnect()else:
tp_popup("res={0}, rx_data ={1}".format(res, rx_data), DR_PM_MESSAGE)
wait(0.1)

The example checks the return value of the client_socket_read() command.
A negative value is returned if the connection to the server is terminated or there is a communication problem.
The function reconnect() is called to attempt a reconnection if a negative value is returned.
Note that the opened socket is closed when a reconnection is attempted.

9.3 Tcp/Server
9.3.1 server_socket_open(port)
Features
The robot controller creates a server socket and waits for the connection to the client. Returns the connected
socket when the client is connected.

Parameters
Parameter Name

Data TypeDefault
Value

Description

port

int

-

Port number to open

- 341 -

Programming manual(V2.10)

External Communication Commands

ReturnValue

Description

socket.socket
instance

Successful connection

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

socket.error occurred during a connection

Example
1
2
3
4
5
6
7
8
9

sock = server_socket_open(20002)# Opens the port 20002 and waits until the client connects.
# The connected socket is returned if the connection is successful.
# The data is read, written, and closed using the returned socket as shown
below.
server_socket_write(sock, b"123abc") # Sends data to the client (brepresents the byte type).
res, rx_data = server_socket_read(sock) # Receives the data from theclient.
server_socket_close(sock) # Closes the connection to the client.

9.3.2 server_socket_close(sock)FeaturesThis function terminates communication with the client. To reconnect to the client, the socket must be closedwith server_socket_close(sock) and reopened.

- 342 -

Programming manual(V2.10)

External Communication Commands

Parameters
Parameter Name

Data TypeDefault
Value

Description

sock

socket.soc
ket-Socket instance returned from server_socket_open()socket instance

ReturnValue

Description0

Successful disconnection

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_RUNTIM
E)

socket.error occurred during disconnection

Example
1
2
3
4
5
6

sock = server_socket_open(20002)# Opens the port 20002 and waits until the client connects.
# do something…
server_socket_close(sock) ) # Closes the connection to the client.

9.3.3 server_socket_state(sock)FeaturesThis function returns the socket status.
To know the connection status with the client, check the return value of server_socket_read orserver_socket_write (see Example 2).

- 343 -

Programming manual(V2.10)

External Communication Commands

Parameters
Parameter Name

Data TypeDefault
Value

Description

sock

socket.socket-Socket instance returned from server_socket_open()socket instance

ReturnValue

Description

1

Socket normal state

0

Socket abnormal state

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

Example 1
1
2
3
4
5

sock = server_socket_open(20002)
state = server_socket_state(sock) # Reads the socket state.
server_socket_close(sock)Example 2
1
2
3
4
5
6
7
8
9

sock = server_socket_open(20002)
res, rx_data =server_socket_read(sock)
tp_log("[RX] res={0}, rx_data ={1}".format(res, rx_data))
if (res < 0):#When the client connection is disconnected
tp_log("[RX] client disconnect")server_socket_close(sock)exit()- 344 -

Programming manual(V2.10)

External Communication Commands

10

server_socket_close(sock)

9.3.4 server_socket_write(sock, tx_data)
FeaturesThis function transmits data to the client.

Parameters
Parameter Name

Data TypeDefault
Value

Description

sock

socket.soc
ket-Socket instance returned from server_socket_open()

byte

-

tx_datasocket instance
Data to be transmitted• The data type must be a byte.
• Refer to the example below.

ReturnValue

Description0

Success-1

The client is not connected.

-2

client is disconnected, or
socket.error occurred during a data transfer

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

Example1

sock = server_socket_open(20002)- 345 -

Programming manual(V2.10)

External Communication Commands

2
3
4
5
6
7
8

server_socket_write(sock, b"1234abcd") # b means the byte type.
msg = "abcd"# msg is a string variable.
server_socket_write(sock, msg.encode()) # encode() converts a string typeto a byte type.
server_socket_close(sock)

9.3.5 server_socket_read(sock, length=-1, timeout=-1)
FeaturesThis function reads data from the client.

Parameters
Parameter Name

Data TypeDefault
Value

Description

sock

socket.socket-Socket instance returned from server_socket_open()

int

-1

lengthsocket instance
Number of bytes of the received data
• -1 : Not specified (The number of bytes to readis not specified.)• n(>=0) : The specified number of bytes is read.

timeout

int-1

Waiting time for receipt

float• -1 : Indefinite wait
• n(>0) : n seconds

ReturnValue (res, rx_data)res

Description0

Number of bytes of the received data

-1

The client is not connected.

-2

socket.error occurred during data reception-3

Timeout during data reception- 346 -

Programming manual(V2.10)

External Communication Commands

Value (res, rx_data)

Description

rx_data

Received data (byte type)

Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

sock = server_socket_open(20002)
res, rx_data = server_socket_read(sock)# Indefinite wait until the data
is received# Reads all received data since the length is omitted.
# Waits indefinitely until the data is received since timeout is omitted.
# (res = size of received data, rx_data=received data) is returned when
the data is received.
res, rx_data = server_socket_read(sock, timeout=3) # Waits for up to 3
seconds until the data is received.
# (res = size of received data, rx_data=received data) is returned if thedata is received within 3 seconds.
# (res = -3, rx_data=None) is returned if the data is not received within
3 seconds.
res, rx_data = server_socket_read(sock, length=64)
the received data.

# Reads 64 bytes ofres, rx_data = server_socket_read(sock, length=64, timeout=3)# Reads 64 bytes of the received data within the 3-second timeout.
rx_msg = rx_data.decode() # rx_data is a byte type and can be converted toa string type# using decode().
# For example, if rx_data = b"abcd",# rx_msg= "abcd".
server_socket_close(sock)

9.3.6 Integrated example - Tcp/Server
The example assumes that the client connects to the controller with IP = 192,168,137.100 and port = 20002
and that the received packets are sent to the server as they are (mirroring).

Example 1 : Default TCP server example
12
3

g_sock = server_socket_open(20002)
tp_popup("connect O.K!",DR_PM_MESSAGE)- 347 -

Programming manual(V2.10)

External Communication Commands

4
5
6
7
8
9

while 1:server_socket_write(g_sock, b"abcd") # The string "abcd" is sent in abyte type.
wait(0.1)
res, rx_data = server_socket_read(g_sock) # Waits for the data from theserver.
tp_popup("res={0}, rx_data ={1}".format(res, rx_data), DR_PM_MESSAGE)
wait(0.1)

The example opens the port 20002 and waits until the client connects.
It connects to the client and sends the string "abcd".
The message received from the client is output to the TP.
res = 4 and rx_data=b"abcd" since the client transmits the received data as is.

Example 2 : Examples of a packet transfer
Transmission packet: “MEAS_START" +data1[4byte]+data2[4byte]
data1: Conversion of the integer to 4 byte. ex) 1 → 00000001
data2: Conversion of the integer to 4 byte. ex) 2 → 00000002
ex) data1=1 and data2=2: “MEAS_START"+00000001+00000002
Actual packet: 4D4541535F53544152540000000100000002
Received packet: res=18, rx_data=“MEAS_START"+00000001+00000002
rxd1 extraction: Conversion of 10th - 14th bytes to an integer
rxd2 extraction: Conversion of 14th - 18th bytes to an integer

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

g_sock = server_socket_open(20002)
tp_popup("connect O.K!",DR_PM_MESSAGE)
send_data = b"MEAS_START"
data1 =1
data2 =2
send_data += (data1).to_bytes(4, byteorder='big')
send_data += (data2).to_bytes(4, byteorder='big')server_socket_write(g_sock, send_data)wait(0.1)
res, rx_data = server_socket_read(g_sock)
tp_popup("res={0}, rx_data ={1}".format(res, rx_data), DR_PM_MESSAGE)
rxd1 = int.from_bytes(rx_data[10:10+4], byteorder='big', signed=True)
rxd2 = int.from_bytes(rx_data[14:14+4], byteorder='big', signed=True)- 348 -

Programming manual(V2.10)

External Communication Commands

20
21
22

tp_popup("res={0}, rxd1={1}, rxd2={2}".format(res, rxd1, rxd2),
DR_PM_MESSAGE)
server_socket_close(g_sock)

The example sends the byte type send_data.
res = 18 and rx_data=send_data since the client transmits the received data as is.
rxd1 extraction: Conversion of 10th - 14th bytes to an integer
rxd2 extraction: Conversion of 14th - 18th bytes to an integer
The final result is res=18, rxd1=1, and rxd2=2.

Example 3 : Reconnection
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

def fn_reopen():global g_sock
server_socket_close(g_sock)
g_sock = server_socket_open(20002)
returng_sock = server_socket_open(20002)
tp_popup("connect O.K!",DR_PM_MESSAGE)
server_socket_write(g_sock, b"abcd")
wait(0.1)
while 1:
res, rx_data = server_socket_read(g_sock)
if res < 0:fn_reopen()else:
tp_popup("res={0}, rx_data ={1}".format(res, rx_data), DR_PM_MESSAGE)
wait(0.1)

The example checks the return value of the server_socket_read() command.
A negative value is returned if the connection to the client is terminated or there is a communication problem.
The function reopen() is called to wait for the client connection if a negative value is returned.
Note that the opened socket is closed when a reconnection is attempted.

- 349 -

Programming manual(V2.10)

External Communication Commands

9.4 Modbus
9.4.1 add_modbus_signal(ip, port, name, reg_type, index, value=0,slaveid=255)
FeaturesThis function registers the ModbusTCP signal. The Modbus I/O must be set in the Teach Pendant I/O set-up
menu. Use this command only for testing if it is difficult to use the Teach Pendant. The Modbus menu is disabledin the Teach Pendant if it is set using this command.

Parameters
Parameter Name

Data TypeDefault
Value

Description

ip

string-IP address of the ModbusTCP module

port

int

-

Port number of the ModbusTCP module

namestring-Modbus signal name

reg_type

int-

Modbus signal type
• DR_MODBUS_DIG_INPUT• DR_MODBUS_DIG_OUTPUT• DR_MODBUS_REG_INPUT• DR_MODBUS_REG_OUTPUT

index

int

-

Modbus signal index

value

int

0

Output when the type is
DR_COIL or DR_HOLDING_REGISTER(ignored otherwise)

slaveidint255• Slave ID of the ModbusTCP module(0 or 1-247 or 255)
0 : Broadcase address
255 : Default value for ModbusTCP- 350 -

Programming manual(V2.10)

External Communication Commands

ReturnValue

Description0

Success

Negative value

FailedException
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6
7
8
9
10
11
12
13

# An example of connecting two Modbus IO and allocating the contacts# Modbus IO 1 : IP address 192.168.137.254, port 502
Input Register Address 0 ~ 3, signal name “input1”~”input4”
Holding Register Addreess 0 ~ 3, signal name “output1”~”output4”# Modbus IO 2 : IP address 192.168.137.253, port 502
Input Register Address 0 ~ 3, signal name “input1”~”input4”
Holding Register Addreess 0 ~ 3, signal name “output1”~”output4”# set < Modbus IO 1 > “input1”~”input4”, “output1”~”output4”
add_modbus_signal(ip="192.168.137.254",port=502, name="input1", reg_type=D
R_INPUT_REGISTER, index=0, slaveid=255)
add_modbus_signal(ip="192.168.137.254",port=502, name="input2", reg_type=D
R_INPUT_REGISTER, index=1, slaveid=255)
add_modbus_signal(ip="192.168.137.254",port=502, name="input3", reg_type=D
R_INPUT_REGISTER, index=2, slaveid=255)
add_modbus_signal(ip="192.168.137.254",port=502, name="input4", reg_type=D
R_INPUT_REGISTER, index=3, slaveid=255)

14- 351 -

Programming manual(V2.10)

External Communication Commands

15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

add_modbus_signal(ip="192.168.137.254",port=502, name="output1", reg_type=D
R_HOLDING_REGISTER, index=0, value=0, slaveid=255)
add_modbus_signal(ip="192.168.137.254",port=502, name=" output2", reg_type=D
R_HOLDING_REGISTER, index=1, value=0, slaveid=255)
add_modbus_signal(ip="192.168.137.254",port=502, name=" output3", reg_type=D
R_HOLDING_REGISTER, index=2, value=0, slaveid=255)
add_modbus_signal(ip="192.168.137.254",port=502, name=" output4", reg_type=D
R_HOLDING_REGISTER, index=3, value=0, slaveid=255)# set < Modbus IO 1 > “input5”~”input8”, “output5”~”output8”
add_modbus_signal(ip="192.168.137.253",port=502, name="input5",
reg_type= DR_INPUT_REGISTER, index=0, slaveid=255)
add_modbus_signal(ip="192.168.137.253",port=502, name=" input6",
reg_type= DR_INPUT_REGISTER, index=1, slaveid=255)
add_modbus_signal(ip="192.168.137.253",port=502, name=" input7",
reg_type= DR_INPUT_REGISTER, index=2, slaveid=255)
add_modbus_signal(ip="192.168.137.253",port=502, name=" input8",
reg_type= DR_INPUT_REGISTER, index=3, slaveid=255)
add_modbus_signal(ip="192.168.137.253",port=502, name=" output5", reg_type=D
R_HOLDING_REGISTER, index=0, value=0, slaveid=255)
add_modbus_signal(ip="192.168.137.253",port=502, name=" output6", reg_type=D
R_HOLDING_REGISTER, index=1, value=0, slaveid=255)
add_modbus_signal(ip="192.168.137.253",port=502, name=" output7", reg_type=D
R_HOLDING_REGISTER, index=2, value=0, slaveid=255)
add_modbus_signal(ip="192.168.137.253",port=502, name=" output8", reg_type=D
R_HOLDING_REGISTER, index=3, value=0, slaveid=255)

9.4.2 add_modbus_rtu_signal(slaveid=1, port=None, baudrate=115200,
bytesize=DR_EIGHTBITS, parity=DR_PARITY_NONE,
stopbits=DR_STOPBITS_ONE, name, reg_type, index, value=0)
FeaturesThis function registers the ModbusRTU signal. The Modbus I/O must be set in the Teach Pendant I/O set-up
menu. Use this command only for testing if it is difficult to use the Teach Pendant. The Modbus menu is disabledin the Teach Pendant if it is set using this command.

Parameters
Parameter Name

Data TypeDefault
Value

Description

slaveidint

1

Slave ID of the ModbusRTU (0 or 1-247)
0 : Broadcase address

port

stringNoneE.g.) “COM”, “COM_USB”, “/dev/ttyUSB0”- 352 -

Programming manual(V2.10)

External Communication Commands

Parameter Name

Data TypeDefault
Value

Description

baudrate

int

115200

Baud rate
9600, 19200, 57600, 115200, etc

bytesize

int8

Number of data bits
• DR_FIVEBITES: 5• DR_SIXBITS: 6• DR_SEVENBITS: 7• DR_EIGHTBITS: 8

paritystring"N"

Parity checking• DR_PARITY_NONE: "N"• DR_PARITY_EVEN: "E"• DR_PARITY_ODD: "O"

stopbits

int1

Number of stop bits
• DR_STOPBITS_ONE =1• DR_STOPBITS_TWO = 2

namestring-Modbus signal name

reg_type

int-

Modbus signal type
• DR_DISCRETE_INPUT =DR_MODBUS_DIG_INPUT• DR_COIL =DR_MODBUS_DIG_OUTPUT• DR_INPUT_REGISTER=DR_MODBUS_REG_INPUT• DR_HOLDING_REGISTER=DR_MODBUS_REG_OUTPUT

index

int

-

Modbus signal index

value

int

0

Output when the type is
DR_COIL or DR_HOLDING_REGISTER(ignored otherwise)

ReturnValue

Description0

Success- 353 -

Programming manual(V2.10)

External Communication Commands

Value

Description

Negative value

FailedException
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example12
3

add_modbus_rtu_signal(slaveid=1, port=port_info, baudrate=115200, bytesize=D
R_EIGHTBITS, parity=DR_PARITY_NONE, stopbits=DR_STOPBITS_ONE, name=’di1’,
reg_type=DR_INPUT_REGISTER, index=0)
add_modbus_rtu_signal(slaveid=1, port=port_info, baudrate=115200, bytesize=D
R_EIGHTBITS, parity=DR_PARITY_NONE, stopbits=DR_STOPBITS_ONE, name=’do1’,
reg_type=DR_HOLDING_REGISTER, index=0, value=12345)

9.4.3 add_modbus_signal_multi(ip, port, slaveid=255, name=None,
reg_type=DR_HOLDING_REGISTER, start_address=0, cnt=1)
FeaturesThis function registers the ModbusTCP FC15 & FC16 multiple signal. The Modbus I/O must be set in the Teach
Pendant I/O set-up menu. Use this command only for testing if it is difficult to use the Teach Pendant. The
Modbus menu is disabled in the Teach Pendant if it is set using this command.
Note
Initial value setting function is not supported.

- 354 -

Programming manual(V2.10)

External Communication Commands

Parameters
Parameter
Name

Data TypeDefault Value

Description

ip

string-IP address of the ModbusTCP module

port

int

-

Port number of the ModbusTCP moduleslaveidint255• Slave ID of the ModbusTCP module(0 or 1-247 or 255)
0 : Broadcase address
255 : Default value for ModbusTCP

namestringNone

Modbus signal name

reg_type

int

DR_HOLDING_REGISTER

Modbus signal type
• DR_COIL=DR_MODBUS_DIG_OUTPUT• DR_HOLDING_REGISTER=DR_MODBUS_REG_OUTPUT

start_addreessint

0Start address of Modbus multiple signal

cnt

int

1

Count of Modbus multiple signal

ReturnValue

Description0

Success

Negative value

FailedException
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred- 355 -

Programming manual(V2.10)

External Communication Commands

Exception

Description

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example1

add_modbus_signal_multi(ip="192.168.137.200", port=502, slaveid=255, name="
multi", reg_type=DR_HOLDING_REGISTER, start_address=0, cnt=5)

9.4.4 add_modbus_rtu_signal_multi(slaveid=1, port=None,baudrate=115200, bytesize=DR_EIGHTBITS, parity=DR_PARITY_NONE,
stopbits=DR_STOPBITS_ONE, name=None,
reg_type=DR_HOLDING_REGISTER, start_address=0, cnt=1)
FeaturesThis function registers the ModbusRTU FC15 & FC16 multiple signal. The Modbus I/O must be set in the Teach
Pendant I/O set-up menu. Use this command only for testing if it is difficult to use the Teach Pendant. The
Modbus menu is disabled in the Teach Pendant if it is set using this command.
Note
Initial value setting function is not supported.

Parameters
Parameter Name

Data
Type

Default Value

Description

slaveidint

1

Slave ID of the ModbusRTU (0 or 1-247)
0 : Broadcase address

port

stringNoneE.g.) “COM”, “COM_USB”, “/dev/ttyUSB0”- 356 -

Programming manual(V2.10)

External Communication Commands

Parameter Name

Data
Type

Default Value

Description

baudrate

int

115200

Baud rate
9600, 19200, 57600, 115200, etc

bytesize

int8

Number of data bits
• DR_FIVEBITES: 5• DR_SIXBITS: 6• DR_SEVENBITS: 7• DR_EIGHTBITS: 8

paritystring"N"

Parity checking• DR_PARITY_NONE: "N"• DR_PARITY_EVEN: "E"• DR_PARITY_ODD: "O"

stopbits

int1

Number of stop bits
• DR_STOPBITS_ONE =1• DR_STOPBITS_TWO = 2

namestring-Modbus signal name

reg_type

int-

Modbus signal type
• DR_COIL =DR_MODBUS_DIG_OUTPUT• DR_HOLDING_REGISTER=DR_MODBUS_REG_OUTPUT

start_address

int

0Start address of Modbus multiple signal

cnt

int

1

Count of Modbus multiple signal

ReturnValue

Description0

Success

Negative value

Failed- 357 -

Programming manual(V2.10)

External Communication Commands

Exception
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Example1

add_modbus_rtu_signal_multi(slaveid=1, port=”COM”, baudrate=115200,
bytesize=DR_EIGHTBITS, parity=DR_PARITY_NONE, stopbits=DR_STOPBITS_ONE,
name=”multi”, reg_type=DR_HOLDING_REGISTER, start_address=0, cnt=5)

9.4.5 del_modbus_signal(name)FeaturesThis function deletes the registered Modbus signal. The Modbus I/O must be set in the Teach Pendant I/O set-up
menu. Use this command only for testing if it is difficult to use the Teach Pendant. The Modbus menu is disabledin the Teach Pendant if it is set using this command.

Parameters
Parameter Name

Data TypeDefault
Value

Description

namestring-Name of the registered Modbus signal

ReturnValue

Description0

Success- 358 -

Programming manual(V2.10)

External Communication Commands

Value

Description

Negative
value

FailedException
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example1
2
3
4# Use the following command when the Modbus IO signals are registered as"input1" and "output1"# and this signal registration is to be deleted. .
del_modbus_signal("input1")# Deletes the registered " input1"
contact
del_modbus_signal("output1")# Deletes the registered " output1"
contact

9.4.6 del_modbus_signal_multi(name)FeaturesThis function deletes the registered Modbus multiple signal. The Modbus I/O must be set in the Teach Pendant
I/O set-up menu. Use this command only for testing if it is difficult to use the Teach Pendant. The Modbus menu
is disabled in the Teach Pendant if it is set using this command.

- 359 -

Programming manual(V2.10)

External Communication Commands

Parameters
Parameter Name

Data TypeDefault
Value

Description

namestring-Name of the registered Modbus multiple signal

ReturnValue

Description0

Success

Negative value

FailedException
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example1
2
3# Use the following command when the Modbus multiple signal is registeredas "multi1"(cnt=5)# and this signal registration is to be deleted. .
del_modbus_signal_multi("multi1")# Deletes the registered "multi1"
contact- 360 -

Programming manual(V2.10)

External Communication Commands

9.4.7 set_modbus_output(iobus, value)
FeaturesThis function sends the signal to an external Modbus system.
Function Code 05 Write Single Coil Register
Function Code 06 Write Signle Holding Register

Parameters
Parameter
Name

Data TypeDefault
Value

Description

iobus

string-modbus name (set in the TP)

value

int

-

Value for Modbus coil register.
• ON : 1• OFF : 0
Value for Modbus holding register

Note
When registered as a multiple signal, it is available by adding address value index to signal name.

ReturnValue

Description0

Success

Negative value

FailedException
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred- 361 -

Programming manual(V2.10)

External Communication Commands

Exception

Description

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6
7
8
9
10
11
12

#Modbus Coil Registers are registered as "do1" and "do2".
set_modbus_output("do1", ON)
set_modbus_output("do2", OFF)
#Modbus Holding Registers are registered as "reg1" and "reg2".
set_modbus_output("reg1", 10)
set_modbus_output("reg2", 24)#Modbus multiple signal is registered as “multi”(start address=10, cnt=2).
#“multi_10” & “multi_11” abailable
set_modbus_output("multi_10", 24)
set_modbus_output("multi_11", 65535)

9.4.8 set_modbus_outputs(iobus_list, val_list)
FeaturesThis function sends multiple signals to the Modbus Slave unit.
The maximum number of outputs is 32.

Parameters
Parameter Name

Data TypeDefault
Value

Description

iobus

string-Modbus name (set in the TP)

value

int

-

I/O output value list

- 362 -

Programming manual(V2.10)

External Communication Commands

ReturnValue

Description0

Success

Negative value

FailedException
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example12345# Modbus digital I/O output contact "d1" OFF, "d2" ON, and "d3" ON
set_modbus_outputs(iobus_list=[ "d1", "d2", "d3",], val_list=[0,1,1])# Modbus digital I/O output contact "d3" OFF and "d4" ON
set_modbus_outputs(["d3", "d4"], [0,1])

9.4.9 set_modbus_output_multi(iobus, val_list)
FeaturesThis function sends the signal to an external Modbus system.
Function Code 15 Write Multiple Coil Register
Function Code 16 Write Multiple Holding Register- 363 -

Programming manual(V2.10)

External Communication Commands

Parameters
Parameter Name

Data TypeDefault
Value

Description

iobus

string-Modbus multiple signal name (set in the TP)

Val_list

list

Value list of modbus multiple signal

Note
An error occurs if the number of singals registered in the multiple signal name does not match thenumber of elemensts in the output value list.

ReturnValue

Description0

Success

Negative value

FailedException
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example1#Modbus Coil Registers are registered as "do1"(cnt=5), "do2"(cnt=3)- 364 -

Programming manual(V2.10)

External Communication Commands

2
3
4
5
6
7

set_modbus_output_multi("do1", [ON, OFF, ON, ON, ON])
set_modbus_output_multi("do2", [ON, ON, ON])
#Modbus Holding Registers are registered as "reg1"(cnt=5), "reg2"(cnt=3)
set_modbus_output_multi("reg1", [10, 101, 12345, 777, 555])
set_modbus_output_multi("reg2", [24, 25, 26])

9.4.10 get_modbus_input(iobus)
FeaturesThis function reads the signal from the Modbus Slave unit. Parameters

Parameters
Parameter Name

Data TypeDefault
Value

Description

iobus

string-Modbus name (set in the TP)

Note
When registered as a multiple signal, it is available by adding address value index to signal name.

ReturnValue

Description

0 or 1 or value

Modbus Descrete / Coil Register: ON or OFF
Modbus Input / Holding Register : Register value

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred- 365 -

Programming manual(V2.10)

External Communication Commands

Exception

Description

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6
7
8
9
10
11
12

#Modbus digital I/O is connected, and the signals are registered as "di1"and "di2".
get_modbus_input("di1")
get_modbus_input("di2")#Modbus analog I/O is connected, and the signals are registered as "reg1"
and "reg2".
get_modbus_input("reg1")
get_modbus_input("reg2")#Modbus multiple signal is registered as “multi”(start address=10, cnt=2).
#“multi_10” & “multi_11” abailable
get_modbus_ input ("multi_10")
get_modbus_ input ("multi_11")

9.4.11 get_modbus_inputs(iobus_list)
FeaturesThis function reads multiple signals from the Modbus Slave unit.

Parameters
Parameter Name

Data TypeDefault
Value

Description

iobus_list

list(string)-

Modbus input name list (set in the TP)
signal type can be used only in the following cases• DR_MODBUS_DIG_INPUT• DR_MODBUS_DIG_OUTPUT- 366 -

Programming manual(V2.10)

External Communication Commands

ReturnValue

Description

int (>=0)

Multiple signals to be read at once(the value of the combination of iobus_list where the first value is LSB and the lastvalue is MSB)

Negative number

FailedException
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6
7

# Modbus digital I/O input signal "di1" =OFF, "di2"=ON, and "di3" =ON
res = get_modbus_inputs(iobus_list=[ "di1", "di2", "di3"])#res expected value = 0b110 (binary number), 6 (decimal
number), or 0x06 (hexadecimal number)# Modbus digital I I/O input signal "di4" OFF and "di5" ON
res = get_modbus_inputs(["di4", "di5"])#res expected value = 0b10 (binary number), 2 (decimal
number), or 0x02 (hexadecimal number)- 367 -

Programming manual(V2.10)

External Communication Commands

9.4.12 get_modbus_inputs_list(iobus_list)
Features
It is the command for reading multiple register type open signals from an external Modbus Slave unit.

Parameter
Parameter Name

Data TypeDefault
Value

Description

iobus_list

list(string)-

Modbus input name list (configured at TP)
Available only with the following signal types• DR_MODBUS_REG_INPUT• DR_MODBUS_REG_OUTPUT

ReturnValue

Description

res

Number values read

val_list

List of multiple signal values read simultaneously

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIME)C Extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully- 368 -

Programming manual(V2.10)

External Communication Commands

Example12345# Modbus Register I/O "Holding1" is 1234, "Input1" is 567,
# and "Holding2" is 9876
res, val_list = get_modbus_inputs_list(iobus_list=[ "Holding1", "Input1","Holding2"])#res expected value = 3#val_list expected value = [1234, 567, 9876]

9.4.13 get_modbus_input_multi (iobus)
FeaturesThis function reads the signal from the Modbus Slave unit.

Parameters
Parameter Name

Data TypeDefault
Value

Description

iobus

string-Modbus multi signal name (set in the TP)

ReturnValue

Description

list

List of values corresponding to the number of signals

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred- 369 -

Programming manual(V2.10)

External Communication Commands

Exception

Description

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example1
2#Modbus multiple signal is registered as “multi”(cnt=2).
get_modbus_input("multi")# return = [10, 101]

9.4.14 wait_modbus_input(iobus, val, timeout=None)
FeaturesThis function waits until the specified signal value of the Modbus digital I/O becomes val (ON or OFF). The
waiting time can be changed with a timeout setting. The waiting time ends, and the result is returned if the
waiting time has passed. This function waits indefinitely if the timeout is not set.

Parameters
Parameter Name

Data TypeDefault Value

Description

iobus

string-Modbus name (set in the TP)

value

int

-

Modbus digital I/O• ON : 1• OFF : 0
Value for Modbus analog I/O

timeout

float-

Waiting time (sec)This function waits indefinitely if the timeout is
not set.

Note
When registered as a multiple signal, it is available by adding address value index to signal name.

- 370 -

Programming manual(V2.10)

External Communication Commands

ReturnValue

Description0

Success-1

Failed (time-out)

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6
7
8
9
10
11

wait_modbus_input("CIN0", ON) # Indefinite wait until the "CIN0" signal
becomes ON
wait_modbus_input("CIN0", OFF) # Indefinite wait until the "CIN0" signal
becomes OFF
res = wait_modbus_input("CIN0", ON, 3) # Wait for up to 3 seconds untilthe "CIN0" signal becomes ON# res = 0 if the "CIN0" signal becomes ON within 3 seconds.
# res = -1 if the "CIN0" signal does not become ON within 3 seconds.
#Modbus multiple signal is registered as “multi”(start address=10, cnt=2).
#“multi_10” & “multi_11” abailable
wait_modbus_input("multi_10")
wait_modbus_input("multi_11")- 371 -

Programming manual(V2.10)

External Communication Commands

9.4.15 set_modbus_slave(address, val)
Features
It is used to export values to the General Purpose Register area of the Modbus TCP Slave.

Parameter
Parameter Name

Data TypeDefault
Value

Description

address

int-

Address value of GPR area (128~255)

val

int

-

2byte value (0~65535)

ReturnValue

Description0

Success

Negative value

FailureException
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIME)C Extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully- 372 -

Programming manual(V2.10)

External Communication Commands

Example12

set_modbus_slave(128, 0)
set_modbus_slave(255, 65535)

9.4.16 get_modbus_slave(address)
Features
It is used to import values by approaching the General Purpose Register area of the Modbus TCP Slave.

Parameter
Parameter Name

Data TypeDefault
Value

Description

address

int-

Address value of the GPR area to read (128~255)

ReturnValue

Description

value

Corresponding register value

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIME)C Extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully- 373 -

Programming manual(V2.10)

External Communication Commands

Example1
2

value1 = get_modbus_slave(128)value2 = get_modbus_slave(255)

9.4.17 modbus_crc16(data)
Features
When using the Modbus protocol, this command reduces the load on Modbus CRC16 calculations.

Parameter
Parameter Name

Data TypeDefault
Value

Description

data

byte

-

Modbus data for CRC16 calculations

ReturnValue

Description

crchighHigh byte of CRC16 calculation result

crclow

Low byte of CRC16 calculation result

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIME)C Extension module error occurred- 374 -

Programming manual(V2.10)

External Communication Commands

Exception

Description

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example12
3
4

data = b"\x01\x02\x03\x04\x05\x06"
crchigh, crclow = modbus_crc16(data)#crchigh = 186(DEC), BA(HEX)#crclow = 221(DEC), DD(HEX)

9.4.18 modbus_send_make(send_data)
Features
When using the Modbus protocol, this command provides the result data including the Modbus CRC16 result forthe send data.

Parameter
Parameter Name

Data TypeDefault
Value

Description

send_data

byte-

Transfer data requiring CRC calcuation

ReturnValue

Description

result_data

Data in which transmission data and CRC16 value are conbined

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid- 375 -

Programming manual(V2.10)

External Communication Commands

Exception

Description

DR_Error(DR_ERROR_RUNTIME)C Extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example1
2
3

senddata = b"\x01\x02\x03\x04\x05\x06"
resultdata = modbus_send_make(senddata)#resultdata = b'\x01\x02\x03\x04\x05\x06\xba\xdd’

9.4.19 modbus_recv_check(recv_data)
Features
When using Modbus protocol, this command to check data integrity using CRC16 value for receive data.

Parameter
Parameter Name

Data TypeDefault
Value

Description

recv_databyte-

raw modbus data

ReturnValue

Description

resTrue/False

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error occurred- 376 -

Programming manual(V2.10)

External Communication Commands

Exception

Description

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIME)C Extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example1
2
3#recvdata = b”\x01\x02\x03\x04\x05\x06\xba\xdd”
res = modbus_recv_check(recvdata)#recv = True

9.4.20 modbus_unsigned_to_signed(unsigned_data)
Features
When using Modbus protocol, this is a command to convert 2 bytes unsigned data into signed data.

Parameter
Parameter Name

Data TypeDefault
Value

Description

unsigned_data

int-

2byte unsigned data(0~65535)

ReturnValue

Description

signed_data

2byte signed data(-32769 ~ 32767)- 377 -

Programming manual(V2.10)

External Communication Commands

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIME)C Extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example1
2

unsigned_data = 40000
signed_data = modbus_unsigned_to_signed(unsigned_data)

9.5 Industrial Ethernet (EtherNet/IP,PROFINET)
9.5.1 set_output_register_bit(address, val)
Features
It is used to export values to the Output Bit General Purpose Register area of the Industrial Ethernet(EtherNet/
IP, PROFINET) Slave.

Parameter
Parameter Name

Data TypeDefault
Value

Description

address

unsignedshort-

Address value of Output Bit GPR area in Industrial
Ethernet Slave(0-63)

val

int

-

ON : 1
OFF : 0- 378 -

Programming manual(V2.10)

External Communication Commands

ReturnValue

Description0

Success

Negative value

FailureException
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIME)C Extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example12

set_output_ register_bit (0, ON)
set_output_ register_bit (63, OFF)9.5.2 set_output_register_int(address, val)
Features
It is used to export values to the Output Int General Purpose Register area of the Industrial Ethernet(EtherNet/
IP, PROFINET) Slave.

- 379 -

Programming manual(V2.10)

External Communication Commands

Parameter
Parameter Name

Data TypeDefault
Value

Description

address

unsignedshort-

Address value of Output Int GPR area in Industrial
Ethernet Slave(0-23)

val

int

-

int value (4byte)

ReturnValue

Description0

Success

Negative value

FailureException
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIME)C Extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example12

set_output _register_int (0, 0x00FF00FF)
set_output _register_int (23, 65535)- 380 -

Programming manual(V2.10)

External Communication Commands

9.5.3 set_output_register_float(address, val)
Features
It is used to export values to the Output Float General Purpose Register area of the Industrial Ethernet(EtherNet/
IP, PROFINET) Slave.

Parameter
Parameter Name

Data TypeDefault
Value

Description

address

unsignedshort-

Address value of Output Float GPR area in Industrial
Ethernet Slave(0-23)

val

float

-

float value (4byte)

ReturnValue

Description0

Success

Negative value

FailureException
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIME)C Extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully- 381 -

Programming manual(V2.10)

External Communication Commands

Example12

set_output _register_float (0, 4.5)
set_output _register_float (23, 2.3)

9.5.4 get_output_register_bit(address)
Features
It is used to import values to the Output Bit General Purpose Register area of the Industrial Ethernet(EtherNet/
IP, PROFINET) Slave.

Parameter
Parameter Name

Data TypeDefault
Value

Description

address

unsignedshort-

Address value of Output Bit GPR area in Industrial
Ethernet Slave(0-63)

ReturnValue

Description

value

Corresponding register value

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIME)C Extension module error occurred- 382 -

Programming manual(V2.10)

External Communication Commands

Exception

Description

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example1
2

a = get_output _register_bit (0)b = get_output _register_bit (63)9.5.5 get_output_register_int(address)
Features
It is used to import values to the Output Int General Purpose Register area of the Industrial Ethernet(EtherNet/
IP, PROFINET) Slave.

Parameter
Parameter Name

Data TypeDefault
Value

Description

address

unsignedshort-

Address value of Output Int GPR area in Industrial
Ethernet Slave(0-23)

ReturnValue

Description

value

Corresponding register value

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid- 383 -

Programming manual(V2.10)

External Communication Commands

Exception

Description

DR_Error(DR_ERROR_RUNTIME)C Extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example1
2

a = get_output _register_int (0)b = get_output_register_int(23)9.5.6 get_output_register_float(address)
Features
It is used to import values to the Output Float General Purpose Register area of the Industrial
Ethernet(EtherNet/IP, PROFINET) Slave.

Parameter
Parameter Name

Data TypeDefault
Value

Description

address

unsignedshort-

Address value of Output Float GPR area in Industrial
Ethernet Slave(0-23)

ReturnValue

Description

value

Corresponding register value

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error occurred- 384 -

Programming manual(V2.10)

External Communication Commands

Exception

Description

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIME)C Extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example1
2

a = get_output _register_float (0)b = get_output _register_float (63)9.5.7 get_input_register_bit(address)
Features
It is used to import values to the Input Bit General Purpose Register area of the Industrial Ethernet(EtherNet/IP,
PROFINET) Slave.

Parameter
Parameter Name

Data TypeDefault
Value

Description

address

unsignedshort-

Address value of Input Bit GPR area in Industrial
Ethernet Slave(0-63)

ReturnValue

Description

value

Corresponding register value- 385 -

Programming manual(V2.10)

External Communication Commands

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIME)C Extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example1
2

a = get_input _register_bit (0)b = get_input_register_bit (63)9.5.8 get_input_register_int(address)
Features
It is used to import values to the Input Int General Purpose Register area of the Industrial Ethernet(EtherNet/IP,
PROFINET) Slave.

Parameter
Parameter Name

Data TypeDefault
Value

Description

address

unsignedshort-

Address value of Input Int GPR area in Industrial
Ethernet Slave(0-23)- 386 -

Programming manual(V2.10)

External Communication Commands

ReturnValue

Description

value

Corresponding register value

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIME)C Extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example1
2

a = get_input _register_int (0)b = get_input_register_int(23)9.5.9 get_input_register_float(address)
Features
It is used to import values to the Input Float General Purpose Register area of the Industrial Ethernet(EtherNet/
IP, PROFINET) Slave.

- 387 -

Programming manual(V2.10)

External Communication Commands

Parameter
Parameter Name

Data TypeDefault
Value

Description

address

unsignedshort-

Address value of Input Float GPR area in Industrial
Ethernet Slave(0-23)

ReturnValue

Description

value

Corresponding register value

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIME)C Extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example1
2

a = get_input _register_float (0)b = get_input _register_float (63)- 388 -

Programming manual(V2.10)

External Communication Commands

9.6 FOCAS
9.6.1 focas_connect(ip, port, timeout)
FeaturesThis command is used to connect to the Machine Center Controller. When connected normally, a handle value
greater than 0 is returned.
The connectable controllers are as follows.
• FANUC Series 30i/31i/32i/35i-MODEL B• FANUC Series 31i-MODEL B5• FANUC Series Power Motion i-MODEL A• FANUC Series 0i-MODEL D/FParameter
Parameter Name

Data TypeDefault
Value

Description

ip

str

-

Server IP address: (e.g.) “192.168.137.200”

port

int

-

Server Port number (e.g.) 8193

timeout

int-

timeout setting (infinite for 0:, unit: s)

ReturnValue

Description

HandleSuccess (return handle value)errorCodeError code (refer to focas_get_error_str)

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error occurred- 389 -

Programming manual(V2.10)

External Communication Commands

Exception

Description

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIME)C Extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example1

ErrCode, hMachineCenter = focas_connect("10.10.0.95", 8193, 10)9.6.2 focas_disconnect(handle)
FeaturesThis command is used to disconnect from the Machine Center Controller.

Parameter
Parameter Name

Data TypeDefault
Value

Description

handleint-

Communication specific control constant value
required for use of FOCAS

ReturnValue

Description

errorCode

0 : SuccessValue other than 0: error (see focas_get_error_str)- 390 -

Programming manual(V2.10)

External Communication Commands

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIME)C Extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example1
2

ErrCode, hMachineCenter = focas_connect("10.10.0.95", 8193, 10)
ErrCode = focas_disconnect(hMachineCenter)9.6.3 focas_pmc_read_bit(handle, addr_type, start_num, bit_offset)
FeaturesThis command is used to read PMC Data of Machine Center Controller. It is used when the data return type is bit.
Caution
Before driving the DRL, be sure to check the PMC Signal Map of the controller before driving.

Parameter
Parameter Name

Data TypeDefault
Value

Description

handleint-

Communication specific control constant value
required for use of FOCAS- 391 -

Programming manual(V2.10)

External Communication Commands

Parameter Name

Data Typeaddr_typestr

Default
Value

Description

G (Output signal from PMC to CNC)
F (Input signal to PMC from CNC)
Y (Output signal to PMC from machine)
X (Input signal from PMC to machine)A (Message display)
R (Internal relay)
T (Timer)
K (Keep relay)
C (Counter)
D (Data table)
M (Input signal from other PMC path)
N (Output signal to other PMC path)
E (Extra relay)
Z (System relay)• Case insensitive

start_num

Int

Strart Address Number(0~9999)

bit_offset

int

Bit Offset(0~7)

ReturnValue

Description

errorCode0: Success (communication is canceled normally)
Value other than 0: error (see focas_get_error_str)

pmc_data

PMC data (bit type)

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error occurred- 392 -

Programming manual(V2.10)

External Communication Commands

Exception

Description

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIME)C Extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example1
2
3

ErrCode, hMachineCenter = focas_connect(“10.10.0.95”, 8193, 10)
ErrCode, PMC_Data = focas_pmc_read_bit(hMachineCenter,”R”, 3500, 0)
ErrCode = focas_disconnect(hMachineCenter)

9.6.4 focas_pmc_read_char(handle, addr_type, start_num, read_count)
FeaturesThis command is used to read PMC Data of Machine Center Controller. It is used when the data return type ischar (1Byte).
Caution
Before driving the DRL, be sure to check the PMC Signal Map of the controller before driving.

Parameter
Parameter Name

Data TypeDefault
Value

Description

handleint-

Communication specific control constant value
required for use of FOCAS- 393 -

Programming manual(V2.10)

External Communication Commands

Parameter Name

Data Typeaddr_typestr

Default
Value

Description

G (Output signal from PMC to CNC)
F (Input signal to PMC from CNC)
Y (Output signal to PMC from machine)
X (Input signal from PMC to machine)A (Message display)
R (Internal relay)
T (Timer)
K (Keep relay)
C (Counter)
D (Data table)
M (Input signal from other PMC path)
N (Output signal to other PMC path)
E (Extra relay)
Z (System relay)• Case insensitive

start_num

Int

Strart Address Number(0~9999)

read_countint

Read from Start Address Number
Number of chars (max. 5)

ReturnValue

Description

errorCode0: Success (communication is canceled normally)
Value other than 0: error (see focas_get_error_str)

pmc_data

PMC data (char type)

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error occurred- 394 -

Programming manual(V2.10)

External Communication Commands

Exception

Description

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIME)C Extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example1
2
3

ErrCode, hMachineCenter = focas_connect("10.10.0.95", 8193, 10)
ErrCode, PMC_Data = focas_pmc_read_char(hMachineCenter,"R",100,3)
ErrCode = focas_disconnect(hMachineCenter)

9.6.5 focas_pmc_read_word(handle, addr_type, start_num, read_count)
FeaturesThis command is used to read PMC Data of Machine Center Controller. It is used when the data return type isword (2Byte).
Caution
Before driving the DRL, be sure to check the PMC Signal Map of the controller before driving.

Parameter
Parameter Name

Data TypeDefault
Value

Description

handleint-

Communication specific control constant value
required for use of FOCAS- 395 -

Programming manual(V2.10)

External Communication Commands

Parameter Name

Data Typeaddr_typestr

Default
Value

Description

G (Output signal from PMC to CNC)
F (Input signal to PMC from CNC)
Y (Output signal to PMC from machine)
X (Input signal from PMC to machine)A (Message display)
R (Internal relay)
T (Timer)
K (Keep relay)
C (Counter)
D (Data table)
M (Input signal from other PMC path)
N (Output signal to other PMC path)
E (Extra relay)
Z (System relay)• Case insensitive

start_num

Int

Strat Address Number(0~9999)

read_countint

Read from Start Address Number
Number of words (max. 5)

ReturnValue

Description

errorCode0: Success (communication is canceled normally)
Value other than 0: error (see focas_get_error_str)

pmc_data

PMC data (word type)

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error occurred- 396 -

Programming manual(V2.10)

External Communication Commands

Exception

Description

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIME)C Extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example1
2
3

ErrCode, hMachineCenter = focas_connect("10.10.0.95", 8193, 10)
ErrCode, PMC_Data = focas_pmc_read_word(hMachineCenter,"R",3500,3)
ErrCode = focas_disconnect(hMachineCenter)

9.6.6 focas_pmc_read_long(handle, addr_type, start_num, read_count)
FeaturesThis command is used to read PMC Data of Machine Center Controller. It is used when the data return type islong (4Byte).
Caution
Before driving the DRL, be sure to check the PMC Signal Map of the controller before driving.

Parameter
Parameter Name

Data TypeDefault
Value

Description

handleint-

Communication specific control constant value
required for use of FOCAS- 397 -

Programming manual(V2.10)

External Communication Commands

Parameter Name

Data Typeaddr_typestr

Default
Value

Description

G (Output signal from PMC to CNC)
F (Input signal to PMC from CNC)
Y (Output signal to PMC from machine)
X (Input signal from PMC to machine)A (Message display)
R (Internal relay)
T (Timer)
K (Keep relay)
C (Counter)
D (Data table)
M (Input signal from other PMC path)
N (Output signal to other PMC path)
E (Extra relay)
Z (System relay)• Case insensitive

start_num

Int

Strart Address Number(0~9999)

read_countint

Read from Start Address Number
Number of longs (max. 5)

ReturnValue

Description

errorCode0: Success (communication is canceled normally)
Value other than 0: error (see focas_get_error_str)

pmc_data

PMC data (long type)

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error occurred- 398 -

Programming manual(V2.10)

External Communication Commands

Exception

Description

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIME)C Extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example1
2
3

ErrCode, hMachineCenter = focas_connect("10.10.0.95", 8193, 10)
ErrCode, PMC_Data = focas_pmc_read_long(hMachineCenter,"R",3500,3)
ErrCode = focas_disconnect(hMachineCenter)9.6.7 focas_pmc_read_float(handle, addr_type, start_num, read_count)
FeaturesThis command is used to read PMC Data of Machine Center Controller.
It is used when the data return type is float (4Byte, 32-bit-floatring-point-type).
Caution
Before driving the DRL, be sure to check the PMC Signal Map of the controller before driving.

Parameter
Parameter Name

Data TypeDefault
Value

Description

handleint-

Communication specific control constant value
required for use of FOCAS- 399 -

Programming manual(V2.10)

External Communication Commands

Parameter Name

Data Typeaddr_typestr

Default
Value

Description

G (Output signal from PMC to CNC)
F (Input signal to PMC from CNC)
Y (Output signal to PMC from machine)
X (Input signal from PMC to machine)A (Message display)
R (Internal relay)
T (Timer)
K (Keep relay)
C (Counter)
D (Data table)
M (Input signal from other PMC path)
N (Output signal to other PMC path)
E (Extra relay)
Z (System relay)• Case insensitive

start_num

Int

Strart Address Number(0~9999)

read_countint

Read from Start Address Number
Number of floats (max. 5)

ReturnValue

Description

errorCode0: Success (communication is canceled normally)
Value other than 0: error (see focas_get_error_str)

pmc_data

PMC data (float type)

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error occurred- 400 -

Programming manual(V2.10)

External Communication Commands

Exception

Description

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIME)C Extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example1
2
3

ErrCode, hMachineCenter = focas_connect("10.10.0.95", 8193, 10)
ErrCode, PMC_Data = focas_pmc_read_float(hMachineCenter,"D",10,3)
ErrCode = focas_disconnect(hMachineCenter)

9.6.8 focas_pmc_read_double(handle, addr_type, start_num, read_count)
FeaturesThis command is used to read PMC Data of Machine Center Controller.
It is used when the data return type is double (8Byte, 64-bit-floatring-point-type).
Caution
Before driving the DRL, be sure to check the PMC Signal Map of the controller before driving.

Parameter
Parameter Name

Data TypeDefault
Value

Description

handleint-

Communication specific control constant value
required for use of FOCAS- 401 -

Programming manual(V2.10)

External Communication Commands

Parameter Name

Data Typeaddr_typestr

Default
Value

Description

G (Output signal from PMC to CNC)
F (Input signal to PMC from CNC)
Y (Output signal to PMC from machine)
X (Input signal from PMC to machine)A (Message display)
R (Internal relay)
T (Timer)
K (Keep relay)
C (Counter)
D (Data table)
M (Input signal from other PMC path)
N (Output signal to other PMC path)
E (Extra relay)
Z (System relay)• Case insensitive

start_num

Int

Strart Address Number(0~9999)

read_countint

Read from Start Address Number
Number of doubles (max. 5)

ReturnValue

Description

errorCode0: Success (communication is canceled normally)
Value other than 0: error (see focas_get_error_str)

pmc_data

PMC data (double type)

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error occurred- 402 -

Programming manual(V2.10)

External Communication Commands

Exception

Description

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIME)C Extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example1
2
3

ErrCode, hMachineCenter = focas_connect("10.10.0.95", 8193, 10)
ErrCode, PMC_Data = focas_pmc_read_double(hMachineCenter,"D",10,3)
ErrCode = focas_disconnect(hMachineCenter)9.6.9 focas_pmc_write_bit(handle, addr_type, start_num, bit_offset,
write_data)
FeaturesThis command is used to write PMC Data of Machine Center Controller.
It is used when the data return type is bit.
Caution
Before driving the DRL, be sure to check the PMC Signal Map of the controller before driving.

Parameter
Parameter Name

Data TypeDefault
Value

Description

handleint-

Communication specific control constant value
required for use of FOCAS- 403 -

Programming manual(V2.10)

External Communication Commands

Parameter Name

Data Typeaddr_typestr

Default
Value

Description

G (Output signal from PMC to CNC)
F (Input signal to PMC from CNC)
Y (Output signal to PMC from machine)
X (Input signal from PMC to machine)A (Message display)
R (Internal relay)
T (Timer)
K (Keep relay)
C (Counter)
D (Data table)
M (Input signal from other PMC path)
N (Output signal to other PMC path)
E (Extra relay)
Z (System relay)• Case insensitive

start_num

Int

Strart Address Number(0~9999)

bit_offset

int

Bit Offset(0~7)

write_data

IntON : 1
OFF : 0ReturnValue

Description

errorCode0: Success (communication is canceled normally)
Value other than 0: error (see focas_get_error_str)

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error occurred- 404 -

Programming manual(V2.10)

External Communication Commands

Exception

Description

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIME)C Extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example1
2
3

ErrCode, hMachineCenter = focas_connect("10.10.0.95", 8193, 10)
ErrCode = focas_pmc_write_bit(hMachineCenter, "R", 3000, 0, ON)
ErrCode = focas_disconnect(hMachineCenter)9.6.10 focas_pmc_write_char(handle, addr_type, start_num, write_data,
write_count)
FeaturesThis command is used to write PMC Data of Machine Center Controller.
It is used when the data return type is char (1Byte).
Caution
Before driving the DRL, be sure to check the PMC Signal Map of the controller before driving.

Parameter
Parameter Name

Data TypeDefault
Value

Description

handleint-

Communication specific control constant value
required for use of FOCAS- 405 -

Programming manual(V2.10)

External Communication Commands

Parameter Name

Data Typeaddr_typestr

Default
Value

Description

G (Output signal from PMC to CNC)
F (Input signal to PMC from CNC)
Y (Output signal to PMC from machine)
X (Input signal from PMC to machine)A (Message display)
R (Internal relay)
T (Timer)
K (Keep relay)
C (Counter)
D (Data table)
M (Input signal from other PMC path)
N (Output signal to other PMC path)
E (Extra relay)
Z (System relay)• Case insensitive

start_num

Int

Strart Address Number(0~9999)

write_databyte

The type of data to be transmitted is byte.

write_count

Int

Enter the number of char data to be transmitted.
Up to 5ReturnValue

Description

errorCode0: Success (communication is canceled normally)
Value other than 0: error (see focas_get_error_str)

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error occurred- 406 -

Programming manual(V2.10)

External Communication Commands

Exception

Description

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIME)C Extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example1
2
3
4

ErrCode, hMachineCenter = focas_connect("10.10.0.95", 8193, 10)
MC_Command = [129, 213]
ErrCode = focas_pmc_write_char(hMachineCenter, "R", 3000, MC_Command, 2)
ErrCode = focas_disconnect(hMachineCenter)9.6.11 focas_pmc_write_word(handle, addr_type, start_num, write_data,
write_count)
FeaturesThis command is used to write PMC Data of Machine Center Controller.
It is used when the data return type is word (2Byte).
Caution
Before driving the DRL, be sure to check the PMC Signal Map of the controller before driving.

Parameter
Parameter Name

Data TypeDefault
Value

Description

handleint-

Communication specific control constant value
required for use of FOCAS- 407 -

Programming manual(V2.10)

External Communication Commands

Parameter Name

Data Typeaddr_typestr

Default
Value

Description

G (Output signal from PMC to CNC)
F (Input signal to PMC from CNC)
Y (Output signal to PMC from machine)
X (Input signal from PMC to machine)A (Message display)
R (Internal relay)
T (Timer)
K (Keep relay)
C (Counter)
D (Data table)
M (Input signal from other PMC path)
N (Output signal to other PMC path)
E (Extra relay)
Z (System relay)• Case insensitive

start_num

Int

Strart Address Number(0~9999)

write_dataword

The type of data to be transmitted is word(2Byte).

write_count

Int

Enter the number of word data to be transmitted.
Up to 5ReturnValue

Description

errorCode0: Success (communication is canceled normally)
Value other than 0: error (see focas_get_error_str)

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error occurred- 408 -

Programming manual(V2.10)

External Communication Commands

Exception

Description

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIME)C Extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example1
2
3
4

ErrCode, hMachineCenter = focas_connect("10.10.0.95", 8193, 10)
MC_Command = [-129, 1213]
ErrCode = focas_pmc_write_word(hMachineCenter, "R", 3100, MC_Command, 2)
ErrCode = focas_disconnect(hMachineCenter)9.6.12 focas_pmc_write_long(handle, addr_type, start_num, write_data,
write_count)
FeaturesThis command is used to write PMC Data of Machine Center Controller.
It is used when the data return type is long (4Byte).
Caution
Before driving the DRL, be sure to check the PMC Signal Map of the controller before driving.

Parameter
Parameter Name

Data TypeDefault
Value

Description

handleint-

Communication specific control constant value
required for use of FOCAS- 409 -

Programming manual(V2.10)

External Communication Commands

Parameter Name

Data Typeaddr_typestr

Default
Value

Description

G (Output signal from PMC to CNC)
F (Input signal to PMC from CNC)
Y (Output signal to PMC from machine)
X (Input signal from PMC to machine)A (Message display)
R (Internal relay)
T (Timer)
K (Keep relay)
C (Counter)
D (Data table)
M (Input signal from other PMC path)
N (Output signal to other PMC path)
E (Extra relay)
Z (System relay)• Case insensitive

start_num

Int

Strart Address Number(0~9999)

write_data

int

The type of data to be transmitted is long(4Byte).

write_count

Int

Enter the number of long data to be transmitted.
Up to 5ReturnValue

Description

errorCode0: Success (communication is canceled normally)
Value other than 0: error (see focas_get_error_str)

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error occurred- 410 -

Programming manual(V2.10)

External Communication Commands

Exception

Description

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIME)C Extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example1
2
3
4

ErrCode, hMachineCenter = focas_connect("10.10.0.95", 8193, 10)
MC_Command = [-7129, 11213]
ErrCode = focas_pmc_write_long(hMachineCenter, "G", 3100, MC_Command, 2)
ErrCode = focas_disconnect(hMachineCenter)9.6.13 focas_pmc_write_float(handle, addr_type, start_num, write_data,
write_count)
FeaturesThis command is used to write PMC Data of Machine Center Controller.
It is used when the data return type is float (4Byte, 32-bit-floatring-point-type).
Caution
Before driving the DRL, be sure to check the PMC Signal Map of the controller before driving.

Parameter
Parameter Name

Data TypeDefault
Value

Description

handleint-

Communication specific control constant value
required for use of FOCAS- 411 -

Programming manual(V2.10)

External Communication Commands

Parameter Name

Data Typeaddr_typestr

Default
Value

Description

G (Output signal from PMC to CNC)
F (Input signal to PMC from CNC)
Y (Output signal to PMC from machine)
X (Input signal from PMC to machine)A (Message display)
R (Internal relay)
T (Timer)
K (Keep relay)
C (Counter)
D (Data table)
M (Input signal from other PMC path)
N (Output signal to other PMC path)
E (Extra relay)
Z (System relay)• Case insensitive

start_num

Int

Strart Address Number(0~9999)

write_data

float

The type of data to be transmitted is float(4Byte).

write_count

Int

Enter the number of float data to be transmitted.
Up to 5ReturnValue

Description

errorCode0: Success (communication is canceled normally)
Value other than 0: error (see focas_get_error_str)

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error occurred- 412 -

Programming manual(V2.10)

External Communication Commands

Exception

Description

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIME)C Extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example1
2
3
4

ErrCode, hMachineCenter = focas_connect("10.10.0.95", 8193, 10)
MC_Command = [-178.12, 11.478]
ErrCode = focas_pmc_write_float(hMachineCenter, "G", 3100, MC_Command, 2)
ErrCode = focas_disconnect(hMachineCenter)9.6.14 focas_pmc_write_double(handle, addr_type, start_num, write_data,
write_count)
FeaturesThis command is used to write PMC Data of Machine Center Controller.
It is used when the data return type is double (8Byte, 64-bit-floatring-point-type).
Caution
Before driving the DRL, be sure to check the PMC Signal Map of the controller before driving.

Parameters
Parameter Name

Data TypeDefault
Value

Description

handleint-

Communication specific control constant value
required for use of FOCAS- 413 -

Programming manual(V2.10)

External Communication Commands

Parameter Name

Data Typeaddr_typestr

Default
Value

Description

G (Output signal from PMC to CNC)
F (Input signal to PMC from CNC)
Y (Output signal to PMC from machine)
X (Input signal from PMC to machine)A (Message display)
R (Internal relay)
T (Timer)
K (Keep relay)
C (Counter)
D (Data table)
M (Input signal from other PMC path)
N (Output signal to other PMC path)
E (Extra relay)
Z (System relay)• Case insensitive

start_num

Int

Strart Address Number(0~9999)

write_data

double

The type of data to be transmitted is double(8Byte).

write_count

Int

Enter the number of double data to be transmitted.
Up to 5ReturnValue

Description

errorCode0: Success (communication is canceled normally)
Value other than 0: error (see focas_get_error_str)

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error occurred- 414 -

Programming manual(V2.10)

External Communication Commands

Exception

Description

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIME)C Extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example1
2
3
4

ErrCode, hMachineCenter = focas_connect("10.10.0.95", 8193, 10)
MC_Command = [-178.12, 11.478]
ErrCode = focas_pmc_write_double(hMachineCenter, "G", 3100, MC_Command, 2)
ErrCode = focas_disconnect(hMachineCenter)9.6.15 focas_get_error_str(handle, errorCode)Features
It is used to analyze the errorCode returned when using the Focas Library related function. When entering anerror code, the cause of the related error is returned as a string.

Parameter
Parameter Name

Data TypeDefault
Value

Description

handleint-

Communication specific control constant value
required for use of FOCAS

errorCodeint-

Error code returned after FOCAS related DRL execution

ReturnValue

Description

errorCodeString

Details of the error code (string)- 415 -

Programming manual(V2.10)

External Communication Commands

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIME)C Extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

ErrorCode Details
Exception

Description.-17

The following message is displayed depending on the detailed cause.
"The send data is larger than the maximum transfer unit""The sending data size is illegal""The number of the recieved packet is 0""The mark of the protocol is incorrect in the recieved packet header""The packet type flag is incorrect in the recieved packet header""The flag of the direction is incorrect in the recieved packet header""Illegal received data size""Communication error in the Ethernet Board ""protocol error"- 416 -

Programming manual(V2.10)

External Communication Commands

Exception

Description-16

The following message is displayed depending on the detailed cause.
"Error of socket API function ")"Error of connect API function")"Error of send API function""Error of recv API function""Error of select API function""Error of setsockopt API function""Error of gethostbyname API function""Timeout error of send API function""Timeout error of recv API function""Error of Winsock API is occurred in other process""EOF (end of file) detected ""socket error"-15"DLL not exist error"-14"error in APi library inital valiefile"-13"low temperature alarm of intellig0ent terminal"-12"hight temperature alarm of intelligent terminal"-11"bus error"-10"system error"-9"hssb communication error"-8"library handle error"-7"CNC/PMC version missmatch"-6"abnormal error"-5"system error"-4"shared RAM parity error"- 417 -

Programming manual(V2.10)

External Communication Commands

Exception

Description-3"emm386 or mmcsys install error"-2"reset or stop occured error"-1"busy error"0"no problem"

1"command prepare error or pmc not exist"2"data block length error"

3"data number error or address range error"

4"data attribute error or data type error"

5"data error"

6"no option error"

7"write protect error"

8"memory overflow error"

9"cnc parameter not correct error"

10"buffer error"

11"path error"

12"cnc mode error"

13"execution rejected error"

14"data server error"

15"alarm has been occurred"

16"CNC is not running"- 418 -

Programming manual(V2.10)

External Communication Commands

Exception

Description

17"protection data error"

18"error generated by PMC"

19

"PMC handle error"

20"overwrite stop in program read"21"reset interrupt in program read"-100"Library opening failed."-101"The maximum number of machine tools that can be connected has
been exceeded."-102"The handle is not connected"

Example
1
2
3
4
5
6

ErrCode, hMachineCenter = focas_connect("10.10.0.95", 8193, 10)
if ErrCode != 0 :ErrorString = focas_get_error_str(hMachineCenter, ErrCode)
MC_Command = [-178.12, 11.478]
focas_pmc_write_double(hMachineCenter, "G", 3100, MC_Command, 2)
focas_disconnect(hMachineCenter)- 419 -

Programming manual(V2.10)

External Vision Commands

10 External Vision Commands
10.1 Overview
Doosan Robotics provides the commands to guide robots with vision by connecting the robots to an external
vision system. It enables connecting a robot to a 2D vision system which can measure the object position (Tx,Ty) data and the rotation (Rz) data (offset information) to guide the inputted robot task, and the commands canreceive the measurement data inputs of multiple objects. The installation and tasks of the robot application
using the 2D vision system need to calibrate the visual coordinate system of the vision system to the physicalcoordinate system of the robot system (coordinate system correction). When using an external vision system,
the vision system must calibrate the coordinate system and transfer the corrected coordinate data to the robot.
The vision system can be installed in the Eye-in-hand mode connected to the robot or in-line mode separated
from the robot. It must be fixed so that the relative position of the robot and vision system does not change
during a task. The vision system and the robot controller communicate through the TCP/IP protocol, andcommunication is established when the cable of the vision system is connected to the wired hub port of therobot controller.

10.2 2D Vision - COGNEX / SICK / VISOR
2D Vision (COGNEX, SICK, VISOR) commands are composed as follows.
No.

Type

Command1

Select Manufacturer

vs_set_info(type)(p. 421)

2

Camera Connection

vs_connect(ip_addr, port_num=9999)(p. 422)
vs_disconnect()(p. 423)

3

Vision Job Manage

vs_get_job()(p. 423)
vs_set_job(job_name)(p. 424)
cognex_set_integer (job_name, integer_number)(p. 424)
visor_job_change(index)(p. 425)

4Object Recognition/Detection

vs_trigger()(p. 426)

5

Robot Task

vs_set_init_pos(vision_posx_init, robot_posx_init, vs_pos=1)(p. 427)

- 420 -

Programming manual(V2.10)

External Vision Commands

No.

Type

Commandvs_get_offset_pos(vision_posx _meas, vs_pos=1)(p. 428)

6

Customvs_request(cmd)(p. 430)
vs_result()(p. 431)

10.2.1 vs_set_info(type)FeaturesThis function set the type of vision system to use.

Parameters
Parameter Name

Data TypeDefault
Value

Description

type

int

DR_VS_CU
STOM

DR_VS_CUSTOM(0)DR_VS_COGNEX(1)DR_VS_SICK(2)DR_VS_VISOR(3)ReturnValue

Description

ID of TypeID of type to set

Example1
2
3
4

vs_set_info(DR_VS_COGNEX) #Vision type information setting
vs_connect("192.168.137.10") #Connect to vision - Vision IP, Default port
# Enter your task
vs_disconnect()#Disconnect to vision•

Supported Model

Type

Model

- 421 -

Programming manual(V2.10)

External Vision Commands

DR_VS_COGNEX

COGNEX IS2000M-23M Series
COGNEX IS5600/5705 Series
COGNEX IS7000Series
COGNEX IS8000Series

DR_VS_SICKSICK Inspector PIM60 Series
SICK Inspector PI50 Series

DR_VS_VISOR

Sensopart V20 Series

DR_VS_CUSTOM

10.2.2 vs_connect(ip_addr, port_num=9999)
FeaturesThis function establishes communication with the vision system.

Parameters
Parameter Name

Data TypeDefault
Value

Description

ip_addr

str-

Server IP of vison module (ex. 192.168.137.200)

port_num

int

9999

Port Number (ex, 9999)

ReturnValue

Description

0

Connection success-1

Connection failed

Example1
2
3

vs_set_info(DR_VS_COGNEX) #Vision type information setting
vs_connect("192.168.137.10") #Connect to vision - Vision IP, Default port
# Enter your task

- 422 -

Programming manual(V2.10)

External Vision Commands

4

vs_disconnect()#Disconnect to vision

10.2.3 vs_disconnect()FeaturesThis function terminates the connection to the vision system.

ReturnValue

Description

N/A

N/A

Example1
2
3
4

vs_set_info(DR_VS_COGNEX) #Vision type information setting
vs_connect("192.168.137.10") #Connect to vision - Vision IP, Default port
# Enter your task
vs_disconnect()#Disconnect to vision

10.2.4 vs_get_job()
FeaturesThis function loaded the task name, currently loaded in the vision system.(*VS_TYPE: DR_VS_COGNEX,
DR_VS_SICK)

ReturnValue

Data Type

Description

job_name

stringConnection success

-1

int

Connection failed

Example1
2
3

vs_set_info(DR_VS_COGNEX) #Vision type information setting
vs_connect("192.168.137.10") #Connect to vision - Vision IP, Default port

- 423 -

Programming manual(V2.10)

External Vision Commands

4
5
6
7
8

vs_set_job("test.job")# Set (load) the current vision job
job_name=vs_get_job()# Get the current setting vision job
tp_popup("{0}".format(job_name))
vs_disconnect()# Disconnect to vision

10.2.5 vs_set_job(job_name)FeaturesThis function loaded the entered task into the vision system.

Parameters
Parameter
Name

Data
Type

DefaultValue

job_name

stringDescription

Task name to be loaded.

ReturnValue

Data Type

Description0

int

Success-1

int

FailedExample
1
2
3
4
5
6
7
8

vs_set_info(DR_VS_COGNEX) #Vision type information setting
vs_connect("192.168.137.10") #Connect to vision - Vision IP, Default port
vs_set_job("test.job")# Set (load) the current vision job
job_name=vs_get_job()# Get the current setting vision job
tp_popup("{0}".format(job_name))
vs_disconnect()# Disconnect to vision

10.2.6 cognex_set_integer (job_name, integer_number)
Features
Loads the entered index of the corresponding job.

- 424 -

Programming manual(V2.10)

External Vision Commands(*VS_TYPE: DR_VS_COGNEX)

ReturnValue

Description

1

Success-1

Fail

Example12
3
45

vs_set_info(DR_VS_COGNEX)#Vision type information setting
vs_connect("192.168.137.10")#Connect to vision - Vision IP, Default
port
res = cognex_set_integer("Pattern_1.Scale_Tolerance",1)# Enter yourtask
tp_popup("{0}".format(res))vs_disconnect()#Disconnect to vision

10.2.7 visor_job_change(index)
Features
Loads the Vision Sensor setting using the entered number.
(*VS_TYPE: DR_VS_VISOR)

Parameters
Parameter Name

Data TypeDefault
Value

Description

index

int

-

Job number to be changed

ReturnValue

Description

resultJob change success (1)Job change failure (-1)

- 425 -

Programming manual(V2.10)

External Vision Commands

Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

vs_set_info(DR_VS_VISOR)# Select type of vision sensor
vs_connect("192.168.137.101")# Vision IP, Default port
vis_posx = posx (410,310,300,0,0,0)# Define the initial posx data visionrob_posx = posx (400,300,300,0,180,0)# Define the initial posx data robot
vs_set_init_pos(vis_posx, rob_posx, VS_POS1) # Enter the initial posx data
to Vision
visor_job_change(2)# change the job as the input
parameter
for i in range(10):pos, var_list = vs_trigger()meausrement
tp_popup("{0}".format(var_list))# Execute the vision

if var_list[0] == 1:# Check the inspection result
robot_posx_meas = vs_get_offset_pos(pos, VS_POS1) # offset the
robot pose
tp_popup("{0}".format(robot_posx_meas))
else:
tp_popup("Inspection Fail")
vs_disconnect()

10.2.8 vs_trigger()
FeaturesThis function transmits the measurement command to the vision system. If the measurement is successful, theresult is returned.(*VS_TYPE: DR_VS_COGNEX, DR_VS_SICK)

ReturnValue

Data Type

Description

pos

posx

pos: measuring position of an object (posx parameter type)var_listlist[float]

var_list: Additional measurement results entered by Usersex) Check pass/fail, distance measurement, angle measurement, etc.

-1, []

int

failed- 426 -

Programming manual(V2.10)

External Vision Commands

Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

vs_set_info(DR_VS_COGNEX)
vs_connect("192.168.137.10")# Select type of vision sensor# Vision IP, Default port

vis_posx = posx (410,310,300,0,0,0)
data - visionrob_posx = posx (400,300,300,0,180,0)
robot# Define the initial posx
# Define the initial posx data -vs_set_init_pos(vis_posx, rob_posx, VS_POS1) # Enter the initial posx data
to Visionfor i in range(10):pos, var_list = vs_trigger()# Execute the vision
meausrement
if var_list[0] == 1:# Check the inspection result
robot_posx_meas = vs_get_offset_pos(pos, VS_POS1) # offset the
robot pose
movel(robot_posx_meas)# move the robot pose
else:
tp_popup("Inspection Fail")
vs_disconnect()

10.2.9 vs_set_init_pos(vision_posx_init, robot_posx_init, vs_pos=1)
Features
Enter the initial position information of the object to perform the vision guidance operation.
(*VS_TYPE: DR_VS_COGNEX, DR_VS_SICK)

Parameters
Parameter Name

Data TypeDefault
Value

Description

vision_posx_init

posx

-

Vision measurement coordinate initial value

robot_posx_init

posx

-

Coordinate initial value for robot work

vs_posint

1

The pos number of the initial value entered- 427 -

Programming manual(V2.10)

External Vision Commands

ReturnValue

Data Type

Description

vs_posint

Success – The entered pos number

-1

int

FailedExample
1
2
3
4
5
6
7
8
9
10
11
12
13

vs_set_info(DR_VS_COGNEX)# Select type of vision sensor
vs_connect("192.168.137.10")# Vision IP, Default port
vis_posx = posx (410,310,300,0,0,0)# Define the initial posx
data - visionrob_posx = posx (400,300,300,0,180,0)# Define the initial posx data robot
vs_set_init_pos(vis_posx, rob_posx, VS_POS1) # Enter the initial posx data
to Visionfor i in range(10):pos, var_list = vs_trigger()# Execute the vision
meausrement
if var_list[0] == 1:# Check the inspection result
robot_posx_meas = vs_get_offset_pos(pos, VS_POS1) # offset the
robot pose
movel(robot_posx_meas)# move the robot pose
else:
tp_popup("Inspection Fail")
vs_disconnect()

10.2.10 vs_get_offset_pos(vision_posx _meas, vs_pos=1)
Features
The coordinate of the robot is calculated using the coordinate values, measured in the vision system. The initialvalue should be entered in advance through vs_set_init_pos.

Parameters
Parameter Name

Data TypeDefault
Value

Description

vision_posx_meas

posx

-

Vision measurement coordinate values, caculated using
vs_trigger- 428 -

Programming manual(V2.10)

External Vision Commands

Parameter Name

Data TypeDefault
Value

Description

vs_posint

1

Pos number of the robot initial value to calculate offset
coordinate

Value

Data Type

Description

robot_posx_meas

posx

Success-1

int

FailedReturnExample
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

vs_set_info(DR_VS_COGNEX)
vs_connect("192.168.137.10")# Select type of vision sensor# Vision IP, Default port

vis_posx = posx (410,310,300,0,0,0)
data - visionrob_posx = posx (400,300,300,0,180,0)
robot# Define the initial posx
# Define the initial posx data -vs_set_init_pos(vis_posx, rob_posx, VS_POS1) # Enter the initial posx data
to Visionfor i in range(10):pos, var_list = vs_trigger()# Execute the vision
meausrement
if var_list[0] == 1:# Check the inspection result
robot_posx_meas = vs_get_offset_pos(pos, VS_POS1) # offset the
robot pose
movel(robot_posx_meas)# move the robot pose
else:
tp_popup("Inspection Fail")
vs_disconnect()- 429 -

Programming manual(V2.10)

External Vision Commands

10.2.11 Integrated example - DR_VS_COGNEX, DR_VS_SICKExample
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

vs_set_info(DR_VS_COGNEX)
sensorif ( vs_connect("192.168.137.10") != 0 ):port
tp_popup("connection fail",DR_PM_MESSAGE)
exit()
vis_posx_init = posx (410,310,300,0,0,0)
posx data - visionrob_posx_init1 = posx (400,300,300,0,180,0)
posx data - robot
rob_posx_init2 = posx (420,320,300,0,180,0)
posx data - robot# Select type of vision# Vision IP, Default# Define the initial# Define the initial# Define the initial

vs_set_init_pos(vis_posx_init, rob_posx_init1, VS_POS1) # Enter the
initial posx data to Visionvs_set_init_pos(vis_posx_init, rob_posx_init2, VS_POS2)
for i in range(10):pos_meas, var_list = vs_trigger()# Execute the vision
meausrement
if pos_meas==-1:# Vision Fail to measure the object
tp_popup("Vision measure fail")continueif var_list[0] == 1:# Check the inspection result# Get guided posx data
rob_posx1_meas = vs_get_offset_pos(pos_meas, VS_POS1) # offset the
robot pose
rob_posx2_meas = vs_get_offset_pos(pos_meas, VS_POS2) # offset the
robot pose
movel(rob_posx1_meas)
movel(rob_posx2_meas)
else:
tp_popup("Inspection Fail")continue
vs_disconnect()

10.2.12 vs_request(cmd)
FeaturesThis function sets the feature for the vision system to request- 430 -

Programming manual(V2.10)

External Vision Commands(*VS_TYPE: DR_VS_CUSTOM)

Parameters
Parameter Name

Data TypeDefault
Value

Description

cmd

int

-

The number of objects to be detected by the visionsystemReturnValue

Description0

Success-1

Failed-2

Communication timed out (3 sec.)

Example1

vs_request(1)job# request the vision measurement on the “1”

10.2.13 vs_result()
FeaturesThis function retrieves the processing result of the vision system.
(*VS_TYPE: DR_VS_CUSTOM)

ReturnValue

Description

cnt

Success(>=1)

The number of objects detected by the vision system

resultPosition list as a result of the vision system (x coordinate, y coordinate, rotation
value)- 431 -

Programming manual(V2.10)

External Vision Commands

Value

Description-

cnt =-2 and res = empty list if failed

Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

vs_set_info(DR_VS_CUSTOM)
res = vs_connect("192.168.137.200", 9999)#Vision and communication
connection attempt
if res !=0:
#Check the result of communication connection
tp_popup("connection fail",DR_PM_MESSAGE) #If connection fails, programends
exit()
ret = vs_request(1)#Request for object vision measurement informationcnt, result = vs_result()
information# Get object measurement resultfor i in range(cnt):
x = result[i][0]y = result[i][1]t = result[i][2]tp_popup("x={0},y={1}, t={2}".format(result[i][0], result[i][1],result[i][2]),DR_PM_MESSAGE)

10.2.14 Integrated example - DR_VS_CUSTOM
Communication Protocol
The vision system must conform to the following protocol to ensure that vision commands run properly.

- 432 -

Programming manual(V2.10)

External Vision Commands

vs_request (cmd)
1. Robot controller → Vision system• "MEAS_START" +cmd[4byte]• cmd refers to the number of detected objects: Conversion of the integer to 4 bytes. ex) cmd=1 →00000001• ex) In case of cmd= 1 : “MEAS_START"+00000001• Acutal packet : 4D4541535F535441525400000001
2. Vision system → Robot controller• "MEAS_OK" is transmitted if the vision system is normal, and "MEAS_NG" is transmitted
otherwise.

vs_result()
1. Robot controller → Vision system• “MEAS_REQUEST"
2. Vision system → Robot controller• “MEAS_INFO" +cnt[4byte] +[(x[4byte] + y[4byte] + t[4byte]) x cnt]
• cnt refers to the number of detected objects.
• The transmitted x (x coordinate), y (y coordinate), and t (rotation value) must be scaled up
100 times.
• ex) cnt = 1 , (x=1.1 , y=2.2, t=3.3)• “MEAS_INFO"+1[4byte] +110[4byte] +220[4byte] +330[4byte]• Actual packet: 4D4541535F494E464F000000010000006E000000DC0000014A• ex) cnt = 2 , (x=1.1 , y=2.2, t=3.3) (x=1.1 , y=-2.2, t=-3.3)• “MEAS_ INFO"+2[4byte] +110[4byte] +220[4byte] +330[4byte]+110[4byte]-220[4byte] -330[4byte]- 433 -

Programming manual(V2.10)

External Vision Commands• Actual packet:
4D4541535F494E464F000000020000006E000000DC0000014A0000006EFFFFFF24
FFFFFEB6

Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

vs_set_info(DR_VS_CUSTOM)
res = vs_connect("192.168.137.200", 9999)#Vision and communication
connection attempt
if res !=0:
#Check theresult of communication connection
tp_popup("connection fail",DR_PM_MESSAGE) #Upon connection failure,
program termination
exit()
ret = vs_request(1)Measurement Information for No. 1 Object#Request of Visioncnt, result = vs_result()
measurement result information#Get object

for i in range(cnt):
x = result[i][0]y = result[i][1]t = result[i][2]tp_popup("x={0},y={1}, t={2}".format(result[i][0], result[i][1],result[i][2]),DR_PM_MESSAGE)

10.3 Pickit 3D
Pickit 3D commands are composed as follows.
No
.

구분

명령어

1

Camera Connection

pickit_connect(ip)(p. 435)
pickit_disconnect()(p. 435)

2

Vision Job Manage

pickit_change_configuration(setup_id, product_id))(p. 436)

3

Camera Calibration

pickit_request_calibration()(p. 437)

4

Object Recognition/
Detection

pickit_detection(offset_z)(p. 437)

- 434 -

Programming manual(V2.10)

External Vision Commands

No
.

구분

명령어

pickit_next_object(offset_z)(p. 439)
5

Backuppickit_save_snapshot()(p. 441)

10.3.1 pickit_connect(ip)FeaturesThis function establishes communication with the vision system.
The default IP of PickIt is 192.168.66.1, and the user must use an PickIt IP in the same bandwidth range as Robot
IP. See the Pickit Support site for details on how to use it.

Parameters
Parameter Name

Data TypeDefault
Value

Description

ip_addr

str-

Server IP of Pickit 3D (ex, 192.168.137.90)

ReturnValue

Description

0

Connection success-1

Connection failed

Example1
2

pickit_connect("192.168.137.90") #Connect to vision - Vision IP
pickit_disconnect()#Disconnect to vision

10.3.2 pickit_disconnect()FeaturesThis function terminates the connection to the vision system.

- 435 -

Programming manual(V2.10)

External Vision Commands

ReturnValue

Description

N/A

Example1
2

pickit_connect("192.168.137.90")#Connect to vision - Vision IP
pickit_disconnect()#Disconnect to vision

10.3.3 pickit_change_configuration(setup_id, product_id))
FeaturesThis function loads setup_id and product_id set in the vision system.

Parameters
Parameter Name

Data TypeDefault
Value

Description

Setup_idint-

The setup_id number stored in the Pickit server.

Product_id

int

The product_id number stored in the Pickit server

ReturnValue

Description

0

Connection success-1

Connection failed

Example1
2
3

pickit_connect("192.168.137.90")
pickit_change_configuration(6, 8) # These numbers are defined in Pickit
pickit_disconnect()- 436 -

Programming manual(V2.10)

External Vision Commands

10.3.4 pickit_request_calibration()
FeaturesThis function requests a calibration once from the vision system

ReturnValue

Description

0

Connection success-1

Connection failed

Example1
2
3

pickit_connect("192.168.137.90")
pickit_request_calibration()
pickit_disconnect()10.3.5 pickit_detection(offset_z)
FeaturesThis function detects the input model and returns (pick_prepos, pick_pos).

Parameters
Parameter Name

Data TypeDefault
Value

Description

offset_z

int-

The offset_z sets to 'pick_prepos' distance.

- 437 -

Programming manual(V2.10)

External Vision Commands

ReturnValue

Data type

data_dictionary ={'pick_pos':pick_pos,'pick_prepos':pick_prepos,'object_age':data['object_age'],'object_type':data['object_type'],'object_dimensions':data['
object_dimensions'],'object_remaining':data['objects_remaining'],'status':data['status'

Description'pick_pos': Model recognition position,{'pick_pos': posx,'pick_prepos': Offset Value of model recognition
position,'pick_prepos':posx,'object_age': int,
'object_type':
int ,'object_dimensions':
int ,'object_remaining':
int ,'object_age': The amount of time that has passed
between the capturing of the camera data and themoment the object information is sent to the robot.
This value has to be divided by the MULT factor.,'object_type': The type of object detected at
object_pose ,'object_dimensions': When reading array elements,
each value has to be divided by the MULT factor. ,'status': int}

'object_remaining': Only one object per
pickit_to_robot_data message can be communicated.
If this field is non-zero, it contains the number ofremaining objects that can be sent in next messages
to the robot. ,'status': Contains the Pickit status or a response topreviously received robot commands.

Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

set_singular_handling(DR_AVOID)
set_velj(60.0)
set_accj(100.0)
set_velx(250.0, 80.625)
set_accx(1000.0, 322.5)
pickit_connect("192.168.137.90")
pickit_change_configuration( 7,10 ) # These numbers are defined in Pickit
data = pickit_detection(100)if data['status'] == ResponseStatus.OBJECTS_FOUND:# Picking motion
movel(data['pick_prepos'])
movel(data['pick_pos'])
movel(data['pick_prepos'])
pickit_disconnect()- 438 -

Programming manual(V2.10)

External Vision Commands

10.3.6 pickit_next_object(offset_z)
FeaturesThis function returns pick_prepos and pick_pos detected next to the input model.

Parameters
Parameter Name

Data TypeDefault Value

Description

offset_z

int-

The offset_z sets to 'pick_prepos'
distance.

- 439 -

Programming manual(V2.10)

External Vision Commands

ReturnValue

Data Typedata_dictionary = {'pick_pos':pick_pos,'pick_prepos':pick_prepos,'object_age':data['object_age'],'object_type':data['object_type'],'object_dimensions':data['object_dimensions'],'object_remaining':data['objects_remaining'],'status':data['status']}{'pick_pos': posx,'pick_prepos':posx,'object_age': int,
'object_type':
int ,'object_dimensions': int ,'object_remaining': int ,
'status': int}

Description'pick_pos': Model recognition
position,'pick_prepos': Offset value ofmodel recognition
position,'object_age': The amount of timethat has passed between thecapturing of the camera data andthe moment the object
information is sent to the robot.
This value has to be divided by
the MULT factor.,'object_type': The type of object
detected at object_pose ,'object_dimensions':
When reading array elements,
each value has to be divided by
the MULT factor. ,'object_remaining': Only one
object per pickit_to_robot_data
message can be communicated. If
this field is non-zero, it contains
the number of remaining objects
that can be sent in next messages
to the robot. ,'status': Contains the Pickit
status or a response to previously
received robot commands.

Example
1
2
3
4
5
6
7
8
9
10

pickit_connect("192.168.137.90")
pickit_change_configuration(7, 10) # These numbers are defined in Pickit
set_singular_handling(DR_AVOID)
set_velj(60.0)
set_accj(100.0)
set_velx(250.0, 80.625)
set_accx(1000.0, 322.5)
home_pos = posx(122.09, 35.28, 303.63, 140.45, 158.9, 134.39)
while True:- 440 -

Programming manual(V2.10)

External Vision Commands

11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29

# Detection
data = pickit_detection(100)if data['status'] == ResponseStatus.OBJECTS_FOUND:# Picking motion
movel(data['pick_prepos'])
movel(data['pick_pos'])
movel(data['pick_prepos'])
remaining = data['object_remaining']
while remaining > 0:data = pickit_next_object(100)remaining = data['object_remaining']# Picking motion
movel(data['pick_prepos'])
movel(data['pick_pos'])
movel(data['pick_prepos'])
pickit_disconnect()10.3.7 pickit_save_snapshot()FeaturesThis function saves the snapshot to the server.

ReturnValue

Description

0

Connection success-1

Connection failed

Example123
45

pickit_connect("192.168.137.90")
pickit_save_snapshot()pickit_disconnect()- 441 -

Programming manual(V2.10)

External Vision Commands

10.3.8 Integrated example - Pickit 3D
Example 1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

### For robot-camera calibration example ###set_singular_handling(DR_AVOID)
set_velj(60.0)
set_accj(100.0)
set_velx(250.0, 80.625)
set_accx(1000.0, 322.5)
pickit_connect("192.168.137.90")# Move to Pose #
pos1= posx(476.76, -151.68, 384.83, 33.36, 24.71, 95.44)
pos2= posx(495.86, -150.08, 435.69, 1.43, 8.21, 122.25)
pos3= posx(508.79, -83.06, 446.94, 82.88, -35.91, 39.23)
pos4= posx(521.66, -146.28, 431.8, 29.71, -33.73, 82.42)
pos5= posx(508.35, -147.45, 386.37, 101.03, 38.04, 42.68)
movel(pos1)
pickit_request_calibration()movel(pos2)
pickit_request_calibration()movel(pos3)
pickit_request_calibration()movel(pos4)
pickit_request_calibration()movel(pos5)
pickit_request_calibration()

Example 2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

### For simple picking example ###pickit_connect("192.168.137.90")
pickit_change_configuration( 7,10 ) # These numbers are defined in Pickit
set_singular_handling(DR_AVOID)
set_velj(60.0)
set_accj(100.0)
set_velx(250.0, 80.625)
set_accx(1000.0, 322.5)
home_pos = posx(122.09, 35.28, 303.63, 140.45, 158.9, 134.39)#Move to home pose
movel(home_pos)# Detection
data = pickit_detection(100)if data['status'] == ResponseStatus.OBJECTS_FOUND:- 442 -

Programming manual(V2.10)

External Vision Commands

17
18
19
20
21
22

# Picking motion
movel(data['pick_prepos'])
movel(data['pick_pos'])
movel(data['pick_prepos'])
pickit_disconnect()Example 3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

### For multiple parts picking example ###pickit_connect("192.168.137.90")
pickit_change_configuration(7, 10) # These numbers are defined in Pickit
set_singular_handling(DR_AVOID)
set_velj(60.0)
set_accj(100.0)
set_velx(250.0, 80.625)
set_accx(1000.0, 322.5)
home_pos = posx(122.09, 35.28, 303.63, 140.45, 158.9, 134.39)
while True:# Move to home pose
movel(home_pos)# Detection
data = pickit_detection(100)if data['status'] == ResponseStatus.OBJECTS_FOUND:# Picking motion
movel(data['pick_prepos'])
movel(data['pick_pos'])
movel(data['pick_prepos'])
remaining = data['object_remaining']
while remaining > 0:data = pickit_next_object(100)remaining = data['object_remaining']# Picking motion
movel(data['pick_prepos'])
movel(data['pick_pos'])
movel(data['pick_prepos'])- 443 -

Programming manual(V2.10)

Doosan Vision(SVM) Command

11 Doosan Vision(SVM) Command
Doosan Smart Vision Module(SVM) commands are composed as follows.
Type1

Details

CameraConnection

Command.svm_connect(ip=”192.168.137.5”, port=20)v2.8working(p. 445)
svm_disconnect()(p. 446)

2

Check Image
Qualitysvm_set_led_brightness(value)(p. 446)
svm_get_led_brightness()(p. 447)
svm_set_camera_exp_val(value)(p. 447)
svm_set_camera_gain_val(value)(p. 448)
svm_set_camera_load(job_id)(p. 449)

3

Vision Job Manage

svm_set_job(job_id)(p. 449)

4

Camera Calibration

svm_get_robot_pose(job_id)(p. 450)

5ObjectRecognition/
Detection

Object Detection

svm_get_vision_info(job_id)(p. 451)
svm_get_variable(tool_id, var_type)(p. 452)

Landmark
Detection

svm_detect_landmark(job_id)(p. 453)
svm_get_marker_offset_pose(cpos, offset, euler_mode)(p. 454)

Barcode Detection

svm_get_detect_barcode()(p. 455)
svm_get_barcode_db_data(index)(p. 456)
svm_compare_barcode_db_data(dbdata)(p. 457)

6

Robot Task

svm_set_init_pos_data(Id_list, Pos_list)(p. 457)

- 444 -

Programming manual(V2.10)

Doosan Vision(SVM) Command

Type

Details

Commandsvm_get_offset_pos(posx_robot_init, job_id, tool_id)(p. 459)

7

Other SVM
commands

svm_set_tp_popup (svm_flag)(p. 460)

11.1 Camera Connection
11.1.1 svm_connect(ip=”192.168.137.5”, port=20)
FeaturesThis function establishes communication with the SVM.

Parameters
Parameter Name

Data TypeDefault
Value

Description

ip

str

“192.168.1
37.5”

SVM Server IP address

port

int

20

Port number

ReturnValue

Description

0

Connection success-1

Connection failed

Example1
2
3

svm_connect()#Connect to vision - Default IP address and port number# Enter the vision task
svm_disconnect()#Disconnect to vision- 445 -

Programming manual(V2.10)

Doosan Vision(SVM) Command

11.1.2 svm_disconnect()FeaturesThis function terminates the connection to the SVM.

ReturnValue

Description

N/A

N/A

Example1
2
3

svm_connect() #Connect to vision – Default IP address and port
# Enter the vision task
svm_disconnect()#Disconnect to vision

11.2 Check Image Quality
11.2.1 svm_set_led_brightness(value)
Features
Set SVM LED brightness value.

Parameters
Parameter Name

Data TypeDefault
Value

Description

value

int

-

LED brightness value (0-1000).

ReturnValue

Description-1

Fail - No measurement data or input variable error.

- 446 -

Programming manual(V2.10)

Doosan Vision(SVM) Command

Example1
2
3

svm_connect()svm_set_led_brigtness(500)svm_disconnect()# Connect to vision# Disconnect to vision

11.2.2 svm_get_led_brightness()
Features
Return the LED brightness value set in the SVM.

ReturnValue

Description

int

SVM brightness value (0-1000)-1

Fail - No measurement data or input variable error.

Example1
2
3

svm_connect()svm_get_led_brigtness()
svm_disconnect()# Connect to vision# Disconnect to vision

11.2.3 svm_set_camera_exp_val(value)
FeaturesSet exposure value of the SVM.

Parameters
Parameter Name

Data TypeDefault
Value

Description

value

int

-

SVM exposure value (2,660,000 – 29,260,000)- 447 -

Programming manual(V2.10)

Doosan Vision(SVM) Command

ReturnValue

Description-1

Fail - No measurement data or input variable error.

Example1
2
3

svm_connect()svm_set_camera_exp_val(2,660,000)
svm_disconnect()# Connect to vision# Disconnect to vision

11.2.4 svm_set_camera_gain_val(value)
Features
Set SVM gain value..

Parameters
Parameter Name

Data TypeDefault
Value

Description

value

int

1

SVM gain value (0-1600).

ReturnValue

Description-1

Fail - No measurement data or input variable error.

Example1
2
3

svm_connect()svm_set_camera_gain_val(500)svm_disconnect()# Connect to vision# Disconnect to vision- 448 -

Programming manual(V2.10)

Doosan Vision(SVM) Command

11.2.5 svm_set_camera_load(job_id)
Features
Load LED brightness, exp, gain and focus setting saved in the Job numbered job_id.

Parameters
Parameter Name

Data Type

job

int

Default
Value

Description

job id(ex - 1000, 2000, 3000)

ReturnValue

Description-1

Fail - No measurement data or input variable error.

Example1
2
3

svm_connect()svm_set_camera_load(job_id)
svm_disconnect()# Connect to vision# Disconnect to vision

11.3 Vision Job Manage
11.3.1 svm_set_job(job_id)
FeaturesThis function loads the Vision task corresponding to the input id into the SVM..

Parameters
Parameter Name

Data TypeDefault
Value

Description

job_idint-

Vision Task id (예. 1000, 2000, …)- 449 -

Programming manual(V2.10)

Doosan Vision(SVM) Command

ReturnValue

Description0

Job Loading success-1

Job Loading fail

Example12
3
4

svm_connect()#Connect to vision - Vision IP, Default portvision_test=1000# Define vision job ID
svm_set_job(vision_test)# Load the vision_test (1000)
svm_disconnect()#Disconnect to vision

11.4 Camera Calibration
11.4.1 svm_get_robot_pose(job_id)
Features
The robot pose information(joint coordinate system) set in the vision task is loaded. Robot pose information isused as shoot_pose for vision task.

Parameters
Parameter Name

Data TypeDefault
Value

Description

job_idint-

Vision Task id (예. 1000, 2000, …)

Return
Value

Desciption

float [6]Robot joint coordinate information (posj type)-1

failed- 450 -

Programming manual(V2.10)

Doosan Vision(SVM) Command

Example
1
2
3
4
5
6

svm_connect()# Connect to visionvision_test=1000# Define vision job ID
svm_set_job(vision_test)# Load the vision_test (1000)
shoot_pos=svm_get_robot_pose (vision_test) # Load the robot pose ofvision_test
tp_popup("{0}".format(shoot_pos))svm_disconnect()# Disconnect to vision

11.5 Object Recognition/Detection
11.5.1 svm_get_vision_info(job_id)
Features
Performs the measurement command corresponding to the input vision task. The detailed information of themeasurement command of the vision work should be entered in advance through the Workcell manager(WCM).

Parameters
Parameter Name

Data TypeDefault
Value

Description

job_idint-

Vision Task id (ex. 1000, 2000, …)

ReturnValue

Description

1

Measurement success – One object was detected / measured successfully.

0

Measurement failed – Failed to detect the corresponding vision work object.

-1

Measurement failed – Communication error (timeout)

Example1
2
3

svm_connect()vision_test=1000
svm_set_job(vision_test)# Connect to vision# Define vision job ID# Load the vision_test (1000)- 451 -

Programming manual(V2.10)

Doosan Vision(SVM) Command

4
5
6
7

shoot_pos=svm_get_robot_pose (vision_test) # Load the robot pose ofvision_test
count=svm_get_vision_info(vision_test)# Execute the vision
measurement
tp_popup("{0}".format(count))# Check the result
svm_disconnect()# Disconnect to vision

11.5.2 svm_get_variable(tool_id, var_type)FeaturesIf the object detection/measurement is successful(1) by executing svm_get_vision_info, the detection/measurement data is loaded. Enter the tool id and variable type for the data to be loaded.
• Position tool: POSX_TYPE (Object location), VALUE_TYPE (Detection similarity)• Presence tool: INSP_TYPE (Presence inspection result), VALUE_TYPE (Pixel count)• Distance tool: INSP_TYPE (Distance inspection result), VALUE_TYPE (Distance measure)• Angle tool: INSP _TYPE (Angle inspection result), VALUE_TYPE (Angle measure)• Diameter tool: INSP _TYPE (Diameter inspection result), VALUE_TYPE (Diameter measure), POSX_TYPE(Circle center position)

Parameters
Parameter Name

Data TypeDefault
Value

Description

tool_id

int-

Vision tool id (ex. 1000, 1001, 1002, …)

var_type

int-

POSX_TYPE: Vision measurement coordinate variable(posx)
INSP_TYPE: Inspection result variable (int)
VALEU_TYPE: Measurement result (int or float)

ReturnValue

Description

variable

POSX_TYPE – Coordinate information variable, ex. Posx(x,y,z,rx,ry,rz)
INSP_TYPE: Inspection result variable - int (Returns 1 if successful)
VALEU_TYPE: Measurement result variable (int of float)-1

Failed – No measurement data or input variable error.

- 452 -

Programming manual(V2.10)

Doosan Vision(SVM) Command

Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

svm_connect()# Connect to visionvision_test=1000# Define vision job ID
print_insp=1001# Define inspection tool ID
box_size=1002# Define measurement tool ID
count=svm_get_vision_info(vision_test)# Execute the vision
measurement
if (count==1):# Check the result# Get the position information (posx) of vision_test tool
pos_result=svm_get_variable(vision_test, POSX_TYPE)
tp_popup("{0}".format(pos_result))# Get the inspection information (PASS or Fail) of print_insp tool
inspection_result=svm_get_variable(print_insp, INSP_TYPE)
tp_popup("{0}".format(inspection_result))# Get the distance information (distance) of box_size tool
measurement_result= svm_get_variable(box_size, VALUE_TYPE)
tp_popup("{0}".format(measurement_result))
vs_disconnect()# Disconnect to vision

11.5.3 svm_detect_landmark(job_id)
FeaturesDetect the landmark information with respect to Camera coordinage using a job_id.

Parameters
Parameter Name

Data TypeDefault
Value

Description

job

int

job id(ex - 1000, 2000, 3000)

Value

Data Type

Description

count

int

Number of detected landmarks

cpos

list[Tx,Ty,Tz,Rx,Ry,Rz]

Landmark pose based on camera coordinates

Return- 453 -

Programming manual(V2.10)

Doosan Vision(SVM) Command

Value

Data Type

Description

0, []Int, list

landmark detection failure

Example12
3
4

svm_connect()# Connect to visioncount, cpos = svm_detect_landmark(1000)
tp_popup("Landmark number={0}, Landmark with respect to Camera={1}".format(
count, cpos))svm_disconnect()# Disconnect to vision

11.5.4 svm_get_marker_offset_pose(cpos, offset, euler_mode)
Features
Estimate the landmark pose with respect to Robot coordinate by using offset from the origin of the landmark.

Parameters
Parameter Name

Data Typecpos§ list[Tx,Ty, Tz, Rx,
Ry, Rz]Default
Value

Description

Landmark pose based on camera coordinates- 454 -

Programming manual(V2.10)

Doosan Vision(SVM) Command

Parameter Name

Data TypeDefault
Value

Description

offsetlist[Tx, Ty,
Rz]

Position and angle of rotation away from the landmark
origineuler_mode

booleanOrientation option for Landmark pose with respect to
Robot coordinate: ZYZ for “True”, XYZ for “False”

Value

Data Type

Description

rpos

list[Tx, Ty, Tz, Rz, Ry, Rz']or list[Tx, Ty, Tz, Rx, Ry,
Rz]

Landmark pose based on robot coordinates or
Landmark pose with offset set

-1

Int

Fail – no measurement data or input variable error

ReturnExample
1
2
3
4
5
6
7

svm_connect()# Connect to visionoffset = [10,-20, 45]
euler_mode = True
rpos = svm_get_marker_offset_pose(cpos, offset, euler_mode)
tp_popup("Landmark with respect to Robot={0}".format(rpos))svm_disconnect()# Disconnect to vision

11.5.5 svm_get_detect_barcode()
Features
It detects barcodes and QR codes displayed on the screen.

ReturnValue

Data Type

Description

ret

int

1 on success - Barcode detected

Btype

stringDetected barcode type

- 455 -

Programming manual(V2.10)

Doosan Vision(SVM) Command

Value

Data Type

Description

bdata

stringInformation contained in the detected barcode

0,[],[]

Int

Fail – no measurement data or input variable error

Example12
3
4

svm_connect()# Connect to vision
ret, btype, bdata = svm_detect_barcode()
tp_popup("Detection={0}, Type={1}, Data={2}".format(ret,btype,bdata))
svm_disconnect()# Disconnect to vision

11.5.6 svm_get_barcode_db_data(index)
Features
Returns the value in Barcode DB in SVM using index.

Parameters
Parameter Name

Data Type

index

int

Default
Value

Description

index(ex - 1, 2, 3, …)

ReturnValue

Data Type

Description

db_datastringReturn the value in Barcode DB using index.

“-1”

stringIf you use the wrong index or there is no information in the DB.

Example12
3
4

svm_connect()
db_data = svm_get_barcode_db_data(1)tp_popup("DB Data={0}".format(db_data))
svm_disconnect()- 456 -# Connect to vision# Disconnect to vision

Programming manual(V2.10)

Doosan Vision(SVM) Command

11.5.7 svm_compare_barcode_db_data(dbdata)
Features
After comparing the entered argument with the barcode DB stored in the SVM, check whether it is a stored
value.

Parameters
Parameter Name

Data TypeDefault
Value

Description

dbdatastringInformation contained in the barcode to be used forcomparison.

Value

Data Type

Description

0 or 1int

After comparison, check whether the value is stored in
Barcode DB in SVM

ReturnWhen it is ‘0’, the value is not stored in the DB.
When it is '1', the value stored in the DB

Example12
3
4

svm_connect()# Connect to vision
ret = svm_compare_barcode_db_data(bdata)
tp_popup("Comparison result={0}".format(ret))
svm_disconnect()# Disconnect to vision

11.6 Robot Task
11.6.1 svm_set_init_pos_data(Id_list, Pos_list)
Features
Enter the initial id_list and posx_list information of the object to perform the vision guidance operation.
Caution- 457 -

Programming manual(V2.10)

Doosan Vision(SVM) Command• Be sure to set the settings before calling the function svm_get_offset_pos (posx_robot_init,
job_id, tool_id).
• Note : id_list and pos_list should be matched with posx corresponding to each id.

Parameters
Parameter Name

Data TypeDefault
Value

Description

Id_list

List(int)-

Id list ([id, id, id, …])

Pos_list

List(Posx)-

Posx list (ex.[posx, posx, posx, …])

ReturnValue

Description

None

-

Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

svm_connect()# Connect to visionvision_test=1000# Define vision job ID
count=svm_get_vision_info(vision_test)# Execute the vision
measurement
if (count == 1):# Check the result# Get the position information (posx) of vision_test tool
pos_result=svm_get_variable(vision_test, POSX_TYPE)
tp_popup("{0}".format(pos_result))# Get the vision guided robot pose
ld_list =[vision_test]
pos_list =[pos_result]svm_set_init_pos_data(Id_list,pos_list)
rob_posx=svm_get_offset_pos(posx(200,200,100,0,180,0), vision_test)
tp_popup("{0}".format(rob_posx))# move to the rob_posx
movel(rob_posx, vel=30, acc=100)
svm_disconnect()# Disconnect to vision- 458 -

Programming manual(V2.10)

Doosan Vision(SVM) Command

11.6.2 svm_get_offset_pos(posx_robot_init, job_id, tool_id)
Features
The robot task coordinate information reflecting the vision measurement result is loaded into the robot work
coordinate input by the user.
• Procedure: Input posx_robot_init → Vision measurement → Call svm_get_offset_pos → Changed robot
work coordinates (posx_robot_offset) output

Parameters
Parameter Name

Data TypeDefault
Value

Description

posx_robot_init

posx

-

Robot task coordinate information)(Input by direct teaching method.)

job_idInt-

Vision job id (ex. 1000, 2000, 3000, …)

tool_id

int-

Vision tool id (ex. 1000, 1001, 1002, …)

ReturnValue

Description

posx

Robot work coordinate information reflecting vision measurement result-1

Failed – No measurement data or input variable error.

Example
1
2
3
4
5
6
7
8
9
10
11

svm_connect()# Connect to visionvision_test=1000# Define vision job ID
count=svm_get_vision_info(vision_test)# Execute the vision
measurement
if (count == 1):# Check the result# Get the position information (posx) of vision_test tool
pos_result=svm_get_variable(vision_test, POSX_TYPE)
tp_popup("{0}".format(pos_result))# Get the vision guided robot pose
ld_list =[vision_test]
pos_list =[pos_result]svm_set_init_pos_data(Id_list,pos_list)- 459 -

Programming manual(V2.10)

Doosan Vision(SVM) Command

12
13
14
15
16
17
18

rob_posx=svm_get_offset_pos(posx(200,200,100,0,180,0), vision_test)
tp_popup("{0}".format(rob_posx))# move to the rob_posx
movel(rob_posx, vel=30, acc=100)
svm_disconnect()# Disconnect to vision

11.7 Other SVM commands
11.7.1 svm_set_tp_popup (svm_flag)
FeaturesSet whether (tp_popup) should be displayed when SVM error occurs.

Parameters
Parameter Name

Data TypeDefault
Value

Description

svm_flagint

1

1(Activation), 0(Deactivation)

ReturnValue

Description

None

-

Example1
2
3

svm_set_tp_popup(0)svm_connect()svm_disconnect()# Hide tp_popup# Connect to vision# Disconnect to vision

11.8 Integrated example (SVM)
11.8.1 Example
Vision Job setting status• After deleting all the jobs saved in WCM, create vision task / tool as below.

- 460 -

Programming manual(V2.10)

Doosan Vision(SVM) Command• Create vision task : vision_test (position tool, 1000)• Add vision tools: print_insp (presence tool, 1001), box_size (distance tool, 1002)• Select the "vision_test" task in TW vision command set the variable information.
• Add the following example to your custom code to test.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34

svm_connect()# Connect to visionvision_test=1000# Define vision job ID
print_insp=1001# Define inspection tool ID
box_size=1002# Define measurement tool ID
svm_set_job(vision_test)# Load the vision_test (1000)
movej(svm_get_robot_pose(vision_test), vel=10, acc=20) # Move to shootpose (movej)
if (svm_get_vision_info(vision_test)== 1): # Execute the vision
measurement# Load the vision variables# Get the position information (posx) of vision_test tool
pos_result=svm_get_variable(vision_test, POSX_TYPE)
tp_popup("pos_result {0}".format(pos_result))# Get the inspection information (PASS or Fail) of print_insp tool
inspection_result=svm_get_variable(print_insp, INSP_TYPE)
tp_popup("inspection_result {0}".format(inspection_result))# Get the distance information (distance) of box_size tool
measurement_result= svm_get_variable(box_size, VALUE_TYPE)
tp_popup("measurement_result {0}".format(measurement_result))# Move to the vision guided robot pose
# Get the vision guided robot pose
ld_list =[vision_test]
pos_list =[pos_result]svm_set_init_pos_data(Id_list,pos_list)
rob_posx=svm_get_offset_pos(posx(200,200,100,0,180,0), vision_test)
tp_popup("rob_posx {0}".format(rob_posx))# move to the rob_posx
movel(rob_posx, vel=30, acc=100)
svm_disconnect()# Disconnect to vision- 461 -

Programming manual(V2.10)

Application Commands

12 Application Commands
12.1 External Encoder Setting Commands
12.1.1 set_extenc_polarity(channel, polarity_A, polarity_B, polarity_Z,
polarity_S)
Features
It configures the polarity of phase A, B and the trigger method of phase S, Z of the corresponding encoder
channel.

Parameters
Parameter Name

Data TypeDefault
Value

Description

channelint

1

Encoder channel (1, 2)
1: Channel 1
2: Channel 2polarity_A

int0

Polarity of phase A (0: Phase A, 1: /Phase A)

polarity_B

int0

Polarity of phase B (0: Phase B, 1: /Phase B)

polarity_Z

int0

Trigger method of Phase Z (0: Falling edge, 1: Rising edge)

polarity_S

int0

Trigger method of Phase S (0: Falling edge, 1: Rising edge)

ReturnValue

Description

N/A

Not Used

Exception
Exception

Description

N/A

Not Used- 462 -

Programming manual(V2.10)

Application Commands

Example12

set_extenc_polarity(1, 0, 1, 0, 1)# External Encoder channel 1 is set to phase A, /phase B, phase Z (fallingedge), phase S (rising edge)

Related commands
set_extenc_mode• set_extenc_mode(channel, mode_AB, pulse_AZ, mode_Z, mode_S, inverse_cnt)(p. 463)

12.1.2 set_extenc_mode(channel, mode_AB, pulse_AZ, mode_Z, mode_S,
inverse_cnt)
Features
It configures the operation mode of phase A, B, Z and S of the corresponding encoder channel.
1)Compared to versions prior to V2.7.0, Integrated mode_S parameter option - 1: Strobe Signal à Encoder Count
Clear (conveyor tracking available with a single option of Encoder Count Clear), 2: works for Encoder Count
Clear (for compatibility to prior version)

Parameters
Parameter
Name

Data
Type

Default
Value

Description

channelint

1

Encoder channel (1, 2)
1: Channel 1
2: Channel 2

mode_ABint

0

Use of phase AB Mode (0 ~ 4)
0: Not Used
1: Phase A Quadrature use
Phase B Quadrature use
2: Phase A Count
Phase B Direction use
3: Phase A Up Count use
Phase B Not Used
4: Phase A Down Count use
Phase B Not Used

- 463 -

Programming manual(V2.10)

Application Commands

Parameter
Name

Data
Type

Default
Value

Description

pulse_AZ

int

0

Pulse A Count per Pulse Z(0 ~ 100000)

mode_Z

int

0

Phase Z Use Mode (0 ~ 1)
0: Not Used
1: A/B Count Error Compensation
2: Encoder Count Clear

mode_S

int

0

Phase S Use Mode (0 ~ 1)
0: Not Used
1: Encoder Count Clear

inverse_cnt

int

0

Encoder Count Direction Reverse Status
0: Forward
1: Reverse

ReturnValue

Description

N/A

Not Used

Exception
Exception

Description

N/A

Not Used

Example
1
2
3
4
5
6

set_extenc_mode(1, 2, 20000, 1, 1, 0)# External Encoder channel 1 operation mode is set as follows# Phase A Count, Phase B Direction Use# Pulse A Count per Z Pulse is 20000# Phase Z error count accumulate compensation mode use, phase S use# Encoder Count direction is set to forward- 464 -

Programming manual(V2.10)

Application Commands

Related commands
set_extenc_polarity• set_extenc_polarity(channel, polarity_A, polarity_B, polarity_Z, polarity_S)(p. 462)

12.1.3 get_extenc_count(channel)
FeaturesGet the count value of the corresponding encoder channel.

Parameters
Parameter Name

Data TypeDefault
Value

Description

channelint

1

Encoder channel (1, 2)
1: Channel 1
2: Channel 2

ReturnValue

Description

count

Current encoder count value of corresponding channel

Exception
Exception

Description

N/A

Not Used

Example12

enc_cnt = get_extenc_count(1)# External Encoder channel 1 current count value calculation- 465 -

Programming manual(V2.10)

Application Commands

Related commands• set_extenc_polarity(channel, polarity_A, polarity_B, polarity_Z, polarity_S)(p. 462)
• set_extenc_mode(channel, mode_AB, pulse_AZ, mode_Z, mode_S, inverse_cnt)(p. 463)
• clear_extenc_count(channel)(p. 466)

12.1.4 clear_extenc_count(channel)
FeaturesReset counter value of the corresponding encoder channel to 0.

Parameters
Parameter Name

Data TypeDefault
Value

Description

channelint

1

Encoder channel (1, 2)
1: Channel 1
2: Channel 2

ReturnValue

Description

N/A

Not Used

Exception
Exception

Description

N/A

Not Used

Example1
2

clear_extenc_count(1)# External Encoder channel 1 count value reset to 0

- 466 -

Programming manual(V2.10)

Application Commands

Related commands• get_extenc_count(channel)(p. 465)

12.2 Conveyor Tracking
12.2.1 set_conveyor(name)Features
If conveyor information is configured in the UI, obtain ID with the conveyor name to start the Conveyor Tracking
Application from the program and execute the command for workpiece monitoring. Workpiece monitoring is
performed on workpieces triggered in the conveyor, and monitoring continues until the program ends.

Parameters
Parameter Name

Data TypeDefault
Value

Description

namestring-Conveyor nameReturnValue

Description

Conveyor ID

Returns Conveyor ID if conveyor setting is successful

None

Conveyor setting failure

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIME)C Extension module error occurred- 467 -

Programming manual(V2.10)

Application Commands

Exception

Description

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example1

CONV1 = set_conveyor(“conveyor1”)

Related commands• get_conveyor_obj(conv_id, timeout=None, container_type=DR_FIFO, obj_offset_coord=None)(p. 472)
• tracking_conveyor(conv_id, time=0.3)(p. 476)
• untracking_conveyor(conv_id, time=0.3)(p. 478)

12.2.2 set_conveyor_ex(name=””, conv_type=0, encoder_channel=1,
triggering_mute_time=0.0, count_per_dist=5000,
conv_coord=posx(0,0,0,0,0,0), ref=DR_BASE, conv_speed=100.0,
speed_filter_size=500, min_dist=0.0, max_dist=1000.0,
watch_window=100.0...)Features
Configures the conveyor and obtains Conveyor ID to allow the Conveyor Tracking Application to start. After thecommand is executed, it monitors workpieces triggered in the configured conveyor until the program ends. It
can be used when you need to set parameters manually if is unavailable to configure conveyor information
through UI.
1)

Added default value for all arguments compared to versions prior to M2.4.0

2)Added ‘ref’ argument compared to versions prior to M2.4.0 (world coordinates available)

3)

Removed ‘obj_offset_coord’ argument compared to versions prior to M2.4.0, The ‘obj_offset_coord’
argument is changed to input only in get_conveyor_obj() function.

Parameter
Parameter Name

Data TypeDefault Value

Description

namestring“”Conveyor name

conv_type

int

0Conveyor type(0: Linear, 1:
Circular)- 468 -

Programming manual(V2.10)

Application Commands

Parameter Name

Data TypeDefault Value

Description

encoder_channel

int1External encoder channel (1,2)

triggering_mute_time

float

0.0

It is the time (s) triggering(encoder reset, start
workpiece tracking) is not
performed when a triggering
signal is received
immediately after triggering.

count_per_dist

int

5000

Encoder count converted
value per length (Linear:count/m, Circular: count/rad)conv_coordposx

posx(0,0,0,0,0,0)

Fixed conveyor coordinates(based on Base/World
coordinates, mm, ˚)

list (float[6])
ref

int

DR_BASE

Reference coordinates of
conveyor coordinates(DR_BASE: Base,
DR_WORLD: World)

conv_speed

float

100.0

Conveyor nominal velocity(Linear: mm/s, Circular: ˚/s)speed_filter_size

int

500

Moving Average Filter Sizeduring conveyor velocity
filtering

min_dist

float

0.0

Minimum conveyor work
length (based on Triggering
Switch, Linear: mm, Circular:˚)

max_dist

float

1000.0Maximum conveyor work
length (based on Triggering
Switch, Linear: mm, Circular:
˚)- 469 -

Programming manual(V2.10)

Application Commands

Parameter Name

Data TypeDefault Value

Description

watch_window

float

100.0

Conveyor work standby
monitoring length (based onminimum work length,
Linear: mm, Circular: ˚)

out_tracking_dist

float

10.0

Conveyor tracking releasebuffer section length (basedon maximum work length,
Linear: mm, Circular: ˚)

Note• Currently conv_type argument does not support Circular Conveyors!
• All workpieces that pass the Triggering Switch are monitored until they reach max_dist after
set_conveyor() or set_conveyor_ex() function execution and before the program ends.
• However, if triggering_mute_time is configured, and if the Triggering Switch activates during
the corresponding time after the previous workpiece is detected, it is not included on themonitoring list. It is used when noise is present in the Triggering Switch or when the workpieceneeds to be removed for a certain amount of time.
• conv_coord is a coordinate system fixed to the conveyor relative to the base or world
coordinate system. Here, the x-axis of conv_coord represents the direction the conveyor
flows. From the moment the conveyor workpiece activates the triggering switch, the increased
encoder value can be converted to the length of the workpiece travel by using thecount_per_dist argument, and extending this length in the x-axis direction of the conv_coordwill position the workpiece relative to the reference coordinate system.

[Conveyor/Item Coordinate]• conv_speed is the moving speed of the conveyor. It is used to give Info only if the conveyor
speed sensed by the encoder exceeds 200% of this speed. Therefore, if the measurement is notpossible through the TP UI, enter the approximate value.
• Speed_filter_size is the size of the moving-average filter used to estimate the conveyor speed
from the encoder. The larger the size, the more the noise can be canceled, but the tracking
accuracy may deteriorate during acceleration and deceleration.

- 470 -

Programming manual(V2.10)

Application Commands• The area on top of the conveyor is categorized into Watch Window, Tracking Zone and OutTracking Zone.
• Watch Window is the area that determines whether workpieces within the area are available forthe job when obtaining workpiece coordinates for tracking. When the get_conveyor_obj()
function is loaded, if a workpiece is not present within this area, the function is not returned,
and if a workpiece is present within this area, it returns workpiece coordinates according to
get_conveyor_obj() function options (FIFO, LIFO).
• The Tracking Zone is the area that performs Conveyor Tracking.
• The Out-Tracking Zone is the area where the robot automatically ends tracking after it
determines that the robot has exited the work space of the robot or the work space specified by
the user during continuous tracking.
• These three areas are defined with the four lengths (min_dist, max_dist, watch_window,
out_tracking_dist) as shown below.

[Conveyor Area and Length]

ReturnValue

Description

Conveyor ID

Returns Conveyor ID if conveyor setting is successful

None

Conveyor setting failure

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid- 471 -

Programming manual(V2.10)

Application Commands

Exception

Description

DR_Error(DR_ERROR_RUNTIME)C Extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6
7
8

CONV1 = set_conveyor_ex(name=‘conveyor_1’,
conv_type=0, # linear
encoder_channel=1, triggering_mute_time=0.0,
count_per_dist=5000, # 5000 count/mm)
conv_coord=posx(500, 100, 500, 0, -90, 0), ref=DR_BASE,
conv_speed=100.0, # conveyor speed: 100 mm/s,
speed_filter_size=500, # moving avg. filter size: 500 ms
min_dist=100, max_dist=1000, watch_window=200, out_tracking_dist=10)

Related commands• get_conveyor_obj(conv_id, timeout=None, container_type=DR_FIFO, obj_offset_coord=None)(p. 472)
• tracking_conveyor(conv_id, time=0.3)(p. 476)
• untracking_conveyor(conv_id, time=0.3)(p. 478)

12.2.3 get_conveyor_obj(conv_id, timeout=None, container_type=DR_FIFO,
obj_offset_coord=None)
Features
It returns the workpiece coordinate ID available for the job from the corresponding conveyor. When a function iscalled, it returns the workpiece present in the Watch Zone one by one according to the container rule.

Parameters
Parameter Name

Data TypeDefault
Value

Description

conv_idint-

Conveyor ID

timeout

float

None

If there is no workpiece to return during this timeout, it
ends standby and return the function- 472 -

Programming manual(V2.10)

Application Commands

Parameter Name

Data TypeDefault
Value

Description

container_type

int

DR_FIFO

Workpiece container type (DR_FIFO: first-in/first-out,
DR_LIFO: last-in/last-out

obj_offset_coord

posx

None

Workpiece coordinates (mm, ˚) based on conveyor lock
coordinateslist(float[6])Note• When calling this function, it returns the coordinates ID of each workpiece in the Watch Window
according to the container rule. For example, if you call get_conveyor_obj() function when theworkpieces are places as shown below, the workpiece ② and ③ in the Watch Window will becandidates. At this time, if the container_type is set to DR_FIFO the corrdinates ID of ③ thatentered the Watch Window first. If it is set to DR_LIFO, it returns the coordinates ID of ② thatentered the Watch Window later. If there is no workpieces in the Watch Window at the time of
the function call, it waits until the time set in the timeout parameter and return the id if theworkpiece comes in.

[Workpiece Coordinate ID Return Rule Description]• obj_offset_coord is used when you want to apply offset to the workpiece coordinates. It is
usually used for easy input of a teaching point or when you want to dynamically change theposition and orientation of the workpiece coordinates in conjunction with an external sensor(ex. Vision sensor).
In the case shown below, the workpiece coordinates are created on the right side of the workpiece andthe orientation is different from the base or world coord. At this time, if you want to position theworkpiece coordinates at the center of workpiece and make the orientation to be same with the ones ofbase or world coordinates, you can apply it as obj_offset_coord = posx (-d, 0, 0, -90, 0, 0). It is notnecessary to acquire a teaching point through this TP UI, but it could utilize this method if you need touse drl only or enter the teaching point directly.

- 473 -

Programming manual(V2.10)

Application Commands[obj_offset_coord use case 1]
Next, if the workpiece changes its position in a direction that is independent of the conveying direction,or the orientation of the workpiece changes as shown below, the encoder signal alone cannot determine
the position / orientation of the workpiece. In this case, you need to detect them using external vision
sensor. After detecting this value, you can input the position/orientation change detected asobj_offset_coord dynamically and the workpiece coordinates are created accordingly.

[obj_offset_coord use case 2: using vision sensor]- 474 -

Programming manual(V2.10)

Application Commands

ReturnValue

Description

int

CONV_COORD. Conveyor user coordinate ID (121~150)

Negative integer

If no workpiece is present even after the timeout expires

Note
If no workpiece to return is present, no function is returned until the timeout time expires. If the timeout
time expires but no workpiece is present, it returns -1. However, if a timeout time is not entered, it
doesn’t return continuously.

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIME)C Extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6
7
8
9
10
11

## One object in a cycle
CONV1 = set_conveyor(‘conveyor1’)
movel(posx(100, 100, 50, 0, 0, 0), ref=DR_BASE) # waiting position
while True:
CONV_COORD_1 = get_conveyor_obj(CONV1)
tracking_conveyor(CONV1)# synched motion
movel(posx(0,0, 50, 0, 0, 0), ref=CONV_COORD_1)
movel(posx(0,0, 0, 0, 0, 0), ref=CONV_COORD_1)- 475 -

Programming manual(V2.10)

Application Commands

12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45

set_digital_output(DO_GRIPPER, 1)
movel(posx(0,0, 50, 0, 0, 0), ref=CONV_COORD_1)
untracking_conveyor(CONV1)
movel(posx(100, 100, 50, 0, 0, 0), ref=DR_BASE) # waiting position## Multi objects in a cycle
CONV1 = set_conveyor(‘conveyor1’)
while True:
CONV_COORD_1 = get_conveyor_obj(CONV1)
tracking_conveyor(CONV1)# fist object
movel(posx(0,0, 50, 0, 0, 0), ref=CONV_COORD_1)
movel(posx(0,0, 0, 0, 0, 0), ref=CONV_COORD_1)
set_digital_output(DO_GRIPPER, 1)
movel(posx(0,0, 50, 0, 0, 0), ref=CONV_COORD_1)# second object
CONV_COORD_2 = get_conveyor_obj(CONV1, time_out=10)
if CONV_COORD_2 > 0: # -1 if no objects available during time_out
movel(posx(0,0, 50, 0, 0, 0), ref=CONV_COORD_2)
movel(posx(0,0, 0, 0, 0, 0), ref=CONV_COORD_2)
set_digital_output(DO_GRIPPER, 1)
movel(posx(0,0, 50, 0, 0, 0), ref=CONV_COORD_2)# first object if you needmovel(posx(0,0, 50, 0, 0, 0), ref=CONV_COORD_1)
untracking_conveyor(CONV1)
movel(posx(100, 100, 50, 0, 0, 0), ref=DR_BASE)

Related commands• tracking_conveyor(conv_id, time=0.3)(p. 476)
• untracking_conveyor(conv_id, time=0.3)(p. 478)

12.2.4 tracking_conveyor(conv_id, time=0.3)
Features
The robot starts Conveyor Tracking.

- 476 -

Programming manual(V2.10)

Application Commands

Parameters
Parameter Name

Data TypeDefault
Value

Description

conv_idint-

Conveyor ID

time

float

0.3

Acceleration time(sec) to start Tracking

Note
If the tracking_conveyor command is given, the conveyor starts tracking from the current position ofrobot. You can call task motion right after tracking_conveyor function for reducing tack time, althoughtransient error can occur during acceleration time.

[tracking sequence]

ReturnValue

Description

0

Conveyor Tracking success

Negative integer

If the robot is expected to exit the robot work space during acceleration

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error occurred- 477 -

Programming manual(V2.10)

Application Commands

Exception

Description

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIME)C Extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

CONV1 = set_conveyor(‘conveyor1’)
while True:
CONV_COORD_1 = get_conveyor_obj(CONV1)
tracking_conveyor(CONV1) # start moving to track conveyor# task on conveyor
movel(posx(0,0, 50, 0, 0, 0), ref=CONV_COORD_1)
movel(posx(0,0, 0, 0, 0, 0), ref=CONV_COORD_1)
set_digital_output(DO_GRIPPER, 1)
movel(posx(0,0, 50, 0, 0, 0), ref=CONV_COORD_1)
untracking_conveyor(CONV1)
obj_count = obj_count + 1

Related commands• untracking_conveyor(conv_id, time=0.3)(p. 478)

12.2.5 untracking_conveyor(conv_id, time=0.3)
Features
The robot moves as its velocity goes to 0 and finish Conveyor Tracking.

- 478 -

Programming manual(V2.10)

Application Commands

Parameters
Parameter Name

Data TypeDefault
Value

Description

conv_idint-

Conveyor ID

time

float

0.3

Deceleration time (sec) to end Tracking

Note• If a time value is shorter than the robot’s maximum deceleration speed, the robot ignores theentered value and decelerates using the maximum deceleration speed.
• To reduce tack-time, deceleration motion is blended with task motion after
untracking_conveyor if it is called. (However, Joint motion cannot be called during
deceleration time.)

ReturnValue

Description

0

Finishing Conveyor Tracking success

Negative integer

If the robot is expected to exit the robot work space during deceleration

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIME)C Extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully- 479 -

Programming manual(V2.10)

Application Commands

Example
1
2
3
4
5
6
7
8
9
10
11
12
13

CONV1 = set_conveyor(‘conveyor1’)
while True:
CONV_COORD_1 = get_conveyor_obj(CONV1)
tracking_conveyor(CONV1)# task on conveyor
movel(posx(0,0, 50, 0, 0, 0), ref=CONV_COORD_1)
movel(posx(0,0, 0, 0, 0, 0), ref=CONV_COORD_1)
set_digital_output(DO_GRIPPER, 1)
movel(posx(0,0, 50, 0, 0, 0), ref=CONV_COORD_1)
untracking_conveyor(CONV1, 0.1)

Related commands• tracking_conveyor(conv_id, time=0.3)(p. 476)

12.3 Welding
12.3.1 app_weld_enable_digital()
FeaturesThis enables the communication interface welding function. Only supports EtherNet/IP interface.

ReturnValue

Description

0

Enable Welding Success

Negative Value

Enable Welding Failure

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error- 480 -

Programming manual(V2.10)

Application Commands

Exception

Description

DR_Error(DR_ERROR_VALUE)

Invalid parameter value

DR_Error(DR_ERROR_RUNTIME)C Extension module error

DR_Error(DR_ERROR_STOP)

Program terminated forcibly

Example1
2

app_weld_enable_digital()
app_weld_disable_digital()

Related commands• app_weld_set_interface_eip_r2m_process(welding_start=[0,0,0,0,0,0,0,0,0],
robot_ready=[0,0,0,0,0,0,0,0,0], error_reset=[0,0,0,0,0,0,0,0,0])(p. 484)
• app_weld_set_interface_eip_r2m_mode(welding_mode=[0,0,0,0,0,0,0,0,0], s_2t=[0,0,0,0,0,0,0,0,0],
pulse_mode=[0,0,0,0,0,0,0,0,0],wm_opt1=[0,0,0,0,0,0,0,0,0])(p. 488)
• app_weld_set_interface_eip_r2m_test(gas_test=[0,0,0,0,0,0,0,0,0], inching_plus=[0,0,0,0,0,0,0,0,0],inching_minus=[0,0,0,0,0,0,0,0,0], blow_out_torch=[0,0,0,0,0,0,0,0,0], simulation=[0,0,0,0,0,0,0,0,0],ts_opt1=[0,0,0,0,0,0,0,0,0], ...)(p. 492)
• app_weld_set_interface_eip_r2m_condition(job_num=[0,0,0,0,0,0,0,0,0], synergic_id=[0,0,0,0,0,0,0,0,0],
r_wire_feed_speed=[0,0,0,0,0,0,0,0,0], voltage_corret=[0,0,0,0,0,0,0,0.0,0.0],
dynamic_correct=[0,0,0,0,0,0,0,0,0])(p. 495)
• app_weld_set_interface_eip_r2m_option(opt1=[0,0,0,0,0,0,0,0,0], opt2=[0,0,0,0,0,0,0,0,0],
opt3=[0,0,0,0,0,0,0,0,0], opt4=[0,0,0,0,0,0,0,0,0], opt5=[0,0,0,0,0,0,0,0,0], opt6=[0,0,0,0,0,0,0,0,0],...)(p. 498)
• app_weld_set_interface_eip_m2r_process(current_flow=[0,0,0,0,0,0,0,0,0],
process_active=[0,0,0,0,0,0,0,0,0], main_current=[0,0,0,0,0,0,0,0,0], machine_ready=[0,0,0,0,0,0,0,0,0],
comm_ready=[0,0,0,0,0,0,0,0,0])(p. 502)
• app_weld_set_interface_eip_m2r_monitoring(welding_voltage=[0,0,0,0,0,0,0,0,0],
welding_current=[0,0,0,0,0,0,0,0,0], wire_feed_speed=[0,0,0,0,0,0,0,0,0], wire_stick=[0,0,0,0,0,0,0,0,0],
error=[0,0,0,0,0,0,0,0,0], ...)(p. 506)
• app_weld_set_interface_eip_m2r_other(opt1=[0,0,0,0,0,0,0,0,0], opt2=[0,0,0,0,0,0,0,0,0],
opt3=[0,0,0,0,0,0,0,0,0], opt4=[0,0,0,0,0,0,0,0,0], opt5=[0,0,0,0,0,0,0,0,0], opt6=[0,0,0,0,0,0,0,0,0],
opt7=[0,0,0,0,0,0,0,0,0],...)(p. 509)
• app_weld_enable_digital()(p. 480)

- 481 -

Programming manual(V2.10)

Application Commands• app_weld_set_weld_cond_digital(flag_dry_run=0, vel_target=0, vel_min=0, vel_max=0, welding_mode=0,
s_2t=0, pulse_mode=0, wm_opt1=0, simulation=0, ts_opt1=0, ts_opt2=0,...)(p. 513)
• app_weld_adj_welding_cond_digital(flag_reset=None, f_target=None, vel_target=None, wv_offset=None,
wv_width_ratio=None, dynamic_cor=None, voltage_cor=None, job_number=None, synergic_id=None)(p. 518)• app_weld_disable_digital()(p. 482)
• app_weld_weave_cond_trapezoidal(wv_offset=[0,0], wv_ang=0,
wv_param=[0,1.5,0,-1.5,0.3,0.1,0.3,0.3,0.1,0.3])(p. 544)
• app_weld_weave_cond_zigzag(wv_offset=[0,0], wv_ang=0, wv_param=[3,0.6])(p. 547)
• app_weld_weave_cond_circular(wv_offset=[0,0], wv_ang=0, wv_param=[3,3,0.3,0.3])(p. 549)
• app_weld_weave_cond_sinusoidal(wv_offset=[0,0], wv_ang=0, wv_param=[3,0.6])(p. 551)

12.3.2 app_weld_disable_digital()
FeaturesThis disables the communication interface welding function.

ReturnValue

Description0

Success

Negative Value

FailureException
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error

DR_Error(DR_ERROR_VALUE)

Invalid parameter value

DR_Error(DR_ERROR_RUNTIME)C Extension module error

DR_Error(DR_ERROR_STOP)

Program terminated forcibly- 482 -

Programming manual(V2.10)

Application Commands

Example1
2

app_weld_enable_digital()
app_weld_disable_digital()

Related commands• app_weld_set_interface_eip_r2m_process(welding_start=[0,0,0,0,0,0,0,0,0],
robot_ready=[0,0,0,0,0,0,0,0,0], error_reset=[0,0,0,0,0,0,0,0,0])(p. 484)
• app_weld_set_interface_eip_r2m_mode(welding_mode=[0,0,0,0,0,0,0,0,0], s_2t=[0,0,0,0,0,0,0,0,0],
pulse_mode=[0,0,0,0,0,0,0,0,0],wm_opt1=[0,0,0,0,0,0,0,0,0])(p. 488)
• app_weld_set_interface_eip_r2m_test(gas_test=[0,0,0,0,0,0,0,0,0], inching_plus=[0,0,0,0,0,0,0,0,0],inching_minus=[0,0,0,0,0,0,0,0,0], blow_out_torch=[0,0,0,0,0,0,0,0,0], simulation=[0,0,0,0,0,0,0,0,0],ts_opt1=[0,0,0,0,0,0,0,0,0], ...)(p. 492)
• app_weld_set_interface_eip_r2m_condition(job_num=[0,0,0,0,0,0,0,0,0], synergic_id=[0,0,0,0,0,0,0,0,0],
r_wire_feed_speed=[0,0,0,0,0,0,0,0,0], voltage_corret=[0,0,0,0,0,0,0,0.0,0.0],
dynamic_correct=[0,0,0,0,0,0,0,0,0])(p. 495)
• app_weld_set_interface_eip_r2m_option(opt1=[0,0,0,0,0,0,0,0,0], opt2=[0,0,0,0,0,0,0,0,0],
opt3=[0,0,0,0,0,0,0,0,0], opt4=[0,0,0,0,0,0,0,0,0], opt5=[0,0,0,0,0,0,0,0,0], opt6=[0,0,0,0,0,0,0,0,0],...)(p. 498)
• app_weld_set_interface_eip_m2r_process(current_flow=[0,0,0,0,0,0,0,0,0],
process_active=[0,0,0,0,0,0,0,0,0], main_current=[0,0,0,0,0,0,0,0,0], machine_ready=[0,0,0,0,0,0,0,0,0],
comm_ready=[0,0,0,0,0,0,0,0,0])(p. 502)
• app_weld_set_interface_eip_m2r_monitoring(welding_voltage=[0,0,0,0,0,0,0,0,0],
welding_current=[0,0,0,0,0,0,0,0,0], wire_feed_speed=[0,0,0,0,0,0,0,0,0], wire_stick=[0,0,0,0,0,0,0,0,0],
error=[0,0,0,0,0,0,0,0,0], ...)(p. 506)
• app_weld_set_interface_eip_m2r_other(opt1=[0,0,0,0,0,0,0,0,0], opt2=[0,0,0,0,0,0,0,0,0],
opt3=[0,0,0,0,0,0,0,0,0], opt4=[0,0,0,0,0,0,0,0,0], opt5=[0,0,0,0,0,0,0,0,0], opt6=[0,0,0,0,0,0,0,0,0],
opt7=[0,0,0,0,0,0,0,0,0],...)(p. 509)
• app_weld_enable_digital()(p. 480)
• app_weld_set_weld_cond_digital(flag_dry_run=0, vel_target=0, vel_min=0, vel_max=0, welding_mode=0,
s_2t=0, pulse_mode=0, wm_opt1=0, simulation=0, ts_opt1=0, ts_opt2=0,...)(p. 513)
• app_weld_adj_welding_cond_digital(flag_reset=None, f_target=None, vel_target=None, wv_offset=None,
wv_width_ratio=None, dynamic_cor=None, voltage_cor=None, job_number=None, synergic_id=None)(p. 518)• app_weld_disable_digital()(p. 482)
• app_weld_weave_cond_trapezoidal(wv_offset=[0,0], wv_ang=0,
wv_param=[0,1.5,0,-1.5,0.3,0.1,0.3,0.3,0.1,0.3])(p. 544)
• app_weld_weave_cond_zigzag(wv_offset=[0,0], wv_ang=0, wv_param=[3,0.6])(p. 547)
• app_weld_weave_cond_circular(wv_offset=[0,0], wv_ang=0, wv_param=[3,3,0.3,0.3])(p. 549)
• app_weld_weave_cond_sinusoidal(wv_offset=[0,0], wv_ang=0, wv_param=[3,0.6])(p. 551)

- 483 -

Programming manual(V2.10)

Application Commands

12.3.3 app_weld_set_interface_eip_r2m_process(welding_start=[0,0,0,0,0,
0,0,0,0], robot_ready=[0,0,0,0,0,0,0,0,0],
error_reset=[0,0,0,0,0,0,0,0,0])
FeaturesThis sets the communication interface setting to use welders that support EtherNet/IP communication. This
sets the link signal interface between the robot controller and welder used for welding in the communication
data sent to the welder from the robot controller. Enter the setting values below along with details based on thecommunication signal data sheet of the corresponding welder.

Note
To ensure proper welding using an EtherNet/IP remote control welder, all of 8 interface commands must
be set up.
app_weld_set_interface_eip_r2m_process(), app_weld_set_interface_eip_r2m_mode(),app_weld_set_interface_eip_r2m_test(), app_weld_set_interface_eip_r2m_condition(),app_weld_set_interface_eip_r2m_option(), app_weld_set_interface_eip_m2r_process(),
app_weld_set_interface_eip_m2r_monitoring(), app_weld_set_interface_eip_m2r_other()Parameter
Parameter
Name

Data TypeDefault
Value

Description

welding_start

Refer to thetable below

Refer to thetable below

Start Weld Command (specification for each welder)robot_ready

Robot Status (specification for each welder)

error_reset

Reset Welder Error (specification for each welder)

The data type, default value and description are identical to the below
Parameter
Name

Data TypeDefault
Value

Description

list(int[7])0Not Used: 0
Used: 10

Data Type (on/off: 0, Select: 1, Value: 2)0Data Digits (1: 0, 0.1: 1, 0.01: 2)- 484 -

Programming manual(V2.10)

Application Commands

Parameter
Name

Data TypeDefault
Value

Description

0

Communication Data Point (byte): 1~255

0Communication Data Point (bit): 1~255

0

Data Size
1-bit(disable Low): 0
1-bit(disable High): 1
2-bit: 2
4-bit: 3
8-bit(byte): 4
15-bit: 5
16-bit(short): 6
32-bit(int): 70

Valid Data Size
Value (bit)list(float[2])0Minimum Data Value0

Maximum Data Value

Note
Communication Interface Setting Example (EWM Welder)
1. Data Type (on/off: 0): Item selected On/Offa. Ewm Welder Data Sheet
Byte no.

Bit no.

Function/description

Bit assignment

04Start signal welding
process

0 switched off
1 switched onb. Specification Entry Method
Item

Setting Value

Usage Status

1 (Used)Data Type0 (on/off)

Data Digits

0 (1)- 485 -

Programming manual(V2.10)

Application Commands

Item

Setting Value

Communication Data Point (byte)

0Communication Data Point (bit)4

Data Size

0 (1-bit, disable Low)

Valid Data Size

1 (1 bit)

Minimum Data Value0

Maximum Data Value

1

2. Data Type (Select: 1): If data with an integer of 1 is selected
1. Ewm Welder Data Sheet
Byte no.

Bit no.

Function/description

Bit assignment

30-7

Selection JOB

Range 1-255

b. Specification Entry Method
Item

Setting Value

Usage Status

1 (Used)Data Type

1 (Select)

Data Digits

0 (1)Communication Data Point (byte)

3

Communication Data Point (bit)0

Data Size

4 (8-bit)

Valid Data Size

8 (8 bit)

Minimum Data Value0

Maximum Data Value255

3. Data Type (Value: 2): If a real number value is entered
1. Ewm Welder Data Sheet
Byte no.

Bit no.

Function/description

Bit assignment

6

0-15

Welding voltage(current
actual value)

0 to 0x7FFF (High-Byte
first)equivalent to 0.0V to
100.0V- 486 -

Programming manual(V2.10)

Application Commandsb. Specification Entry Method
Item

Setting Value

Usage Status

1 (Used)Data Type

2 (Value)

Data Digits

1 (0.1)

Communication Data Point (byte)

6

Communication Data Point (bit)0

Data Size

6 (16-bit)

Valid Data Size

15 (15 bit)

Minimum Data Value

0.0 (V)

Maximum Data Value

100.0 (V)• If the data type is 2 (Value), a valid data size (0x7FFF → 15 bit), minimum data value (0.0V) andmaximum data value (100.0V) must be entered.

ReturnValue

Description0

Success

Negative Value

FailureException
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error

DR_Error(DR_ERROR_VALUE)

Invalid parameter value

DR_Error(DR_ERROR_RUNTIME)C Extension module error- 487 -

Programming manual(V2.10)

Application Commands

Exception

Description

DR_Error(DR_ERROR_STOP)

Program terminated forcibly

Example1

app_weld_set_interface_eip_r2m_process(welding_start=[1,0,0,0,4,0,1,0,0],
robot_ready=[1,0,0,0,5,0,1,0,0], error_reset=[1,0,0,1,4,0,1,0,0])

Related commands• app_weld_set_interface_eip_r2m_process(welding_start=[0,0,0,0,0,0,0,0,0],
robot_ready=[0,0,0,0,0,0,0,0,0], error_reset=[0,0,0,0,0,0,0,0,0])(p. 484)
• app_weld_set_interface_eip_r2m_mode(welding_mode=[0,0,0,0,0,0,0,0,0], s_2t=[0,0,0,0,0,0,0,0,0],
pulse_mode=[0,0,0,0,0,0,0,0,0],wm_opt1=[0,0,0,0,0,0,0,0,0])(p. 488)
• app_weld_set_interface_eip_r2m_test(gas_test=[0,0,0,0,0,0,0,0,0], inching_plus=[0,0,0,0,0,0,0,0,0],inching_minus=[0,0,0,0,0,0,0,0,0], blow_out_torch=[0,0,0,0,0,0,0,0,0], simulation=[0,0,0,0,0,0,0,0,0],ts_opt1=[0,0,0,0,0,0,0,0,0], ...)(p. 492)
• app_weld_set_interface_eip_r2m_condition(job_num=[0,0,0,0,0,0,0,0,0], synergic_id=[0,0,0,0,0,0,0,0,0],
r_wire_feed_speed=[0,0,0,0,0,0,0,0,0], voltage_corret=[0,0,0,0,0,0,0,0.0,0.0],
dynamic_correct=[0,0,0,0,0,0,0,0,0])(p. 495)
• app_weld_set_interface_eip_r2m_option(opt1=[0,0,0,0,0,0,0,0,0], opt2=[0,0,0,0,0,0,0,0,0],
opt3=[0,0,0,0,0,0,0,0,0], opt4=[0,0,0,0,0,0,0,0,0], opt5=[0,0,0,0,0,0,0,0,0], opt6=[0,0,0,0,0,0,0,0,0],...)(p. 498)
• app_weld_set_interface_eip_m2r_process(current_flow=[0,0,0,0,0,0,0,0,0],
process_active=[0,0,0,0,0,0,0,0,0], main_current=[0,0,0,0,0,0,0,0,0], machine_ready=[0,0,0,0,0,0,0,0,0],
comm_ready=[0,0,0,0,0,0,0,0,0])(p. 502)
• app_weld_set_interface_eip_m2r_monitoring(welding_voltage=[0,0,0,0,0,0,0,0,0],
welding_current=[0,0,0,0,0,0,0,0,0], wire_feed_speed=[0,0,0,0,0,0,0,0,0], wire_stick=[0,0,0,0,0,0,0,0,0],
error=[0,0,0,0,0,0,0,0,0], ...)(p. 506)
• app_weld_set_interface_eip_m2r_other(opt1=[0,0,0,0,0,0,0,0,0], opt2=[0,0,0,0,0,0,0,0,0],
opt3=[0,0,0,0,0,0,0,0,0], opt4=[0,0,0,0,0,0,0,0,0], opt5=[0,0,0,0,0,0,0,0,0], opt6=[0,0,0,0,0,0,0,0,0],
opt7=[0,0,0,0,0,0,0,0,0],...)(p. 509)

12.3.4 app_weld_set_interface_eip_r2m_mode(welding_mode=[0,0,0,0,0,0,
0,0,0], s_2t=[0,0,0,0,0,0,0,0,0],
pulse_mode=[0,0,0,0,0,0,0,0,0],wm_opt1=[0,0,0,0,0,0,0,0,0])
FeaturesThis sets the communication interface setting to use welders that support EtherNet/IP communication. This
sets the interface related to the welding mode in the communication data sent to the welder from the robot- 488 -

Programming manual(V2.10)

Application Commands

controller. Required modes can be additionally added with the option item (wm_opt1). Enter the setting values
below along with details based on the communication signal data sheet of the corresponding welder.
Note
To ensure proper welding using an EtherNet/IP remote control welder, all of 8 interface commands must
be set up.
app_weld_set_interface_eip_r2m_process(), app_weld_set_interface_eip_r2m_mode(),app_weld_set_interface_eip_r2m_test(), app_weld_set_interface_eip_r2m_condition(),app_weld_set_interface_eip_r2m_option(), app_weld_set_interface_eip_m2r_process(),
app_weld_set_interface_eip_m2r_monitoring(), app_weld_set_interface_eip_m2r_other()Parameter
Parameter Name

Data TypeDefault
Value

Description

welding_mode

Refer to thetable below

Refer to thetable below

Welding Mode (specification for each welder)s_2tLatched/Non-latched Mode (specification for each welder)pulse_mode

Pulse Mode (specification for each welder)

wm_opt1

Option Mode (specification for each welder)

The data type, default value and description are identical to the below
Parameter Name

Data TypeDefault
Value

Description

list(int[7])0Not Used: 0
Used: 10

Data Type (on/off: 0, Select: 1, Value: 2)0Data Digits (1: 0, 0.1: 1, 0.01: 2)

0Communication Data Point (byte): 1~255

0Communication Data Point (bit): 1~255- 489 -

Programming manual(V2.10)

Application Commands

Parameter Name

Data TypeDefault
Value

Description0

Data Size
1-bit(disable Low): 0
1-bit(disable High): 1
2-bit: 2
4-bit: 3
8-bit(byte): 4
15-bit: 5
16-bit(short): 6
32-bit(int): 70

Valid Data Size
Value (bit)list(float[2])0Minimum Data Value0

Maximum Data ValueNote
For examples of data (0~2) interface settings, refer to the app_weld_set_interface_eip_r2m_process()
section.

ReturnValue

Description0

Success

Negative Value

FailureException
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error- 490 -

Programming manual(V2.10)

Application Commands

Exception

Description

DR_Error(DR_ERROR_VALUE)

Invalid parameter value

DR_Error(DR_ERROR_RUNTIME)C Extension module error

DR_Error(DR_ERROR_STOP)

Program terminated forcibly

Example1

app_weld_set_interface_eip_r2m_mode(welding_mode=[1,1,0,0,0,2,2,0,3],s_2t=[0,0,0,0,0,0,0,0,0], pulse_mode=[1,1,0,0,2,0,1,0,1],wm_opt1=[0,0,0,0,0,0)

Related commands• app_weld_set_interface_eip_r2m_process(welding_start=[0,0,0,0,0,0,0,0,0],
robot_ready=[0,0,0,0,0,0,0,0,0], error_reset=[0,0,0,0,0,0,0,0,0])(p. 484)
• app_weld_set_interface_eip_r2m_mode(welding_mode=[0,0,0,0,0,0,0,0,0], s_2t=[0,0,0,0,0,0,0,0,0],
pulse_mode=[0,0,0,0,0,0,0,0,0],wm_opt1=[0,0,0,0,0,0,0,0,0])(p. 488)
• app_weld_set_interface_eip_r2m_test(gas_test=[0,0,0,0,0,0,0,0,0], inching_plus=[0,0,0,0,0,0,0,0,0],inching_minus=[0,0,0,0,0,0,0,0,0], blow_out_torch=[0,0,0,0,0,0,0,0,0], simulation=[0,0,0,0,0,0,0,0,0],ts_opt1=[0,0,0,0,0,0,0,0,0], ...)(p. 492)
• app_weld_set_interface_eip_r2m_condition(job_num=[0,0,0,0,0,0,0,0,0], synergic_id=[0,0,0,0,0,0,0,0,0],
r_wire_feed_speed=[0,0,0,0,0,0,0,0,0], voltage_corret=[0,0,0,0,0,0,0,0.0,0.0],
dynamic_correct=[0,0,0,0,0,0,0,0,0])(p. 495)
• app_weld_set_interface_eip_r2m_option(opt1=[0,0,0,0,0,0,0,0,0], opt2=[0,0,0,0,0,0,0,0,0],
opt3=[0,0,0,0,0,0,0,0,0], opt4=[0,0,0,0,0,0,0,0,0], opt5=[0,0,0,0,0,0,0,0,0], opt6=[0,0,0,0,0,0,0,0,0],...)(p. 498)
• app_weld_set_interface_eip_m2r_process(current_flow=[0,0,0,0,0,0,0,0,0],
process_active=[0,0,0,0,0,0,0,0,0], main_current=[0,0,0,0,0,0,0,0,0], machine_ready=[0,0,0,0,0,0,0,0,0],
comm_ready=[0,0,0,0,0,0,0,0,0])(p. 502)
• app_weld_set_interface_eip_m2r_monitoring(welding_voltage=[0,0,0,0,0,0,0,0,0],
welding_current=[0,0,0,0,0,0,0,0,0], wire_feed_speed=[0,0,0,0,0,0,0,0,0], wire_stick=[0,0,0,0,0,0,0,0,0],
error=[0,0,0,0,0,0,0,0,0], ...)(p. 506)
• app_weld_set_interface_eip_m2r_other(opt1=[0,0,0,0,0,0,0,0,0], opt2=[0,0,0,0,0,0,0,0,0],
opt3=[0,0,0,0,0,0,0,0,0], opt4=[0,0,0,0,0,0,0,0,0], opt5=[0,0,0,0,0,0,0,0,0], opt6=[0,0,0,0,0,0,0,0,0],
opt7=[0,0,0,0,0,0,0,0,0],...)(p. 509)

- 491 -

Programming manual(V2.10)

Application Commands

12.3.5 app_weld_set_interface_eip_r2m_test(gas_test=[0,0,0,0,0,0,0,0,0],inching_plus=[0,0,0,0,0,0,0,0,0], inching_minus=[0,0,0,0,0,0,0,0,0],
blow_out_torch=[0,0,0,0,0,0,0,0,0], simulation=[0,0,0,0,0,0,0,0,0],ts_opt1=[0,0,0,0,0,0,0,0,0], ...)
FeaturesThis sets the communication interface setting to use welders that support EtherNet/IP communication. This
sets the interface related to the test signal setting in the communication data sent to the welder from the robot
controller. Additional functions related to the test signal can be added with the option item (ts_opt1, ts_opt2).
Enter the setting values below along with details based on the communication signal data sheet of thecorresponding welder.

Note
To ensure proper welding using an EtherNet/IP remote control welder, all of 8 interface commands must
be set up.
app_weld_set_interface_eip_r2m_process(), app_weld_set_interface_eip_r2m_mode(),app_weld_set_interface_eip_r2m_test(), app_weld_set_interface_eip_r2m_condition(),app_weld_set_interface_eip_r2m_option(), app_weld_set_interface_eip_m2r_process(),
app_weld_set_interface_eip_m2r_monitoring(), app_weld_set_interface_eip_m2r_other()Parameter
Parameter
Name

Data TypeDefault Value

Description

gas_test

Refer to thetable below

Refer to thetable below

Gas Test Signal (specification for each welder)

Inching_plus

Forward Inching Signal (specification for each welder)

Inching_minus

Reverse Inching Signal (specification for each welder)

blow_out_torchTorch Cleaning Signal (specification for each welder)simulation

Mock Welding Signal (specification for each welder)

ts_opt1

Option Signal (specification for each welder)

ts_opt2

Option Signal (specification for each welder)- 492 -

Programming manual(V2.10)

Application Commands

The data type, default value and description are identical to the below
Parameter
Name

Data TypeDefault Value

Description

list(int[7])0Not Used: 0
Used: 10

Data Type (on/off: 0, Select: 1, Value: 2)0Data Digits (1: 0, 0.1: 1, 0.01: 2)

0Communication Data Point (byte): 1~255

0Communication Data Point (bit): 1~255

0

Data Size
1-bit(disable Low): 0
1-bit(disable High): 1
2-bit: 2
4-bit: 3
8-bit(byte): 4
15-bit: 5
16-bit(short): 6
32-bit(int): 70

Valid Data Size
Value (bit)list(float[2])0Minimum Data Value0

Maximum Data ValueNote
For examples of data (0~2) interface settings, refer to the app_weld_set_interface_eip_r2m_process()
section.

- 493 -

Programming manual(V2.10)

Application Commands

ReturnValue

Description0

Success

Negative Value

FailureException
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error

DR_Error(DR_ERROR_VALUE)

Invalid parameter value

DR_Error(DR_ERROR_RUNTIME)C Extension module error

DR_Error(DR_ERROR_STOP)

Program terminated forcibly

Example1

app_weld_set_interface_eip_r2m_test(gas_test=[1,0,0,0,6,0,1,0,0],inching_plus=[1,0,0,1,0,0,1,0,0], inching_minus=[1,0,0,1,2,0,1,0,0],
blow_out_torch=[1,0,0,0,7,0,1,0,0], simulation=[0,0,0,1,7,0,1,0,0],ts_opt1=[0,0,0,0,0,0,0,0,0], ts_opt2=[0,0,0,0,0,0,0,0,0])

Related commands• app_weld_set_interface_eip_r2m_process(welding_start=[0,0,0,0,0,0,0,0,0],
robot_ready=[0,0,0,0,0,0,0,0,0], error_reset=[0,0,0,0,0,0,0,0,0])(p. 484)
• app_weld_set_interface_eip_r2m_mode(welding_mode=[0,0,0,0,0,0,0,0,0], s_2t=[0,0,0,0,0,0,0,0,0],
pulse_mode=[0,0,0,0,0,0,0,0,0],wm_opt1=[0,0,0,0,0,0,0,0,0])(p. 488)
• app_weld_set_interface_eip_r2m_test(gas_test=[0,0,0,0,0,0,0,0,0], inching_plus=[0,0,0,0,0,0,0,0,0],inching_minus=[0,0,0,0,0,0,0,0,0], blow_out_torch=[0,0,0,0,0,0,0,0,0], simulation=[0,0,0,0,0,0,0,0,0],ts_opt1=[0,0,0,0,0,0,0,0,0], ...)(p. 492)

- 494 -

Programming manual(V2.10)

Application Commands• app_weld_set_interface_eip_r2m_condition(job_num=[0,0,0,0,0,0,0,0,0], synergic_id=[0,0,0,0,0,0,0,0,0],
r_wire_feed_speed=[0,0,0,0,0,0,0,0,0], voltage_corret=[0,0,0,0,0,0,0,0.0,0.0],
dynamic_correct=[0,0,0,0,0,0,0,0,0])(p. 495)
• app_weld_set_interface_eip_r2m_option(opt1=[0,0,0,0,0,0,0,0,0], opt2=[0,0,0,0,0,0,0,0,0],
opt3=[0,0,0,0,0,0,0,0,0], opt4=[0,0,0,0,0,0,0,0,0], opt5=[0,0,0,0,0,0,0,0,0], opt6=[0,0,0,0,0,0,0,0,0],...)(p. 498)
• app_weld_set_interface_eip_m2r_process(current_flow=[0,0,0,0,0,0,0,0,0],
process_active=[0,0,0,0,0,0,0,0,0], main_current=[0,0,0,0,0,0,0,0,0], machine_ready=[0,0,0,0,0,0,0,0,0],
comm_ready=[0,0,0,0,0,0,0,0,0])(p. 502)
• app_weld_set_interface_eip_m2r_monitoring(welding_voltage=[0,0,0,0,0,0,0,0,0],
welding_current=[0,0,0,0,0,0,0,0,0], wire_feed_speed=[0,0,0,0,0,0,0,0,0], wire_stick=[0,0,0,0,0,0,0,0,0],
error=[0,0,0,0,0,0,0,0,0], ...)(p. 506)
• app_weld_set_interface_eip_m2r_other(opt1=[0,0,0,0,0,0,0,0,0], opt2=[0,0,0,0,0,0,0,0,0],
opt3=[0,0,0,0,0,0,0,0,0], opt4=[0,0,0,0,0,0,0,0,0], opt5=[0,0,0,0,0,0,0,0,0], opt6=[0,0,0,0,0,0,0,0,0],
opt7=[0,0,0,0,0,0,0,0,0],...)(p. 509)

12.3.6 app_weld_set_interface_eip_r2m_condition(job_num=[0,0,0,0,0,0,0,0,0], synergic_id=[0,0,0,0,0,0,0,0,0],
r_wire_feed_speed=[0,0,0,0,0,0,0,0,0],
voltage_corret=[0,0,0,0,0,0,0,0.0,0.0],
dynamic_correct=[0,0,0,0,0,0,0,0,0])
FeaturesThis sets the communication interface setting to use welders that support EtherNet/IP communication. This
sets the interface related to the welding condition setting in the communication data sent to the welder fromthe robot controller. Enter the setting values below along with details based on the communication signal data
sheet of the corresponding welder.

Note
To ensure proper welding using an EtherNet/IP remote control welder, all of 8 interface commands must
be set up.
app_weld_set_interface_eip_r2m_process(), app_weld_set_interface_eip_r2m_mode(),app_weld_set_interface_eip_r2m_test(), app_weld_set_interface_eip_r2m_condition(),app_weld_set_interface_eip_r2m_option(), app_weld_set_interface_eip_m2r_process(),
app_weld_set_interface_eip_m2r_monitoring(), app_weld_set_interface_eip_m2r_other()- 495 -

Programming manual(V2.10)

Application Commands

Parameter
Parameter Name

Data TypeDefault
Value

Description

job_num

Refer to thetable below

Refer to thetable below

JOB Number (specification for each welder)synergic_id

SYNERGIC Number (specification for each welder)

r_wire_feed_spe
edWire Feeding Speed Correction (specification for eachwelder)voltage_correct

Voltage Correction (specification for each welder)dynamic_correct

Dynamic Correction (specification for each welder)

The data type, default value and description are identical to the below
Parameter Name

Data TypeDefault
Value

Description

list(int[7])0Not Used: 0
Used: 10

Data Type (on/off: 0, Select: 1, Value: 2)0Data Digits (1: 0, 0.1: 1, 0.01: 2)

0Communication Data Point (byte): 1~255

0Communication Data Point (bit): 1~255

0

Data Size
1-bit(disable Low): 0
1-bit(disable High): 1
2-bit: 2
4-bit: 3
8-bit(byte): 4
15-bit: 5
16-bit(short): 6
32-bit(int): 7- 496 -

Programming manual(V2.10)

Application Commands

Parameter Name

Data TypeDefault
Value

Description

0

Valid Data Size
Value (bit)list(float[2])0Minimum Data Value0

Maximum Data ValueNote
For examples of data (0~2) interface settings, refer to the app_weld_set_interface_eip_r2m_process()
section.

ReturnValue

Description0

Success

Negative Value

FailureException
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error

DR_Error(DR_ERROR_VALUE)

Invalid parameter value

DR_Error(DR_ERROR_RUNTIME)C Extension module error

DR_Error(DR_ERROR_STOP)

Program terminated forcibly- 497 -

Programming manual(V2.10)

Application Commands

Example1

app_weld_set_interface_eip_r2m_condition(job_num=[1,1,0,3,0,4,8,0,255],
synergic_id=[1,1,0,2,0,3,4,0,15], r_wire_feed_speed=[1,2,1,6,0,6,15,0.0,25.0], voltage_corret=[1,2,1,8,0,6,15,-10.0,10.0], dynamic_correct=[1,2,0,10,0,
5,-40,40])

Related commands• app_weld_set_interface_eip_r2m_process(welding_start=[0,0,0,0,0,0,0,0,0],
robot_ready=[0,0,0,0,0,0,0,0,0], error_reset=[0,0,0,0,0,0,0,0,0])(p. 484)
• app_weld_set_interface_eip_r2m_mode(welding_mode=[0,0,0,0,0,0,0,0,0], s_2t=[0,0,0,0,0,0,0,0,0],
pulse_mode=[0,0,0,0,0,0,0,0,0],wm_opt1=[0,0,0,0,0,0,0,0,0])(p. 488)
• app_weld_set_interface_eip_r2m_test(gas_test=[0,0,0,0,0,0,0,0,0], inching_plus=[0,0,0,0,0,0,0,0,0],inching_minus=[0,0,0,0,0,0,0,0,0], blow_out_torch=[0,0,0,0,0,0,0,0,0], simulation=[0,0,0,0,0,0,0,0,0],ts_opt1=[0,0,0,0,0,0,0,0,0], ...)(p. 492)
• app_weld_set_interface_eip_r2m_condition(job_num=[0,0,0,0,0,0,0,0,0], synergic_id=[0,0,0,0,0,0,0,0,0],
r_wire_feed_speed=[0,0,0,0,0,0,0,0,0], voltage_corret=[0,0,0,0,0,0,0,0.0,0.0],
dynamic_correct=[0,0,0,0,0,0,0,0,0])(p. 495)
• app_weld_set_interface_eip_r2m_option(opt1=[0,0,0,0,0,0,0,0,0], opt2=[0,0,0,0,0,0,0,0,0],
opt3=[0,0,0,0,0,0,0,0,0], opt4=[0,0,0,0,0,0,0,0,0], opt5=[0,0,0,0,0,0,0,0,0], opt6=[0,0,0,0,0,0,0,0,0],...)(p. 498)
• app_weld_set_interface_eip_m2r_process(current_flow=[0,0,0,0,0,0,0,0,0],
process_active=[0,0,0,0,0,0,0,0,0], main_current=[0,0,0,0,0,0,0,0,0], machine_ready=[0,0,0,0,0,0,0,0,0],
comm_ready=[0,0,0,0,0,0,0,0,0])(p. 502)
• app_weld_set_interface_eip_m2r_monitoring(welding_voltage=[0,0,0,0,0,0,0,0,0],
welding_current=[0,0,0,0,0,0,0,0,0], wire_feed_speed=[0,0,0,0,0,0,0,0,0], wire_stick=[0,0,0,0,0,0,0,0,0],
error=[0,0,0,0,0,0,0,0,0], ...)(p. 506)
• app_weld_set_interface_eip_m2r_other(opt1=[0,0,0,0,0,0,0,0,0], opt2=[0,0,0,0,0,0,0,0,0],
opt3=[0,0,0,0,0,0,0,0,0], opt4=[0,0,0,0,0,0,0,0,0], opt5=[0,0,0,0,0,0,0,0,0], opt6=[0,0,0,0,0,0,0,0,0],
opt7=[0,0,0,0,0,0,0,0,0],...)(p. 509)

12.3.7 app_weld_set_interface_eip_r2m_option(opt1=[0,0,0,0,0,0,0,0,0],
opt2=[0,0,0,0,0,0,0,0,0], opt3=[0,0,0,0,0,0,0,0,0],
opt4=[0,0,0,0,0,0,0,0,0], opt5=[0,0,0,0,0,0,0,0,0],
opt6=[0,0,0,0,0,0,0,0,0],...)
FeaturesThis sets the communication interface setting to use welders that support EtherNet/IP communication.
Required functions other than basic setting items (app_weld_set_interface_eip_r2m_process(),
app_weld_set_interface_eip_r2m_mode(), app_weld_set_interface_eip_r2m_test(),app_weld_set_interface_eip_r2m_condition()) in the communication data sent to the welder from the robot- 498 -

Programming manual(V2.10)

Application Commands

controller can be set with the corresponding command. Enter the setting values below along with details basedon the communication signal data sheet of the corresponding welder.
Note
To ensure proper welding using an EtherNet/IP remote control welder, all of 8 interface commands must
be set up.
app_weld_set_interface_eip_r2m_process(), app_weld_set_interface_eip_r2m_mode(),app_weld_set_interface_eip_r2m_test(), app_weld_set_interface_eip_r2m_condition(),app_weld_set_interface_eip_r2m_option(), app_weld_set_interface_eip_m2r_process(),
app_weld_set_interface_eip_m2r_monitoring(), app_weld_set_interface_eip_m2r_other()Parameter
Parameter
Name

Data TypeDefault Value

Description

opt1

Refer to thetable below

Refer to thetable below

Option Item (specification for each welder)

opt2
opt3
opt4
opt5
opt6
opt7
opt8
opt9
opt10
opt11
opt12
opt13

- 499 -

Programming manual(V2.10)

Application Commands

Parameter
Name

Data TypeDefault Value

Description

opt14
opt15
The data type, default value and description are identical to the below
Parameter
Name

Data TypeDefault Value

Description

list(int[7])0Not Used: 0
Used: 10

Data Type (on/off: 0, Select: 1, Value: 2)0Data Digits (1: 0, 0.1: 1, 0.01: 2)

0Communication Data Point (byte): 1~255

0Communication Data Point (bit): 1~255

0

Data Size
1-bit(disable Low): 0
1-bit(disable High): 1
2-bit: 2
4-bit: 3
8-bit(byte): 4
15-bit: 5
16-bit(short): 6
32-bit(int): 70

Valid Data Size
Value (bit)list(float[2])0Minimum Data Value0

Maximum Data Value- 500 -

Programming manual(V2.10)

Application Commands

Note
For examples of data (0~2) interface settings, refer to the app_weld_set_interface_eip_r2m_process()
section.

ReturnValue

Description0

Success

Negative Value

FailureException
Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data error

DR_Error (DR_ERROR_VALUE)

Invalid parameter value

DR_Error (DR_ERROR_RUNTIME)C Extension module error

DR_Error (DR_ERROR_STOP)

Program terminated forcibly

Example1

app_weld_set_interface_eip_r2m_option(opt1=[0,0,0,0,0,0,0,0,0], opt2=[0,0,0,0, opt3=[0,0,0,0,0,0,0,0,0], opt4=[0,0,0,0,0,0,0,0,0], opt5=[0,0,0,0,0,0,0,0,0, opt6=[0,0,0,0,0,0,0,0,0], opt7=[0,0,0,0,0,0,0,0,0], opt8=[0,0,0,0,0,0,0,0,0, opt9=[0,0,0,0,0,0,0,0,0], opt10=[0,0,0,0,0,0,0,0,0], opt11=[0,0,0,0,0,0,0,0, opt12=[0,0,0,0,0,0,0,0,0], opt13=[0,0,0,0,0,0,0,0,0], opt14=[0,0,0,0,0,0,0,, opt15=[0,0,0,0,0,0,0,0,0])

Related commands• app_weld_set_interface_eip_r2m_process(welding_start=[0,0,0,0,0,0,0,0,0],
robot_ready=[0,0,0,0,0,0,0,0,0], error_reset=[0,0,0,0,0,0,0,0,0])(p. 484)
• app_weld_set_interface_eip_r2m_mode(welding_mode=[0,0,0,0,0,0,0,0,0], s_2t=[0,0,0,0,0,0,0,0,0],
pulse_mode=[0,0,0,0,0,0,0,0,0],wm_opt1=[0,0,0,0,0,0,0,0,0])(p. 488)

- 501 -

Programming manual(V2.10)

Application Commands• app_weld_set_interface_eip_r2m_test(gas_test=[0,0,0,0,0,0,0,0,0], inching_plus=[0,0,0,0,0,0,0,0,0],inching_minus=[0,0,0,0,0,0,0,0,0], blow_out_torch=[0,0,0,0,0,0,0,0,0], simulation=[0,0,0,0,0,0,0,0,0],ts_opt1=[0,0,0,0,0,0,0,0,0], ...)(p. 492)
• app_weld_set_interface_eip_r2m_condition(job_num=[0,0,0,0,0,0,0,0,0], synergic_id=[0,0,0,0,0,0,0,0,0],
r_wire_feed_speed=[0,0,0,0,0,0,0,0,0], voltage_corret=[0,0,0,0,0,0,0,0.0,0.0],
dynamic_correct=[0,0,0,0,0,0,0,0,0])(p. 495)
• app_weld_set_interface_eip_r2m_option(opt1=[0,0,0,0,0,0,0,0,0], opt2=[0,0,0,0,0,0,0,0,0],
opt3=[0,0,0,0,0,0,0,0,0], opt4=[0,0,0,0,0,0,0,0,0], opt5=[0,0,0,0,0,0,0,0,0], opt6=[0,0,0,0,0,0,0,0,0],...)(p. 498)
• app_weld_set_interface_eip_m2r_process(current_flow=[0,0,0,0,0,0,0,0,0],
process_active=[0,0,0,0,0,0,0,0,0], main_current=[0,0,0,0,0,0,0,0,0], machine_ready=[0,0,0,0,0,0,0,0,0],
comm_ready=[0,0,0,0,0,0,0,0,0])(p. 502)
• app_weld_set_interface_eip_m2r_monitoring(welding_voltage=[0,0,0,0,0,0,0,0,0],
welding_current=[0,0,0,0,0,0,0,0,0], wire_feed_speed=[0,0,0,0,0,0,0,0,0], wire_stick=[0,0,0,0,0,0,0,0,0],
error=[0,0,0,0,0,0,0,0,0], ...)(p. 506)
• app_weld_set_interface_eip_m2r_other(opt1=[0,0,0,0,0,0,0,0,0], opt2=[0,0,0,0,0,0,0,0,0],
opt3=[0,0,0,0,0,0,0,0,0], opt4=[0,0,0,0,0,0,0,0,0], opt5=[0,0,0,0,0,0,0,0,0], opt6=[0,0,0,0,0,0,0,0,0],
opt7=[0,0,0,0,0,0,0,0,0],...)(p. 509)

12.3.8 app_weld_set_interface_eip_m2r_process(current_flow=[0,0,0,0,0,0,
0,0,0], process_active=[0,0,0,0,0,0,0,0,0],
main_current=[0,0,0,0,0,0,0,0,0], machine_ready=[0,0,0,0,0,0,0,0,0],
comm_ready=[0,0,0,0,0,0,0,0,0])
FeaturesThis sets the communication interface setting to use welders that support EtherNet/IP communication. The link
signal interface between the controller and welder in the communication data sent to the welder from the robot
controller can be set. Enter the setting values below along with details based on the communication signal data
sheet of the corresponding welder.

Note
1. To ensure proper welding using an EtherNet/IP remote control welder, all of 8 interface
commands must be set up. app_weld_set_interface_eip_r2m_process(),
app_weld_set_interface_eip_r2m_mode(), app_weld_set_interface_eip_r2m_test(),app_weld_set_interface_eip_r2m_condition(), app_weld_set_interface_eip_r2m_option(),app_weld_set_interface_eip_m2r_process(), app_weld_set_interface_eip_m2r_monitoring(),
app_weld_set_interface_eip_m2r_other()
2. Start robot motion links with the current_flow signal from the welder but is linked with thecorresponding signal when the main_current item is set.
3. End robot motion links with the current_flow signal from the welder but is linked with thecorresponding signal when the process_active item is set.

- 502 -

Programming manual(V2.10)

Application Commands

Parameter
Parameter Name

Data TypeDefault
Value

Description

current_flow

Refer tothe table
below

Refer tothe table
below

Welding Current Generated (specification for eachwelder)process_active

Welding Process Activated (specification for eachwelder)main_current

Regular Welding Current Generated (specification foreach welder)machine_readyWelding Standby (specification for each welder)

comm_readyCommunication Standby (specification for eachwelder)

The data type, default value and description are identical to the below
Parameter Name

Data
Type

Default
Value

Description

list(int[7])0Not Used: 0
Used: 10

Data Type (on/off: 0, Select: 1, Value: 2)0Data Digits (1: 0, 0.1: 1, 0.01: 2)

0Communication Data Point (byte): 1~255

0Communication Data Point (bit): 1~255- 503 -

Programming manual(V2.10)

Application Commands

Parameter Name

Data
Type

Default
Value

Description0

Data Size
1-bit(disable Low): 0
1-bit(disable High): 1
2-bit: 2
4-bit: 3
8-bit(byte): 4
15-bit: 5
16-bit(short): 6
32-bit(int): 70

Valid Data Size
Value (bit)list(float[
2])0Minimum Data Value0

Maximum Data ValueNote
For examples of data (0~2) interface settings, refer to the app_weld_set_interface_eip_r2m_process()
section.

ReturnValue

Description0

Success

Negative Value

FailureException
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error- 504 -

Programming manual(V2.10)

Application Commands

Exception

Description

DR_Error(DR_ERROR_VALUE)

Invalid parameter value

DR_Error(DR_ERROR_RUNTIME)C Extension module error

DR_Error(DR_ERROR_STOP)

Program terminated forcibly

Example1

app_weld_set_interface_eip_m2r_process(current_flow=[1,0,0,0,0,0,1,0,0],
process_active=[1,0,0,0,6,0,1,0,0], main_current=[1,0,0,0,5,0,1,0,0],
machine_ready=[0,0,0,0,0,0,0,0,0], comm_ready=[0,0,0,0,0,0,0,0,0])

Related commands• app_weld_set_interface_eip_r2m_process(welding_start=[0,0,0,0,0,0,0,0,0],
robot_ready=[0,0,0,0,0,0,0,0,0], error_reset=[0,0,0,0,0,0,0,0,0])(p. 484)
• app_weld_set_interface_eip_r2m_mode(welding_mode=[0,0,0,0,0,0,0,0,0], s_2t=[0,0,0,0,0,0,0,0,0],
pulse_mode=[0,0,0,0,0,0,0,0,0],wm_opt1=[0,0,0,0,0,0,0,0,0])(p. 488)
• app_weld_set_interface_eip_r2m_test(gas_test=[0,0,0,0,0,0,0,0,0], inching_plus=[0,0,0,0,0,0,0,0,0],inching_minus=[0,0,0,0,0,0,0,0,0], blow_out_torch=[0,0,0,0,0,0,0,0,0], simulation=[0,0,0,0,0,0,0,0,0],ts_opt1=[0,0,0,0,0,0,0,0,0], ...)(p. 492)
• app_weld_set_interface_eip_r2m_condition(job_num=[0,0,0,0,0,0,0,0,0], synergic_id=[0,0,0,0,0,0,0,0,0],
r_wire_feed_speed=[0,0,0,0,0,0,0,0,0], voltage_corret=[0,0,0,0,0,0,0,0.0,0.0],
dynamic_correct=[0,0,0,0,0,0,0,0,0])(p. 495)
• app_weld_set_interface_eip_r2m_option(opt1=[0,0,0,0,0,0,0,0,0], opt2=[0,0,0,0,0,0,0,0,0],
opt3=[0,0,0,0,0,0,0,0,0], opt4=[0,0,0,0,0,0,0,0,0], opt5=[0,0,0,0,0,0,0,0,0], opt6=[0,0,0,0,0,0,0,0,0],...)(p. 498)
• app_weld_set_interface_eip_m2r_process(current_flow=[0,0,0,0,0,0,0,0,0],
process_active=[0,0,0,0,0,0,0,0,0], main_current=[0,0,0,0,0,0,0,0,0], machine_ready=[0,0,0,0,0,0,0,0,0],
comm_ready=[0,0,0,0,0,0,0,0,0])(p. 502)
• app_weld_set_interface_eip_m2r_monitoring(welding_voltage=[0,0,0,0,0,0,0,0,0],
welding_current=[0,0,0,0,0,0,0,0,0], wire_feed_speed=[0,0,0,0,0,0,0,0,0], wire_stick=[0,0,0,0,0,0,0,0,0],
error=[0,0,0,0,0,0,0,0,0], ...)(p. 506)
• app_weld_set_interface_eip_m2r_other(opt1=[0,0,0,0,0,0,0,0,0], opt2=[0,0,0,0,0,0,0,0,0],
opt3=[0,0,0,0,0,0,0,0,0], opt4=[0,0,0,0,0,0,0,0,0], opt5=[0,0,0,0,0,0,0,0,0], opt6=[0,0,0,0,0,0,0,0,0],
opt7=[0,0,0,0,0,0,0,0,0],...)(p. 509)

- 505 -

Programming manual(V2.10)

Application Commands

12.3.9 app_weld_set_interface_eip_m2r_monitoring(welding_voltage=[0,0,0,0,0,0,0,0,0], welding_current=[0,0,0,0,0,0,0,0,0],
wire_feed_speed=[0,0,0,0,0,0,0,0,0], wire_stick=[0,0,0,0,0,0,0,0,0],
error=[0,0,0,0,0,0,0,0,0], ...)
FeaturesThis sets the communication interface setting to use welders that support EtherNet/IP communication. This
sets the interface related to monitoring of the welding machine’s status setting in the communication data sent
to the welder from the robot controller. Enter the setting values below along with details based on thecommunication signal data sheet of the corresponding welder.

Note
To ensure proper welding using an EtherNet/IP remote control welder, all of 8 interface commands must
be set up.
app_weld_set_interface_eip_r2m_process(), app_weld_set_interface_eip_r2m_mode(),app_weld_set_interface_eip_r2m_test(), app_weld_set_interface_eip_r2m_condition(),app_weld_set_interface_eip_r2m_option(), app_weld_set_interface_eip_m2r_process(),
app_weld_set_interface_eip_m2r_monitoring(), app_weld_set_interface_eip_m2r_other()Parameter
Parameter Name

Data TypeDefault
Value

Description

welding_voltage

Refer to thetable below

Refer to thetable below

Actual Welding Voltage (specification for each welder)welding_current

Actual Welding Current (specification for each welder)

wire_feed_speed

Actual Wire Feeding Speed (specification for eachwelder)wire_stick

Check Wire Stick Status (specification for each welder)error

Check Error Status (specification for each welder)

error_num

Check Error Number (specification for each welder)

The data type, default value and description are identical to the below- 506 -

Programming manual(V2.10)

Application Commands

Parameter Name

Data TypeDefault
Value

Description

list(int[7])0Not Used: 0
Used: 10

Data Type (on/off: 0, Select: 1, Value: 2)0Data Digits (1: 0, 0.1: 1, 0.01: 2)

0Communication Data Point (byte): 1~255

0Communication Data Point (bit): 1~255

0

Data Size
1-bit(disable Low): 0
1-bit(disable High): 1
2-bit: 2
4-bit: 3
8-bit(byte): 4
15-bit: 5
16-bit(short): 6
32-bit(int): 70

Valid Data Size
Value (bit)list(float[2])0Minimum Data Value0

Maximum Data ValueNote
For examples of data (0~2) interface settings, refer to the app_weld_set_interface_eip_r2m_process()
section.

- 507 -

Programming manual(V2.10)

Application Commands

ReturnValue

Description0

Success

Negative Value

FailureException
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error

DR_Error(DR_ERROR_VALUE)

Invalid parameter value

DR_Error(DR_ERROR_RUNTIME)C Extension module error

DR_Error(DR_ERROR_STOP)

Program terminated forcibly

Example1

app_weld_set_interface_eip_m2r_monitoring(welding_voltage=[0,0,0,0,0,0,0,0,0], welding_current=[0,0,0,0,0,0,0,0,0], wire_feed_speed=[0,0,0,0,0,0,0,0,0], wire_stick=[0,0,0,0,0,0,0,0,0], error=[0,0,0,0,0,0,0,0,0], error_num=[0,0,0)

Related commands• app_weld_set_interface_eip_r2m_process(welding_start=[0,0,0,0,0,0,0,0,0],
robot_ready=[0,0,0,0,0,0,0,0,0], error_reset=[0,0,0,0,0,0,0,0,0])(p. 484)
• app_weld_set_interface_eip_r2m_mode(welding_mode=[0,0,0,0,0,0,0,0,0], s_2t=[0,0,0,0,0,0,0,0,0],
pulse_mode=[0,0,0,0,0,0,0,0,0],wm_opt1=[0,0,0,0,0,0,0,0,0])(p. 488)
• app_weld_set_interface_eip_r2m_test(gas_test=[0,0,0,0,0,0,0,0,0], inching_plus=[0,0,0,0,0,0,0,0,0],inching_minus=[0,0,0,0,0,0,0,0,0], blow_out_torch=[0,0,0,0,0,0,0,0,0], simulation=[0,0,0,0,0,0,0,0,0],ts_opt1=[0,0,0,0,0,0,0,0,0], ...)(p. 492)

- 508 -

Programming manual(V2.10)

Application Commands• app_weld_set_interface_eip_r2m_condition(job_num=[0,0,0,0,0,0,0,0,0], synergic_id=[0,0,0,0,0,0,0,0,0],
r_wire_feed_speed=[0,0,0,0,0,0,0,0,0], voltage_corret=[0,0,0,0,0,0,0,0.0,0.0],
dynamic_correct=[0,0,0,0,0,0,0,0,0])(p. 495)
• app_weld_set_interface_eip_r2m_option(opt1=[0,0,0,0,0,0,0,0,0], opt2=[0,0,0,0,0,0,0,0,0],
opt3=[0,0,0,0,0,0,0,0,0], opt4=[0,0,0,0,0,0,0,0,0], opt5=[0,0,0,0,0,0,0,0,0], opt6=[0,0,0,0,0,0,0,0,0],...)(p. 498)
• app_weld_set_interface_eip_m2r_process(current_flow=[0,0,0,0,0,0,0,0,0],
process_active=[0,0,0,0,0,0,0,0,0], main_current=[0,0,0,0,0,0,0,0,0], machine_ready=[0,0,0,0,0,0,0,0,0],
comm_ready=[0,0,0,0,0,0,0,0,0])(p. 502)
• app_weld_set_interface_eip_m2r_monitoring(welding_voltage=[0,0,0,0,0,0,0,0,0],
welding_current=[0,0,0,0,0,0,0,0,0], wire_feed_speed=[0,0,0,0,0,0,0,0,0], wire_stick=[0,0,0,0,0,0,0,0,0],
error=[0,0,0,0,0,0,0,0,0], ...)(p. 506)
• app_weld_set_interface_eip_m2r_other(opt1=[0,0,0,0,0,0,0,0,0], opt2=[0,0,0,0,0,0,0,0,0],
opt3=[0,0,0,0,0,0,0,0,0], opt4=[0,0,0,0,0,0,0,0,0], opt5=[0,0,0,0,0,0,0,0,0], opt6=[0,0,0,0,0,0,0,0,0],
opt7=[0,0,0,0,0,0,0,0,0],...)(p. 509)

12.3.10 app_weld_set_interface_eip_m2r_other(opt1=[0,0,0,0,0,0,0,0,0],
opt2=[0,0,0,0,0,0,0,0,0], opt3=[0,0,0,0,0,0,0,0,0],
opt4=[0,0,0,0,0,0,0,0,0], opt5=[0,0,0,0,0,0,0,0,0],
opt6=[0,0,0,0,0,0,0,0,0], opt7=[0,0,0,0,0,0,0,0,0],...)
FeaturesThis sets the communication interface setting to use welders that support EtherNet/IP communication.
Required functions other than basic setting items (app_weld_set_interface_eip_m2r_process(),
app_weld_set_interface_eip_m2r_monitoring(), app_weld_set_interface_eip_m2r_other(),
app_weld_set_interface_eip_r2m_condition()) in the communication data sent to the robot controller from thewelder can be set with the corresponding command. Enter the setting values below along with details based on
the communication signal data sheet of the corresponding welder.

Note
To ensure proper welding using an EtherNet/IP remote control welder, all of 8 interface commands must
be set up.
app_weld_set_interface_eip_r2m_process(), app_weld_set_interface_eip_r2m_mode(),app_weld_set_interface_eip_r2m_test(), app_weld_set_interface_eip_r2m_condition(),app_weld_set_interface_eip_r2m_option(), app_weld_set_interface_eip_m2r_process(),
app_weld_set_interface_eip_m2r_monitoring(), app_weld_set_interface_eip_m2r_other()- 509 -

Programming manual(V2.10)

Application Commands

Parameter
Parameter Name

Data Type

opt1

Specification

opt2

Specification

opt3

Specification

opt4

Specification

opt5

Specification

opt6

Specification

opt7

Specification

opt8

Specification

opt9

Specification

opt10

Specification

Default Value

Description

The data type, default value and description are identical to the below- 510 -

Programming manual(V2.10)

Application Commands

Parameter
Name

Data TypeDefault Value

Description

list(int[7])0Not Used: 0
Used: 10

Data Type (on/off: 0, Select: 1, Value: 2)0Data Digits (1: 0, 0.1: 1, 0.01: 2)

0Communication Data Point (byte): 1~255

0Communication Data Point (bit): 1~255

0

Data Size
1-bit(disable Low): 0
1-bit(disable High): 1
2-bit: 2
4-bit: 3
8-bit(byte): 4
15-bit: 5
16-bit(short): 6
32-bit(int): 70

Valid Data Size
Value (bit)list(float[2])0Minimum Data Value0

Maximum Data ValueNote
For examples of data (0~2) interface settings, refer to the app_weld_set_interface_eip_r2m_process()
section.

- 511 -

Programming manual(V2.10)

Application Commands

ReturnValue

Description0

Success

Negative Value

FailureException
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error

DR_Error(DR_ERROR_VALUE)

Invalid parameter value

DR_Error(DR_ERROR_RUNTIME)C Extension module error

DR_Error(DR_ERROR_STOP)

Program terminated forcibly

Example1

app_weld_set_interface_eip_m2r_other(opt1=[1,2,1,12,0,6,15,0.0,25.5],
opt2=[1,0,0,0,1,0,1,0,0], opt3=[0,0,0,0,0,0,0,0,0], opt4=[0,0,0,0,0,0,0,0,0], opt5=[0,0,0,0,0,0,0,0,0], opt6=[0,0,0,0,0,0,0,0,0], opt7=[0,0,0,0,0,0,0,0,0, opt8=[0,0,0,0,0,0,0,0,0], opt9=[0,0,0,0,0,0,0,0,0], opt10=[0,0,0,0,0,0,0,0,)

Related commands• app_weld_set_interface_eip_r2m_process(welding_start=[0,0,0,0,0,0,0,0,0],
robot_ready=[0,0,0,0,0,0,0,0,0], error_reset=[0,0,0,0,0,0,0,0,0])(p. 484)
• app_weld_set_interface_eip_r2m_mode(welding_mode=[0,0,0,0,0,0,0,0,0], s_2t=[0,0,0,0,0,0,0,0,0],
pulse_mode=[0,0,0,0,0,0,0,0,0],wm_opt1=[0,0,0,0,0,0,0,0,0])(p. 488)

- 512 -

Programming manual(V2.10)

Application Commands• app_weld_set_interface_eip_r2m_test(gas_test=[0,0,0,0,0,0,0,0,0], inching_plus=[0,0,0,0,0,0,0,0,0],inching_minus=[0,0,0,0,0,0,0,0,0], blow_out_torch=[0,0,0,0,0,0,0,0,0], simulation=[0,0,0,0,0,0,0,0,0],ts_opt1=[0,0,0,0,0,0,0,0,0], ...)(p. 492)
• app_weld_set_interface_eip_r2m_condition(job_num=[0,0,0,0,0,0,0,0,0], synergic_id=[0,0,0,0,0,0,0,0,0],
r_wire_feed_speed=[0,0,0,0,0,0,0,0,0], voltage_corret=[0,0,0,0,0,0,0,0.0,0.0],
dynamic_correct=[0,0,0,0,0,0,0,0,0])(p. 495)
• app_weld_set_interface_eip_r2m_option(opt1=[0,0,0,0,0,0,0,0,0], opt2=[0,0,0,0,0,0,0,0,0],
opt3=[0,0,0,0,0,0,0,0,0], opt4=[0,0,0,0,0,0,0,0,0], opt5=[0,0,0,0,0,0,0,0,0], opt6=[0,0,0,0,0,0,0,0,0],...)(p. 498)
• app_weld_set_interface_eip_m2r_process(current_flow=[0,0,0,0,0,0,0,0,0],
process_active=[0,0,0,0,0,0,0,0,0], main_current=[0,0,0,0,0,0,0,0,0], machine_ready=[0,0,0,0,0,0,0,0,0],
comm_ready=[0,0,0,0,0,0,0,0,0])(p. 502)
• app_weld_set_interface_eip_m2r_monitoring(welding_voltage=[0,0,0,0,0,0,0,0,0],
welding_current=[0,0,0,0,0,0,0,0,0], wire_feed_speed=[0,0,0,0,0,0,0,0,0], wire_stick=[0,0,0,0,0,0,0,0,0],
error=[0,0,0,0,0,0,0,0,0], ...)(p. 506)
• app_weld_set_interface_eip_m2r_other(opt1=[0,0,0,0,0,0,0,0,0], opt2=[0,0,0,0,0,0,0,0,0],
opt3=[0,0,0,0,0,0,0,0,0], opt4=[0,0,0,0,0,0,0,0,0], opt5=[0,0,0,0,0,0,0,0,0], opt6=[0,0,0,0,0,0,0,0,0],
opt7=[0,0,0,0,0,0,0,0,0],...)(p. 509)

12.3.11 app_weld_set_weld_cond_digital(flag_dry_run=0, vel_target=0,
vel_min=0, vel_max=0, welding_mode=0, s_2t=0, pulse_mode=0,
wm_opt1=0, simulation=0, ts_opt1=0, ts_opt2=0,...)
FeatureThis sets the welding condition of the remote control welders. It is only valid within the welding section definedwith the Enable Welding (app_weld_enable_digital()) and Disable Welding (app_weld_disable_digital())
commands, and any operations starting at a point outside the welding section will generate an error. Items thatcan be set as welding conditions are welders corresponding to the following commands(app_weld_set_interface_eip_r2m_mode(), app_weld_set_interface_eip_r2m_condition(),app_weld_set_interface_eip_r2m_option()) and items that completed the communication interface setting.
Only one welding condition is allowed in a single welding section. This welding condition can be adjusted
during welding with the app_weld_adj_welding_cond_dgital() command while the voltage correction/dynamic
correction/feeding speed/speed (and weaving offset) can be also adjusted from the Welding Condition
Adjustment popup of the teaching pendant. However, from the teaching pendant, welding condition
adjustments are only available if the welding condition adjustment status is set to RESET using a command (thewelding condition setting is designated with app_weld_set_weld_cond_digital().
Note
1. Voltage Correction: Adjusts the length of the ark.
2. Dynamic Correction: Adjusts the ark property.

- 513 -

Programming manual(V2.10)

Application Commands

Parameter
Parameter
Name

Data TypeDefault
Value

Description

flag_dry_run

int0

Dry-Run Mode
Actual Welding (0)Dry-Run (1): Motion/Weaving/Offset only

vel_target

float

0

Target Speed (mm/sec)• Take note that the unit is different from that of theteaching pendant input (cm/min)vel_minfloat

0

Minimum Target Speed Correction (mm/sec)• Take note that the unit is different from that of theteaching pendant input (cm/min)vel_max

float

0

Maximum Target Speed Correction (mm/sec)• Take note that the unit is different from that of theteaching pendant input (cm/min)welding_mode

Int0

Welding Mode Setting

s_2t

Int

0

2T, 2T Special Setting

pulse_mode

Int0

Pulse Mode Setting

wm_opt1

Int

0

Welding Mode Option 1 Setting

simulation

int

0

Simulation Mode Setting

ts_opt1

Int

0

Test Signal Option 1 Setting

ts_opt2

Int

0

Test Signal Option 2 Setting

Job_numInt

0

Job Number Setting

synergic_id

Int0

Synergic ID Setting

r_wire_feed_spe
ed

float

0

Wire Feeding Speed Setting- 514 -

Programming manual(V2.10)

Application Commands

Parameter
Name

Data TypeDefault
Value

Description

voltage_correct

float

0

Voltage Correction Setting

dynamic_correct

float

0

Dynamic Correction Setting

r_opt1

float

0

Option 1 Setting

r_opt2float

0

Option 2 Setting

r_opt3float

0

Option 3 Setting

r_opt4float

0

Option 4 Setting

r_opt5float

0

Option 5 Setting

r_opt6float

0

Option 6 Setting

r_opt7float

0

Option 7 Setting

r_opt8float

0

Option 8 Setting

r_opt9float

0

Option 9 Setting

r_opt10float

0

Option 10 Setting

r_opt11float

0

Option 11 Setting

r_opt12float

0

Option 12 Setting

r_opt13float

0

Option 13 Setting

r_opt14float

0

Option 14 Setting

r_opt15

float

0

Option 15 Setting- 515 -

Programming manual(V2.10)

Application Commands

ReturnValue

Description

0

Setting Success

Negative value

Setting Failure

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error

DR_Error(DR_ERROR_VALUE)

Invalid parameter value

DR_Error(DR_ERROR_RUNTIME)C Extension module error

DR_Error(DR_ERROR_STOP)

Program terminated forcibly

Example12

3
4
5

app_weld_enable_digital()
app_weld_set_weld_cond_digital(flag_dry_run=0, vel_target=16, vel_min=0.00,
vel_max=16.67, welding_mode=3, s_2t=0, pulse_mode=0, wm_opt1=0,
simulation=0, ts_opt1=0, ts_opt2=0, job_num=4, synergic_id=0,
r_wire_feed_speed=10, voltage_correct=0, dynamic_correct=0, r_opt1=0,
r_opt2=0, r_opt3=0, r_opt4=0, r_opt5=0, r_opt6=0, r_opt7=0, r_opt8=0,
r_opt9=0, r_opt10=0, r_opt11=0, r_opt12=0, r_opt13=0, r_opt14=0, r_opt15=0)#Welding Speed=60 mm/sec (=1 cm/min), Welding Mode=3, Job Number=4, Wire
Feeding Speed=10 m/min
app_weld_disable_digital()

Related commands• app_weld_set_interface_eip_r2m_process(welding_start=[0,0,0,0,0,0,0,0,0],
robot_ready=[0,0,0,0,0,0,0,0,0], error_reset=[0,0,0,0,0,0,0,0,0])(p. 484)

- 516 -

Programming manual(V2.10)

Application Commands• app_weld_set_interface_eip_r2m_mode(welding_mode=[0,0,0,0,0,0,0,0,0], s_2t=[0,0,0,0,0,0,0,0,0],
pulse_mode=[0,0,0,0,0,0,0,0,0],wm_opt1=[0,0,0,0,0,0,0,0,0])(p. 488)
• app_weld_set_interface_eip_r2m_test(gas_test=[0,0,0,0,0,0,0,0,0], inching_plus=[0,0,0,0,0,0,0,0,0],inching_minus=[0,0,0,0,0,0,0,0,0], blow_out_torch=[0,0,0,0,0,0,0,0,0], simulation=[0,0,0,0,0,0,0,0,0],ts_opt1=[0,0,0,0,0,0,0,0,0], ...)(p. 492)
• app_weld_set_interface_eip_r2m_condition(job_num=[0,0,0,0,0,0,0,0,0], synergic_id=[0,0,0,0,0,0,0,0,0],
r_wire_feed_speed=[0,0,0,0,0,0,0,0,0], voltage_corret=[0,0,0,0,0,0,0,0.0,0.0],
dynamic_correct=[0,0,0,0,0,0,0,0,0])(p. 495)
• app_weld_set_interface_eip_r2m_option(opt1=[0,0,0,0,0,0,0,0,0], opt2=[0,0,0,0,0,0,0,0,0],
opt3=[0,0,0,0,0,0,0,0,0], opt4=[0,0,0,0,0,0,0,0,0], opt5=[0,0,0,0,0,0,0,0,0], opt6=[0,0,0,0,0,0,0,0,0],...)(p. 498)
• app_weld_set_interface_eip_m2r_process(current_flow=[0,0,0,0,0,0,0,0,0],
process_active=[0,0,0,0,0,0,0,0,0], main_current=[0,0,0,0,0,0,0,0,0], machine_ready=[0,0,0,0,0,0,0,0,0],
comm_ready=[0,0,0,0,0,0,0,0,0])(p. 502)
• app_weld_set_interface_eip_m2r_monitoring(welding_voltage=[0,0,0,0,0,0,0,0,0],
welding_current=[0,0,0,0,0,0,0,0,0], wire_feed_speed=[0,0,0,0,0,0,0,0,0], wire_stick=[0,0,0,0,0,0,0,0,0],
error=[0,0,0,0,0,0,0,0,0], ...)(p. 506)
• app_weld_set_interface_eip_m2r_other(opt1=[0,0,0,0,0,0,0,0,0], opt2=[0,0,0,0,0,0,0,0,0],
opt3=[0,0,0,0,0,0,0,0,0], opt4=[0,0,0,0,0,0,0,0,0], opt5=[0,0,0,0,0,0,0,0,0], opt6=[0,0,0,0,0,0,0,0,0],
opt7=[0,0,0,0,0,0,0,0,0],...)(p. 509)
• app_weld_enable_digital()(p. 480)
• app_weld_set_weld_cond_digital(flag_dry_run=0, vel_target=0, vel_min=0, vel_max=0, welding_mode=0,
s_2t=0, pulse_mode=0, wm_opt1=0, simulation=0, ts_opt1=0, ts_opt2=0,...)(p. 513)
• app_weld_adj_welding_cond_digital(flag_reset=None, f_target=None, vel_target=None, wv_offset=None,
wv_width_ratio=None, dynamic_cor=None, voltage_cor=None, job_number=None, synergic_id=None)(p. 518)• app_weld_adj_welding_cond_digital(flag_reset=None, f_target=None, vel_target=None, wv_offset=None,
wv_width_ratio=None, dynamic_cor=None, voltage_cor=None, job_number=None, synergic_id=None)(p. 518)• app_weld_disable_digital()(p. 482)
• app_weld_weave_cond_trapezoidal(wv_offset=[0,0], wv_ang=0,
wv_param=[0,1.5,0,-1.5,0.3,0.1,0.3,0.3,0.1,0.3])(p. 544)
• app_weld_weave_cond_zigzag(wv_offset=[0,0], wv_ang=0, wv_param=[3,0.6])(p. 547)
• app_weld_weave_cond_circular(wv_offset=[0,0], wv_ang=0, wv_param=[3,3,0.3,0.3])(p. 549)
• app_weld_weave_cond_sinusoidal(wv_offset=[0,0], wv_ang=0, wv_param=[3,0.6])(p. 551)

- 517 -

Programming manual(V2.10)

Application Commands

12.3.12 app_weld_adj_welding_cond_digital(flag_reset=None,f_target=None, vel_target=None, wv_offset=None,
wv_width_ratio=None, dynamic_cor=None, voltage_cor=None,
job_number=None, synergic_id=None)
FeaturesThis adjusts the welding condition and weaving condition during welding with a remote control welder. It is
used to change the welding condition of each section in a series of sections before calling the motion command(movel(), movec(), moveb(), movesx()). If an adjustment factor is entered using this command, thecorresponding welding condition and weaving condition are adjusted, and real-time adjustment of the welding/weaving condition from the welding monitoring information screen of the TP becomes unavailable. Execute
flag_reset=1 to reset the adjusted condition to the main condition set using app_weld_set_weld_cond_digital()
and app_weld_weave_cond_trapezoidal(). Setting flag_reset=1 will reset to the final condition adjusted in realtime using the TP (the weaving width ratio (wv_width_ratio), which cannot be adjusted in real-time, is changedto 1), and the welding condition can be adjusted in real-time from the TP.

Parameter
Parameter Name

Data TypeDefault
Value

Description

flag_resetint

0

0: Apply Adjustment
1 : Default Target (app_weld_set_weld_cond_digital())
Apply Valuef_targetfloat-

Feeding Speed (m/min)

vel_target

float

-

Target Speed (mm/sec)• Take note that the unit is different from that of
the teaching pendant input (cm/min)

wv_offset

float[2]-Weaving Coordinate-Y Direction Offset (mm)-Weaving Coordinate-Z Direction Offset (mm)wv_width_ratio

float

-

Changed Weaving Width/Set Weaving Width Ratio (0-2)

dynamic_cor

float

-

Dynamic Correction

voltage_cor

float

-

Voltage Correction- 518 -

Programming manual(V2.10)

Application Commands

Parameter Name

Data TypeDefault
Value

Description

job_number

float

-

Job Number

synergic_id

float

-

Synergic ID

Note
Conditions which do not designate a value in factors vel_target/wv_offset/wv_width_ratio/
dynamic_cor/voltage_cor/job_number/synergic_id will maintain the current condition (including
conditions with real-time adjustments), so only set factors that require adjustment. However, in the caseof wv_offset, even if an adjustment is made only to the Y direction or Z direction, values for bothsequences must be entered.

ReturnValue

Description

0

Setting Success

Negative value

Setting Failure

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error

DR_Error(DR_ERROR_VALUE)

Invalid parameter value

DR_Error(DR_ERROR_RUNTIME)C Extension module error

DR_Error(DR_ERROR_STOP)

Program terminated forcibly- 519 -

Programming manual(V2.10)

Application Commands

Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37

movej(posj(0,0,90,0,90,0),v=30,a=60)

pt1= posx(559, 434.5, 651.5, 45, 180, 45)
pt2= posx(559, 434.5, 151.5, 45, 180, 45)
pt3= posx(559, 0.0, 151.5, 45, 180, 45)

app_weld_enable_digital()

app_weld_set_weld_cond_digital(flag_dry_run=0, vel_target=16, vel_min=0.00,
vel_max=16.67, welding_mode=3, s_2t=0, pulse_mode=0, wm_opt1=0,
simulation=0, ts_opt1=0, ts_opt2=0, job_num=4, synergic_id=0,
r_wire_feed_speed=15, voltage_correct=0, dynamic_correct=0, r_opt1=0,
r_opt2=0, r_opt3=0, r_opt4=0, r_opt5=0, r_opt6=0, r_opt7=0, r_opt8=0,
r_opt9=0, r_opt10=0, r_opt11=0, r_opt12=0, r_opt13=0, r_opt14=0, r_opt15=0)

movel(pt1, v=5, a=5, r=30, app_type=DR_MV_APP_WELD)
app_weld_adj_welding_cond_digital(flag_reset=0, f_target=10, vel_target=16,
wv_offset=[20,30], wv_width_ratio=0.5,
dynamic_cor=0, voltage_cor=0, job_number=5, synergic_id=4)
movel(pt2, v=5, a=5, r=30, app_type=DR_MV_APP_WELD)
app_weld_adj_welding_cond_digital(flag_reset=1)
movel(pt3, v=5, a=5, app_type=DR_MV_APP_WELD)# Start Point → pt1: Apply Initial Welding Condition Setting (Job Number:
4, Synergic ID: 0, Feeding Speed: 15 m/min)# pt1 → pt2: Apply Correction Condition (Job Number: 5, Synergic ID: 4,
Feeding Speed: 15 m/min)# pt2 → pt3: Apply Initial Setting Apply Initial Welding Condition
Setting (Job Number: 4, Synergic ID: 0, Feeding Speed: 15 m/min)

38
39
40

- 520 -

Programming manual(V2.10)

Application Commands

41

app_weld_disable_digital()

Related commands• app_weld_set_interface_eip_r2m_process(welding_start=[0,0,0,0,0,0,0,0,0],
robot_ready=[0,0,0,0,0,0,0,0,0], error_reset=[0,0,0,0,0,0,0,0,0])(p. 484)
• app_weld_set_interface_eip_r2m_mode(welding_mode=[0,0,0,0,0,0,0,0,0], s_2t=[0,0,0,0,0,0,0,0,0],
pulse_mode=[0,0,0,0,0,0,0,0,0],wm_opt1=[0,0,0,0,0,0,0,0,0])(p. 488)
• app_weld_set_interface_eip_r2m_test(gas_test=[0,0,0,0,0,0,0,0,0], inching_plus=[0,0,0,0,0,0,0,0,0],inching_minus=[0,0,0,0,0,0,0,0,0], blow_out_torch=[0,0,0,0,0,0,0,0,0], simulation=[0,0,0,0,0,0,0,0,0],ts_opt1=[0,0,0,0,0,0,0,0,0], ...)(p. 492)
• app_weld_set_interface_eip_r2m_condition(job_num=[0,0,0,0,0,0,0,0,0], synergic_id=[0,0,0,0,0,0,0,0,0],
r_wire_feed_speed=[0,0,0,0,0,0,0,0,0], voltage_corret=[0,0,0,0,0,0,0,0.0,0.0],
dynamic_correct=[0,0,0,0,0,0,0,0,0])(p. 495)
• app_weld_set_interface_eip_r2m_option(opt1=[0,0,0,0,0,0,0,0,0], opt2=[0,0,0,0,0,0,0,0,0],
opt3=[0,0,0,0,0,0,0,0,0], opt4=[0,0,0,0,0,0,0,0,0], opt5=[0,0,0,0,0,0,0,0,0], opt6=[0,0,0,0,0,0,0,0,0],...)(p. 498)
• app_weld_set_interface_eip_m2r_process(current_flow=[0,0,0,0,0,0,0,0,0],
process_active=[0,0,0,0,0,0,0,0,0], main_current=[0,0,0,0,0,0,0,0,0], machine_ready=[0,0,0,0,0,0,0,0,0],
comm_ready=[0,0,0,0,0,0,0,0,0])(p. 502)
• app_weld_set_interface_eip_m2r_monitoring(welding_voltage=[0,0,0,0,0,0,0,0,0],
welding_current=[0,0,0,0,0,0,0,0,0], wire_feed_speed=[0,0,0,0,0,0,0,0,0], wire_stick=[0,0,0,0,0,0,0,0,0],
error=[0,0,0,0,0,0,0,0,0], ...)(p. 506)
• app_weld_set_interface_eip_m2r_other(opt1=[0,0,0,0,0,0,0,0,0], opt2=[0,0,0,0,0,0,0,0,0],
opt3=[0,0,0,0,0,0,0,0,0], opt4=[0,0,0,0,0,0,0,0,0], opt5=[0,0,0,0,0,0,0,0,0], opt6=[0,0,0,0,0,0,0,0,0],
opt7=[0,0,0,0,0,0,0,0,0],...)(p. 509)
• app_weld_enable_digital()(p. 480)
• app_weld_set_weld_cond_digital(flag_dry_run=0, vel_target=0, vel_min=0, vel_max=0, welding_mode=0,
s_2t=0, pulse_mode=0, wm_opt1=0, simulation=0, ts_opt1=0, ts_opt2=0,...)(p. 513)
• app_weld_adj_welding_cond_digital(flag_reset=None, f_target=None, vel_target=None, wv_offset=None,
wv_width_ratio=None, dynamic_cor=None, voltage_cor=None, job_number=None, synergic_id=None)(p. 518)• app_weld_disable_digital()(p. 482)
• app_weld_weave_cond_trapezoidal(wv_offset=[0,0], wv_ang=0,
wv_param=[0,1.5,0,-1.5,0.3,0.1,0.3,0.3,0.1,0.3])(p. 544)
• app_weld_weave_cond_zigzag(wv_offset=[0,0], wv_ang=0, wv_param=[3,0.6])(p. 547)
• app_weld_weave_cond_circular(wv_offset=[0,0], wv_ang=0, wv_param=[3,3,0.3,0.3])(p. 549)
• app_weld_weave_cond_sinusoidal(wv_offset=[0,0], wv_ang=0, wv_param=[3,0.6])(p. 551)
• movel()(p. 59)• amovel()(p. 98)• movec()(p. 68)• amovec()(p. 104)• moveb()(p. 81)• amoveb()(p. 114)

- 521 -

Programming manual(V2.10)

Application Commands• movesx()(p. 77)• amovesx()(p. 111)12.3.13 app_weld_get_welding_cond_digital()
FeaturesThis monitors the welding status during welding with a remote control welder. Items available for monitoringare voltage correction/dynamic correction/feeding speed/speed/weaving offset/error number/error status/wire
tip fusion/option and measured voltage/current/feeding speed and welding status. Signals other than the basic
monitoring items can be added. The corresponding signal must be preset using the interface
app_weld_set_interface_eip_m2r_other(). In addition, it is possible to check the fail status using the welding
status factor.

Parameter
Parameter Name

Data TypeDefault
Value

Description

ReturnValue

Description

voltage_cor

Current Target Voltage Correction (V) (target with adjustment applied)

dynamic_cor

Current Target Dynamic Correction (target with adjustment applied)

f_targetCurrent Target Feeding Speed (m/min) (target with adjustment applied)

vel_target

Current Target Speed (mm/sec) (target with adjustment applied)• Take note that the unit is different from that of the monitoring output unit
(cm/min) of the teaching pendantv_measCurrent Measured Voltage (V)c_measCurrent Measured Current (A)wv_offset[2]Current Target Offset (Y and Z directions, mm) (target with adjustment applied)- 522 -

Programming manual(V2.10)

Application Commands

Value

Description

statusNon-weld:0, Weld (Normal): 1, Weld (Abnormal): 9, Dry-run: 99

f_measCurrent Measured Feeding Speed (mm/sec)

error_num

Error Number

wire_stick

Wire Tip Fusion Status (0: Normal, 1: Abnormal)

error

Error Status (0: Normal, 1: Abnormal)

option1

Option 1 Information

option2

Option 2 Information

option3

Option 3 Information

option4

Option 4 Information

option5

Option 5 Information

option6

Option 6 Information

option7

Option 7 Information

option8

Option 8 Information

option9

Option 9 Information

option10

Option 10 Information

current_flow

Current Flow Status (0: Normal, 1: Abnormal)

process_active

Process Activation Status (0: Normal, 1: Abnormal)

machine_readyWelding Preparation Status (0: Normal, 1: Abnormal)- 523 -

Programming manual(V2.10)

Application Commands

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error

DR_Error(DR_ERROR_VALUE)

Invalid parameter value

DR_Error(DR_ERROR_RUNTIME)C Extension module error

DR_Error(DR_ERROR_STOP)

Program terminated forcibly

Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

18
19
20
21
22

movej(posj(0,0,90,0,90,0),v=30,a=60)

pt1= posx(559, 434.5, 651.5, 45, 180, 45)
pt2= posx(559, 434.5, 151.5, 45, 180, 45)
pt3= posx(559, 0.0, 151.5, 45, 180, 45)

app_weld_enable_digital()

app_weld_set_weld_cond_digital(flag_dry_run=1, vel_target=16, vel_min=0.00,
vel_max=16.67, welding_mode=3, s_2t=0, pulse_mode=0, wm_opt1=0,
simulation=0, ts_opt1=0, ts_opt2=0, job_num=4, synergic_id=0,
r_wire_feed_speed=15, voltage_correct=0, dynamic_correct=0, r_opt1=0,
r_opt2=0, r_opt3=0, r_opt4=0, r_opt5=0, r_opt6=0, r_opt7=0, r_opt8=0,
r_opt9=0, r_opt10=0, r_opt11=0, r_opt12=0, r_opt13=0, r_opt14=0, r_opt15=0)

movel(pt1, v=5, a=5, r=30, app_type=DR_MV_APP_WELD)- 524 -

Programming manual(V2.10)

Application Commands

23
24
25
26
27
28
29
30
31
32
33
34
35
36
37

38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57

app_weld_adj_welding_cond_digital(flag_reset=0, f_target=10, vel_target=16,
wv_offset=[20,30], wv_width_ratio=0.5,
dynamic_cor=0, voltage_cor=0, job_number=5, synergic_id=4)
movel(pt2, v=5, a=5, r=30, app_type=DR_MV_APP_WELD)
app_weld_adj_welding_cond_digital(flag_reset=1)
amovel(pt3, v=5, a=5, app_type=DR_MV_APP_WELD)[voltage_cor, dynamic_cor, f_target, vel_target, v_meas, c_meas,
wv_offset, status, f_meas, error_num, wire_stick,error, opt1, opt2, opt3, opt4, opt5, opt6, opt7, opt8, opt9, opt10,
current_flow, process_active, machine_ready]=app_weld_get_welding_cond_dig
ital();

while True:
if status == 9:
tp_popup("welding error!! ", DR_PM_ALARM, 1)# An alarm is generated if abnormal welding occurs (status=9)
else :
if check_motion()==0:
break

app_weld_disable_digital()

Related commands• app_weld_set_interface_eip_r2m_process(welding_start=[0,0,0,0,0,0,0,0,0],
robot_ready=[0,0,0,0,0,0,0,0,0], error_reset=[0,0,0,0,0,0,0,0,0])(p. 484)
• app_weld_set_interface_eip_r2m_mode(welding_mode=[0,0,0,0,0,0,0,0,0], s_2t=[0,0,0,0,0,0,0,0,0],
pulse_mode=[0,0,0,0,0,0,0,0,0],wm_opt1=[0,0,0,0,0,0,0,0,0])(p. 488)
• app_weld_set_interface_eip_r2m_test(gas_test=[0,0,0,0,0,0,0,0,0], inching_plus=[0,0,0,0,0,0,0,0,0],inching_minus=[0,0,0,0,0,0,0,0,0], blow_out_torch=[0,0,0,0,0,0,0,0,0], simulation=[0,0,0,0,0,0,0,0,0],ts_opt1=[0,0,0,0,0,0,0,0,0], ...)(p. 492)

- 525 -

Programming manual(V2.10)

Application Commands• app_weld_set_interface_eip_r2m_condition(job_num=[0,0,0,0,0,0,0,0,0], synergic_id=[0,0,0,0,0,0,0,0,0],
r_wire_feed_speed=[0,0,0,0,0,0,0,0,0], voltage_corret=[0,0,0,0,0,0,0,0.0,0.0],
dynamic_correct=[0,0,0,0,0,0,0,0,0])(p. 495)
• app_weld_set_interface_eip_r2m_option(opt1=[0,0,0,0,0,0,0,0,0], opt2=[0,0,0,0,0,0,0,0,0],
opt3=[0,0,0,0,0,0,0,0,0], opt4=[0,0,0,0,0,0,0,0,0], opt5=[0,0,0,0,0,0,0,0,0], opt6=[0,0,0,0,0,0,0,0,0],...)(p. 498)
• app_weld_set_interface_eip_m2r_process(current_flow=[0,0,0,0,0,0,0,0,0],
process_active=[0,0,0,0,0,0,0,0,0], main_current=[0,0,0,0,0,0,0,0,0], machine_ready=[0,0,0,0,0,0,0,0,0],
comm_ready=[0,0,0,0,0,0,0,0,0])(p. 502)
• app_weld_set_interface_eip_m2r_monitoring(welding_voltage=[0,0,0,0,0,0,0,0,0],
welding_current=[0,0,0,0,0,0,0,0,0], wire_feed_speed=[0,0,0,0,0,0,0,0,0], wire_stick=[0,0,0,0,0,0,0,0,0],
error=[0,0,0,0,0,0,0,0,0], ...)(p. 506)
• app_weld_set_interface_eip_m2r_other(opt1=[0,0,0,0,0,0,0,0,0], opt2=[0,0,0,0,0,0,0,0,0],
opt3=[0,0,0,0,0,0,0,0,0], opt4=[0,0,0,0,0,0,0,0,0], opt5=[0,0,0,0,0,0,0,0,0], opt6=[0,0,0,0,0,0,0,0,0],
opt7=[0,0,0,0,0,0,0,0,0],...)(p. 509)
• app_weld_enable_digital()(p. 480)
• app_weld_set_weld_cond_digital(flag_dry_run=0, vel_target=0, vel_min=0, vel_max=0, welding_mode=0,
s_2t=0, pulse_mode=0, wm_opt1=0, simulation=0, ts_opt1=0, ts_opt2=0,...)(p. 513)
• app_weld_adj_welding_cond_digital(flag_reset=None, f_target=None, vel_target=None, wv_offset=None,
wv_width_ratio=None, dynamic_cor=None, voltage_cor=None, job_number=None, synergic_id=None)(p. 518)• app_weld_disable_digital()(p. 482)
• app_weld_weave_cond_trapezoidal(wv_offset=[0,0], wv_ang=0,
wv_param=[0,1.5,0,-1.5,0.3,0.1,0.3,0.3,0.1,0.3])(p. 544)
• app_weld_weave_cond_zigzag(wv_offset=[0,0], wv_ang=0, wv_param=[3,0.6])(p. 547)
• app_weld_weave_cond_circular(wv_offset=[0,0], wv_ang=0, wv_param=[3,3,0.3,0.3])(p. 549)
• app_weld_weave_cond_sinusoidal(wv_offset=[0,0], wv_ang=0, wv_param=[3,0.6])(p. 551)
• movel()(p. 59)• amovel()(p. 98)• movec()(p. 68)• amovec()(p. 104)• moveb()(p. 81)• amoveb()(p. 114)
• movesx()(p. 77)• amovesx()(p. 111)

- 526 -

Programming manual(V2.10)

Application Commands

12.3.14 app_weld_enable_analog(ch_v_out=[1,0], spec_v_out=[0,0,0,0],ch_f_out=[2,0], spec_f_out=[0,0,0,0], ch_v_in=[1,0],
spec_v_in=[0,0,0,0], ch_c_in=[2,0],
spec_c_in=[0,0,0,0],ch_arc_on=1,ch_gas_on=2,ch_inching_fwd=3,ch_inching_bwd=4, ...)
FeaturesThis enables the analog welding function. It enters the connection and environment information of theavailable welding machine’s analog I/O and digital signal output as input factors.
The target welding machine must support an analog interface so it can receive target current and target voltage
inputs from the analog output channel of the connected controller. Set the channel number (1 or 2) and output
mode (current/voltage) of the physically connected analog channel in ch_v_out and ch_f_out. The analog
input/output range of the controller is 0-10 V for voltage mode and 4-20 mA for current mode. Make sure to set
the mode and output range of each channel to be compatible with the input specification and range of thewelding machine. For example, if the target input range of the welding machine is 0-10 V, it is ideal to set theoutput channel of the controller as voltage mode (0-10 V output range). Another example would be if the input
channel specification of the welding machine is 2-15 V. In this case, set the analog channel current mode (4-20mA output range) on the corresponding controller and connect a 75 ohm resistance to output a 3-15 V voltage.
(In this case, the 2-3 V range, which cannot be set using the controller, cannot set a target.) It is recommended
that the welding machine be set with as large an input range as possible.
Set the maximum and minimum range of the controller analog output in spec_v_out and spec_f_out.

First item of spec_v_out/spec_f_out = WO_min
Second item of spec_v_out/spec_f_out = CO_min
Third item of spec_v_out/spec_f_out = WO_max
Fourth item of spec_v_out/spec_f_out = CO_max
Where, WO_min and WO_max are the minimum and maximum output of the welder, and CO_min and CO_max
are the controller analog output corresponding to WO_min and WO_max.

Note
The welding current varies according to the wire feeding speed, basic material, material/type/stick-outof the welding wire, and welding voltage, and this must be monitored with the welding machine or aseparate current sensor.

- 527 -

Programming manual(V2.10)

Application Commands

In order to monitor the voltage/current measurements during welding, it is necessary to connect an analog
output welding machine or a separate sensor. Set the analog input channel number and input mode of thecorresponding controller in ch_v_in and ch_c_in.
Set the maximum and minimum input range of sensor measured in spec_v_in and spec_f_in.

First item of spec_v_in/spec_c_in = SO_min
Second item of spec_v_in/spec_c_in = CI_min
Third item of spec_v_in/spec_c_in = SO_max
Fourth item of spec_v_in/spec_c_in = CI_max

Where, SO_min and SO_max are the minimum and maximum sensor, and CI_min and CI_max are the controller
input corresponding to SO_min and SO_max.
Set the channel numbers for ARC-ON/OFF (gas output signal - start/end), GAS-ON/OFF (gas output signal - start/end), INCHING-Forward-ON/OFF (forward wire feed signal - start/end), INCHING-Backward-ON/OFF (backward
wire feed signal - start/end), and BlowOut-ON/OFF (torch cleaning gas output signal - start/end), which connect
to the welding machine using digital contact method. In the case of signal outputs other than the ARC-ON/OFF
signal, enter them selectively, depending on whether the welding machine supports the corresponding
function.

Parameter
Parameter
Name

Data TypeDefault
Value

Description

ch_v_outlist(int[2])1Target Voltage Analog Output Channel (1-2)
If no designation is made: 00

0: Current Mode (4~20 mA)
1: Voltage Mode (0~10 V)

spec_v_out

list(float[4])0Welder Output Voltage (V) Minimum (a)0Controller Output corresponding to (a)0Welder Output Voltage (V) Maximum (b)0Controller Output corresponding to (b)- 528 -

Programming manual(V2.10)

Application Commands

Parameter
Name

Data TypeDefault
Value

Description

ch_f_outlist(int[2])2Feeding Speed Command Analog Output Channel (1-2)
If no designation is made: 00

0: Current Mode (4~20 mA)
1: Voltage Mode (0~10 V)

spec_f_out

ch_v_inlist(float[4])list(int[2])0Feeding Speed (m/min) Minimum (c)0Controller Output corresponding to (c)0Feeding Speed (m/min) Maximum (d)0Controller Output corresponding to (d)1Voltage Sensor Analog Input Channel (1-2)
If no sensor is present: 0

0

0: Current Mode (4~20 mA)
1: Voltage Mode (0~10 V)

spec_v_in

ch_c_inlist(float[4])list(int[2])0Voltage Sensor Input (V) Minimum (e)0Controller Input corresponding to (e)0Voltage Sensor Input (V) Maximum (f)0Controller Input corresponding to (f)2Current Sensor Analog Input Channel (1-2)
If no sensor is present: 0

0

0: Current Mode (4~20 mA)
1: Voltage Mode (0~10 V)

spec_c_inlist(float[4])0Current Sensor Input (A) Minimum (g)0Controller Input corresponding to (g)- 529 -

Programming manual(V2.10)

Application Commands

Parameter
Name

Data TypeDefault
Value

Description0

Current Sensor Input (A) Maximum (h)0Controller Input corresponding to (h)ch_arc_on

int1

Welding Output Digital Output Channel (1-16)

ch_gas_on

int

2

Protective Gas Digital Output Channel (1~16)
If no connection is present: 0

ch_inching_fw
d

int

3

Welding Wire Forward Stick-Out Digital Output Channel(1-16)
If no connection is present: 0

ch_inching_bwdint

ch_blow_out

int4

Welding Wire Reverse Stick-Out Digital Output Channel (1-16)
If no connection is present: 0

5Torch Cleaning Gas Output Digital Channel (1~16)
If no connection is present: 0

ReturnValue

Description

0

Enable Welding Success

Negative Value

Enable Welding Failure

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error

DR_Error(DR_ERROR_VALUE)

Invalid parameter value- 530 -

Programming manual(V2.10)

Application Commands

Exception

Description

DR_Error(DR_ERROR_RUNTIME)C Extension module error

DR_Error(DR_ERROR_STOP)

Program terminated forcibly

Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

app_weld_enable_analog(ch_v_out=[1,1], spec_v_out=[0,0,300,10], ch_f_out =[2,,spec_f_out =[0,0,40,10], ch_v_in =[1,1], spec_v_in =[0,0,300,10], ch_c_in=[2,1],
spec_c_in=[0,0,40,10], ch_arc_on=1, ch_gas_on=2, ch_inching_fwd=3,
ch_inching_bwd=4, ch_blow_out=5)# Voltage Output (Channel 1, Voltage Mode), Welder Voltage Specification(Min/Max)=(0-300)# Feeding Speed Output (Channel 2, Voltage Mode), Feeding Speed
Specification (Min/Max)=(0-40)# Voltage Sensing (Channel 1, Voltage Mode), Sensor Measurement
Specification (Min/Max)=(0-300)# Current Sensing (Channel 2, Voltage Mode), Sensor Specification (Min/
Max)=(0-40)# Start Welding Signal (Channel 1), Gas Output Signal (Channel 2), Wire
Forward Stick-Out Signal (Channel 3),# Wire Reverse Stick-Out Signal (Channel 4), Torch Cleaning Gas Output
Signal (Channel 5)
app_weld_disable_analog()

Related commands• app_weld_enable_analog(ch_v_out=[1,0], spec_v_out=[0,0,0,0], ch_f_out=[2,0], spec_f_out=[0,0,0,0],ch_v_in=[1,0], spec_v_in=[0,0,0,0], ch_c_in=[2,0],
spec_c_in=[0,0,0,0],ch_arc_on=1,ch_gas_on=2,ch_inching_fwd=3,ch_inching_bwd=4, ...)(p. 527)
• app_weld_set_weld_cond_analog(flag_dry_run=0, v_target=0, f_target=0, vel_target=0, vel_min=0,
vel_max=0, weld_proc_param=[0.2,0.2,0.5,0.5,0.5,0.2,0.2,0.5,0.5])(p. 534)

- 531 -

Programming manual(V2.10)

Application Commands• app_weld_weave_cond_trapezoidal(wv_offset=[0,0], wv_ang=0,
wv_param=[0,1.5,0,-1.5,0.3,0.1,0.3,0.3,0.1,0.3])(p. 544)
• app_weld_weave_cond_zigzag(wv_offset=[0,0], wv_ang=0, wv_param=[3,0.6])(p. 547)
• app_weld_weave_cond_circular(wv_offset=[0,0], wv_ang=0, wv_param=[3,3,0.3,0.3])(p. 549)
• app_weld_weave_cond_sinusoidal(wv_offset=[0,0], wv_ang=0, wv_param=[3,0.6])(p. 551)
• app_weld_adj_welding_cond_analog(flag_reset=0, v_target=None, f_target=None, vel_target=None,
wv_offset=None, wv_width_ratio=None)(p. 538)
• app_weld_get_welding_cond_analog()(p. 541)
• app_weld_weave_cond_trapezoidal(wv_offset=[0,0], wv_ang=0,
wv_param=[0,1.5,0,-1.5,0.3,0.1,0.3,0.3,0.1,0.3])(p. 544)
• app_weld_weave_cond_zigzag(wv_offset=[0,0], wv_ang=0, wv_param=[3,0.6])(p. 547)
• app_weld_weave_cond_circular(wv_offset=[0,0], wv_ang=0, wv_param=[3,3,0.3,0.3])(p. 549)
• app_weld_weave_cond_sinusoidal(wv_offset=[0,0], wv_ang=0, wv_param=[3,0.6])(p. 551)

12.3.15 app_weld_disable_analog()
FeaturesThis disables the analog welding function.

Parameter
Parameter Name

Data TypeDefault
Value

Description

ReturnValue

Description0

Success

Negative Value

FailureException
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error- 532 -

Programming manual(V2.10)

Application Commands

Exception

Description

DR_Error(DR_ERROR_VALUE)

Invalid parameter value

DR_Error(DR_ERROR_RUNTIME)C Extension module error

DR_Error(DR_ERROR_STOP)

Program terminated forcibly

Example12
3
4
5

app_weld_enable_analog(ch_v_out=[1,1], spec_v_out=[0,0,300,10], ch_f_out =[2,,spec_f_out =[0,0,40,10], ch_v_in =[1,1], spec_v_in =[0,0,300,10], ch_c_in=[2,1],
spec_c_in=[0,0,40,10], ch_arc_on=1, ch_gas_on=2, ch_inching_fwd=3,
ch_inching_bwd=4, ch_blow_out=5)
app_weld_disable_analog()

Related commands• app_weld_enable_analog(ch_v_out=[1,0], spec_v_out=[0,0,0,0], ch_f_out=[2,0], spec_f_out=[0,0,0,0],ch_v_in=[1,0], spec_v_in=[0,0,0,0], ch_c_in=[2,0],
spec_c_in=[0,0,0,0],ch_arc_on=1,ch_gas_on=2,ch_inching_fwd=3,ch_inching_bwd=4, ...)(p. 527)
• app_weld_set_weld_cond_analog(flag_dry_run=0, v_target=0, f_target=0, vel_target=0, vel_min=0,
vel_max=0, weld_proc_param=[0.2,0.2,0.5,0.5,0.5,0.2,0.2,0.5,0.5])(p. 534)
• app_weld_weave_cond_trapezoidal(wv_offset=[0,0], wv_ang=0,
wv_param=[0,1.5,0,-1.5,0.3,0.1,0.3,0.3,0.1,0.3])(p. 544)
• app_weld_weave_cond_zigzag(wv_offset=[0,0], wv_ang=0, wv_param=[3,0.6])(p. 547)
• app_weld_weave_cond_circular(wv_offset=[0,0], wv_ang=0, wv_param=[3,3,0.3,0.3])(p. 549)
• app_weld_weave_cond_sinusoidal(wv_offset=[0,0], wv_ang=0, wv_param=[3,0.6])(p. 551)
• app_weld_adj_welding_cond_analog(flag_reset=0, v_target=None, f_target=None, vel_target=None,
wv_offset=None, wv_width_ratio=None)(p. 538)
• app_weld_get_welding_cond_analog()(p. 541)
• app_weld_weave_cond_trapezoidal(wv_offset=[0,0], wv_ang=0,
wv_param=[0,1.5,0,-1.5,0.3,0.1,0.3,0.3,0.1,0.3])(p. 544)
• app_weld_weave_cond_zigzag(wv_offset=[0,0], wv_ang=0, wv_param=[3,0.6])(p. 547)
• app_weld_weave_cond_circular(wv_offset=[0,0], wv_ang=0, wv_param=[3,3,0.3,0.3])(p. 549)
• app_weld_weave_cond_sinusoidal(wv_offset=[0,0], wv_ang=0, wv_param=[3,0.6])(p. 551)

- 533 -

Programming manual(V2.10)

Application Commands

12.3.16 app_weld_set_weld_cond_analog(flag_dry_run=0, v_target=0,
f_target=0, vel_target=0, vel_min=0, vel_max=0,
weld_proc_param=[0.2,0.2,0.5,0.5,0.5,0.2,0.2,0.5,0.5])
FeaturesThis sets the analog welding condition. It is only valid within the welding section defined with the EnableWelding (app_weld_enable_analog()) and Disable Welding (app_weld_disable_analog()) commands, and any
operations starting at a point outside the welding section will generate an error. The Welding Parameter(weld_proc_param) of the welding condition displays detailed conditions, including gas during start/end
welding and condition maintenance time. Refer to the figure below for the values to enter. Only one welding
condition is allowed in a single welding section. This welding condition can be adjusted during welding with theapp_weld_adj_welding_cond_analog() command while the voltage/feeding speed/speed (and weaving offset)
can be also adjusted from the Welding Condition Adjustment popup of the teaching pendant. However, fromthe teaching pendant, welding condition adjustments are only available if the welding condition adjustment
status is set to RESET using a command (the welding condition setting is designated with
app_weld_set_weld_cond_analog()).

Note
The welding current varies according to the wire feeding speed, basic material, material/type/stick-outof the welding wire, and welding voltage, and this must be monitored with the welding machine or aseparate current sensor.

(a)Rsf/Rsv (b)Rff/Rfv (c)Tss (d)Tsf (e)Tas (f)Taf (g)Twc- 534 -

Programming manual(V2.10)

Application Commands

Parameter
Parameter Name

Data TypeDefault
Value

Description

flag_dry_run

int0

Dry-Run Mode
Actual Welding (0)Dry-Run (1): Motion/Weaving/Offset only

v_targetfloat

0Target Voltage (V)f_targetfloat

0Target Feeding Speed (m/min)

vel_target

float

0

Target Speed (mm/sec)• Take note that the unit is different from that of
the teaching pendant input (cm/min)vel_minfloat

0

Minimum Target Speed Correction (mm/sec)• Take note that the unit is different from that of
the teaching pendant input (cm/min)vel_max

float

0

Maximum Target Speed Correction (mm/sec)• Take note that the unit is different from that of
the teaching pendant input (cm/min)weld_proc_paramlist(float[9])0.2

Rsf (Feeding Speed Start Condition/Target Condition
Ratio)(0< Rsf <= 1)

0.2

Rsv (Voltage Start Condition/Target Condition Ratio)(0< Rsv <= 1)

0.5

Tss (Protective Gas Discharge Time Before Welding, sec)(0<= Tss)

0.5

Tas (Start Welding Condition Maintenance Time, sec)(0<= Twc)

0.5

Twc (Change Welding Condition Time, sec)(0<= Twc)- 535 -

Programming manual(V2.10)

Application Commands

Parameter Name

Data TypeDefault
Value

Description

0.2

Rff (Feeding Speed End Condition/Target Condition
Ratio)(0< Rff <= 1)

0.2

Rfv (Voltage End Condition/Target Condition Ratio)(0< Rfv <= 1)

0.5

Taf (End Welding Condition Maintenance Time, sec)(0<= Taf)

0.5

Tsf (Protective Gas Discharge Time After Welding, sec)(0<= Tsf)

ReturnValue

Description

0

Setting Success

Negative value

Setting Failure

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error

DR_Error(DR_ERROR_VALUE)

Invalid parameter value

DR_Error(DR_ERROR_RUNTIME)C Extension module error

DR_Error(DR_ERROR_STOP)

Program terminated forcibly- 536 -

Programming manual(V2.10)

Application Commands

Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

app_weld_enable_analog(ch_v_out=[1,1], spec_v_out=[0,0,300,10], ch_f_out =[2,,spec_f_out =[0,0,40,10], ch_v_in =[1,1], spec_v_in =[0,0,300,10], ch_c_in=[2,1],
spec_c_in=[0,0,40,10], ch_arc_on=1, ch_gas_on=2, ch_inching_fwd=3,
ch_inching_bwd=4, ch_blow_out=5)

app_weld_set_weld_cond_analog(flag_dry_run=1, v_target=24, f_target=20,
vel_target=60, vel_min=10,
vel_max=100, weld_proc_param=[0.2,0.2,0.5,0.5,0.5,0.2,0.2,0.5,0.5])# Target Voltage/Feeding Speed = 24 V, 20 m/min, Welding Speed=60 mm/sec(=1 cm/min), Actual Welding, Use Default Welding Parameterapp_weld_disable_analog()

Related commands• app_weld_enable_analog(ch_v_out=[1,0], spec_v_out=[0,0,0,0], ch_f_out=[2,0], spec_f_out=[0,0,0,0],ch_v_in=[1,0], spec_v_in=[0,0,0,0], ch_c_in=[2,0],
spec_c_in=[0,0,0,0],ch_arc_on=1,ch_gas_on=2,ch_inching_fwd=3,ch_inching_bwd=4, ...)(p. 527)
• app_weld_set_weld_cond_analog(flag_dry_run=0, v_target=0, f_target=0, vel_target=0, vel_min=0,
vel_max=0, weld_proc_param=[0.2,0.2,0.5,0.5,0.5,0.2,0.2,0.5,0.5])(p. 534)
• app_weld_weave_cond_trapezoidal(wv_offset=[0,0], wv_ang=0,
wv_param=[0,1.5,0,-1.5,0.3,0.1,0.3,0.3,0.1,0.3])(p. 544)
• app_weld_weave_cond_zigzag(wv_offset=[0,0], wv_ang=0, wv_param=[3,0.6])(p. 547)
• app_weld_weave_cond_circular(wv_offset=[0,0], wv_ang=0, wv_param=[3,3,0.3,0.3])(p. 549)
• app_weld_weave_cond_sinusoidal(wv_offset=[0,0], wv_ang=0, wv_param=[3,0.6])(p. 551)
• app_weld_adj_welding_cond_analog(flag_reset=0, v_target=None, f_target=None, vel_target=None,
wv_offset=None, wv_width_ratio=None)(p. 538)
• app_weld_get_welding_cond_analog()(p. 541)
• app_weld_weave_cond_trapezoidal(wv_offset=[0,0], wv_ang=0,
wv_param=[0,1.5,0,-1.5,0.3,0.1,0.3,0.3,0.1,0.3])(p. 544)
• app_weld_weave_cond_zigzag(wv_offset=[0,0], wv_ang=0, wv_param=[3,0.6])(p. 547)
• app_weld_weave_cond_circular(wv_offset=[0,0], wv_ang=0, wv_param=[3,3,0.3,0.3])(p. 549)
• app_weld_weave_cond_sinusoidal(wv_offset=[0,0], wv_ang=0, wv_param=[3,0.6])(p. 551)

- 537 -

Programming manual(V2.10)

Application Commands

12.3.17 app_weld_adj_welding_cond_analog(flag_reset=0, v_target=None,f_target=None, vel_target=None, wv_offset=None,
wv_width_ratio=None)
FeaturesThis adjusts the welding condition and weaving condition during analog welding. It is used to change thewelding condition of each section in a series of sections before calling the motion command (movel(), movec(),
moveb(), movesx()). If an adjustment factor is entered using this command, the corresponding welding
condition and weaving condition are adjusted, and real-time adjustment of the welding/weaving condition
from the welding monitoring information screen of the TP becomes unavailable. Execute flag_reset=1 to reset
the adjusted condition to the main condition set using app_weld_set_weld_cond_analog() and
app_weld_weave_cond_trapezoidal(). Setting flag_reset=1 will reset to the final condition adjusted in real-timeusing the TP (the weaving width ratio (wv_width_ratio), which cannot be adjusted in real-time, is changed to 1),
and the welding condition can be adjusted in real-time from the TP.

Parameter
Parameter Name

Data TypeDefault
Value

Description

flag_resetint

0

0: Apply Adjustment
1: Default Target (app_weld_set_weld_cond_analog())
Apply Valuev_targetfloat-

Target Voltage (V)f_targetfloat-

Feeding Speed (m/min))vel_target

float

-

Target Speed (mm/sec)• Take note that the unit is different from that of
the teaching pendant input (cm/min)

wv_offset

wv_width_ratio

float[2]float-

Weaving Coordinate-Y Direction Offset (mm)-Weaving Coordinate-Z Direction Offset (mm)-Changed Weaving Width/Set Weaving Width Ratio (0-2)

Note- 538 -

Programming manual(V2.10)

Application Commands

Conditions which do not designate a value in factors v_target/f_target/vel_target/wv_offset/
wv_width_ratio will maintain the current condition (including conditions with real-time adjustments), so
only set factors that require adjustment. However, in the case of wv_offset, even if an adjustment ismade only to the Y direction or Z direction, values for both sequences must be entered.

ReturnValue

Description

0

Setting Success

Negative value

Setting Failure

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error

DR_Error(DR_ERROR_VALUE)

Invalid parameter value

DR_Error(DR_ERROR_RUNTIME)C Extension module error

DR_Error(DR_ERROR_STOP)

Program terminated forcibly

Example
1
2
3
4
5
6
7
8
9
10
11
12

movej(posj(0,0,90,0,90,0),v=30,a=60)

pt1= posx(559, 434.5, 651.5, 45, 180, 45)
pt2= posx(559, 434.5, 151.5, 45, 180, 45)
pt3= posx(559, 0.0, 151.5, 45, 180, 45)- 539 -

Programming manual(V2.10)

Application Commands

13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47

app_weld_enable_analog(ch_v_out=[1,1], spec_v_out=[0,0,300,10], ch_f_out =[2,,spec_f_out =[0,0,40,10], ch_v_in =[1,1], spec_v_in =[0,0,300,10], ch_c_in=[2,1],
spec_c_in=[0,0,40,10], ch_arc_on=1, ch_gas_on=2, ch_inching_fwd=3,
ch_inching_bwd=4, ch_blow_out=5)

app_weld_set_weld_cond_analog(flag_dry_run=1, v_target=24, f_target=20,
vel_target=60, vel_min=10,
vel_max=100, weld_proc_param=[0.2,0.2,0.5,0.5,0.5,0.2,0.2,0.5,0.5])

movel(pt1, v=5, a=5, r=30, app_type=DR_MV_APP_WELD)
app_weld_adj_welding_cond_analog(flag_reset=0, v_target=20, f_target=10,
vel_target=30, wv_offset=[20,10], wv_width_ratio=0.5)
movel(pt2, v=5, a=5, r=30, app_type=DR_MV_APP_WELD)
app_weld_adj_welding_cond_analog(flag_reset=1)
movel(pt3, v=5, a=5, app_type=DR_MV_APP_WELD)# Start Point → pt1: Apply Origin Welding Condition (24V, 20 m/min)# pt1 → pt2: Apply Adjusted Condition (20 V, 10 m/min)# pt2 → pt3: Apply Origin Condition (24 V, 20 m/min)

app_weld_disable_analog()

Related commands• app_weld_enable_analog(ch_v_out=[1,0], spec_v_out=[0,0,0,0], ch_f_out=[2,0], spec_f_out=[0,0,0,0],ch_v_in=[1,0], spec_v_in=[0,0,0,0], ch_c_in=[2,0],
spec_c_in=[0,0,0,0],ch_arc_on=1,ch_gas_on=2,ch_inching_fwd=3,ch_inching_bwd=4, ...)(p. 527)
• app_weld_set_weld_cond_analog(flag_dry_run=0, v_target=0, f_target=0, vel_target=0, vel_min=0,
vel_max=0, weld_proc_param=[0.2,0.2,0.5,0.5,0.5,0.2,0.2,0.5,0.5])(p. 534)
• app_weld_weave_cond_trapezoidal(wv_offset=[0,0], wv_ang=0,
wv_param=[0,1.5,0,-1.5,0.3,0.1,0.3,0.3,0.1,0.3])(p. 544)
• app_weld_weave_cond_zigzag(wv_offset=[0,0], wv_ang=0, wv_param=[3,0.6])(p. 547)
• app_weld_weave_cond_circular(wv_offset=[0,0], wv_ang=0, wv_param=[3,3,0.3,0.3])(p. 549)

- 540 -

Programming manual(V2.10)

Application Commands• app_weld_weave_cond_sinusoidal(wv_offset=[0,0], wv_ang=0, wv_param=[3,0.6])(p. 551)
• app_weld_adj_welding_cond_analog(flag_reset=0, v_target=None, f_target=None, vel_target=None,
wv_offset=None, wv_width_ratio=None)(p. 538)
• app_weld_get_welding_cond_analog()(p. 541)
• app_weld_weave_cond_trapezoidal(wv_offset=[0,0], wv_ang=0,
wv_param=[0,1.5,0,-1.5,0.3,0.1,0.3,0.3,0.1,0.3])(p. 544)
• app_weld_weave_cond_zigzag(wv_offset=[0,0], wv_ang=0, wv_param=[3,0.6])(p. 547)
• app_weld_weave_cond_circular(wv_offset=[0,0], wv_ang=0, wv_param=[3,3,0.3,0.3])(p. 549)
• app_weld_weave_cond_sinusoidal(wv_offset=[0,0], wv_ang=0, wv_param=[3,0.6])(p. 551)
• movel()(p. 59)• amovel()(p. 98)• movec()(p. 68)• amovec()(p. 104)• moveb()(p. 81)• amoveb()(p. 114)
• movesx()(p. 77)• amovesx()(p. 111)12.3.18 app_weld_get_welding_cond_analog()
FeaturesThis monitors the welding status during analog welding. Values available for monitoring are the current target
voltage/current/speed/weaving offset/digital output signal and measured voltage/current and welding status. If
measured voltage/current is not set (if ch_v_in and ch_c_in are not set during app_weld_enable()), the outputof the corresponding values are set equal to the target voltage (v_target)/current (c_target). In addition, it ispossible to check the fail status using the welding status factor.

Parameter
Parameter Name

Data TypeDefault
Value

Description

ReturnValue

Description

v_targetCurrent Target Voltage (V) (target with adjustment applied)c_targetCurrent Target Current (A) (target with adjustment applied)- 541 -

Programming manual(V2.10)

Application Commands

Value

Description

f_targetCurrent Target Feeding Speed (m/min) (target with adjustment applied)

vel_target

Current Target Speed (mm/sec) (target with adjustment applied)* Take note that the unit is different from that of the monitoring output unit (cm/min)of the teaching pendantv_measCurrent Measured Voltage (V)c_measCurrent Measured Current (A)wv_offset[2]Current Target Offset (Y and Z directions, mm) (target with adjustment applied)

sig_out[4]Digital Output Signal (arc_on, gas_on, inching_fwd, inching_bwd)

statusNon-weld:0, Weld (Normal): 1, Weld (Abnormal): 9, Dry-run: 99

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error

DR_Error(DR_ERROR_VALUE)

Invalid parameter value

DR_Error(DR_ERROR_RUNTIME)C Extension module error

DR_Error(DR_ERROR_STOP)

Program terminated forcibly

Example1
2
3
4
5

movej(posj(0,0,90,0,90,0),v=30,a=60)

pt1= posx(559, 434.5, 651.5, 45, 180, 45)- 542 -

Programming manual(V2.10)

Application Commands

6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54

pt2= posx(559, 434.5, 151.5, 45, 180, 45)
pt3= posx(559, 0.0, 151.5, 45, 180, 45)

app_weld_enable_analog(ch_v_out=[1,1], spec_v_out=[0,0,300,10], ch_f_out =[2,,spec_f_out =[0,0,40,10], ch_v_in =[1,1], spec_v_in =[0,0,300,10], ch_c_in=[2,1],
spec_c_in=[0,0,40,10], ch_arc_on=1, ch_gas_on=2, ch_inching_fwd=3,
ch_inching_bwd=4, ch_blow_out=5)

app_weld_set_weld_cond_analog(flag_dry_run=1, v_target=24, f_target=20,
vel_target=60, vel_min=10,
vel_max=100, weld_proc_param=[0.2,0.2,0.5,0.5,0.5,0.2,0.2,0.5,0.5])

movel(pt1, v=5, a=5, r=30, app_type=DR_MV_APP_WELD)
app_weld_adj_welding_cond_analog(flag_reset=0, v_target=20, f_target=10,
vel_target=30, wv_offset=[20,10], wv_width_ratio=0.5)
movel(pt2, v=5, a=5, r=30, app_type=DR_MV_APP_WELD)
app_weld_adj_welding_cond_analog(flag_reset=1)
amovel(pt3, v=5, a=5, app_type=DR_MV_APP_WELD)

while True:
Vt, Ct, Ft, velt, Vm, Cm, Off, Dout, status =app_weld_get_welding_cond_analog()
if status == 9:
tp_popup("welding error!! ", DR_PM_ALARM, 1)# An alarm is generated if abnormal welding occurs (status=9)
else :
if check_motion()==0:- 543 -

Programming manual(V2.10)

Application Commands

55
56
57
58
59

break

app_weld_disable_analog()

Related commands• app_weld_enable_analog(ch_v_out=[1,0], spec_v_out=[0,0,0,0], ch_f_out=[2,0], spec_f_out=[0,0,0,0],ch_v_in=[1,0], spec_v_in=[0,0,0,0], ch_c_in=[2,0],
spec_c_in=[0,0,0,0],ch_arc_on=1,ch_gas_on=2,ch_inching_fwd=3,ch_inching_bwd=4, ...)(p. 527)
• app_weld_set_weld_cond_analog(flag_dry_run=0, v_target=0, f_target=0, vel_target=0, vel_min=0,
vel_max=0, weld_proc_param=[0.2,0.2,0.5,0.5,0.5,0.2,0.2,0.5,0.5])(p. 534)
• app_weld_weave_cond_trapezoidal(wv_offset=[0,0], wv_ang=0,
wv_param=[0,1.5,0,-1.5,0.3,0.1,0.3,0.3,0.1,0.3])(p. 544)
• app_weld_weave_cond_zigzag(wv_offset=[0,0], wv_ang=0, wv_param=[3,0.6])(p. 547)
• app_weld_weave_cond_circular(wv_offset=[0,0], wv_ang=0, wv_param=[3,3,0.3,0.3])(p. 549)
• app_weld_weave_cond_sinusoidal(wv_offset=[0,0], wv_ang=0, wv_param=[3,0.6])(p. 551)
• app_weld_adj_welding_cond_analog(flag_reset=0, v_target=None, f_target=None, vel_target=None,
wv_offset=None, wv_width_ratio=None)(p. 538)
• app_weld_get_welding_cond_analog()(p. 541)
• app_weld_weave_cond_trapezoidal(wv_offset=[0,0], wv_ang=0,
wv_param=[0,1.5,0,-1.5,0.3,0.1,0.3,0.3,0.1,0.3])(p. 544)
• app_weld_weave_cond_zigzag(wv_offset=[0,0], wv_ang=0, wv_param=[3,0.6])(p. 547)
• app_weld_weave_cond_circular(wv_offset=[0,0], wv_ang=0, wv_param=[3,3,0.3,0.3])(p. 549)
• app_weld_weave_cond_sinusoidal(wv_offset=[0,0], wv_ang=0, wv_param=[3,0.6])(p. 551)

12.3.19 app_weld_weave_cond_trapezoidal(wv_offset=[0,0], wv_ang=0,
wv_param=[0,1.5,0,-1.5,0.3,0.1,0.3,0.3,0.1,0.3])
FeaturesThis sets the trapezoidal weaving condition. It is only valid within the welding section defined with the EnableWelding (app_weld_enable_analog()) and Disable Welding (app_weld_disable_analog()/
app_weld_disable_digital()) commands, and any operations starting at a point outside the welding section will
generate an error. The weaving condition is defined by the weaving coordinates, which are defined with the TCP
direction from the weaving x-axis as the weaving z-axis, and the vector-multiplied (cross product) direction as
the weaving y-axis with the welding path direction as the weaving x-axis. Refer to the figure below for thecoordinates and weaving setting factor. Only one weaving condition is allowed in a single welding section. The
offset or weaving width can be adjusted during welding with the app_weld_adj_welding_cond_analog()/
app_weld_set_weld_cond_digital() command or the voltage/current/speed and the offset can be adjusted fromthe Welding Condition Adjustment popup of the teaching pendant. However, from the teaching pendant,
welding condition adjustments are only available if the welding condition adjustment status is set to RESET- 544 -

Programming manual(V2.10)

Application Commands

using a command (the welding condition setting is designated with app_weld_set_weld_cond_analog()/
app_weld_set_weld_cond_digital()).

Parameter
Parameter
Name

Data TypeDefault
Value

Description

wv_offset

float[2]0Weaving Coordinate-Y Direction Offset (mm)0

Weaving Coordinate-Z Direction Offset (mm)wv_angle

float

0

Weaving Coordinate-Weaving Plane Tile Angle centering on X-Axis(deg)

wv_paramlist(float[10])0Weaving Point 1-x (mm)1.5

Weaving Point 1-y (mm)0

Weaving Point 2-x (mm)-1.5

Weaving Point 2-y (mm)0.3

Weaving Point 1→2 hrs (sec)

0.1

Weaving Point 1→2 Dec/Acc Time (sec)

0.3

Weaving Point 1 Dwell Time (sec)

0.3

Weaving Point 2→1 hr (sec)

0.1

Weaving Point 2→1 Dec/Acc Time (sec)- 545 -

Programming manual(V2.10)

Application Commands

Parameter
Name

Data TypeDefault
Value

Description

0.3

Weaving Point 2 Dwell Time (sec)ReturnValue

Description

0

Setting Success

Negative value

Setting Failure

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error

DR_Error(DR_ERROR_VALUE)

Invalid parameter value

DR_Error(DR_ERROR_RUNTIME)C Extension module error

DR_Error(DR_ERROR_STOP)

Program terminated forcibly

Example
1
2
3
4
5
6
7

app_weld_enable_analog(ch_v_out=[1,1], spec_v_out=[0,0,300,10], ch_f_out =[2,,spec_f_out =[0,0,40,10], ch_v_in =[1,1], spec_v_in =[0,0,300,10], ch_c_in=[2,1],
spec_c_in=[0,0,40,10], ch_arc_on=1, ch_gas_on=2, ch_inching_fwd=3,
ch_inching_bwd=4, ch_blow_out=5)
app_weld_set_weld_cond_analog(flag_dry_run=1, v_target=200, f_target=150,
vel_target=10, vel_min=10,
vel_max=100, weld_proc_param=[0.5,0.3,2,1,0.7,0.4,0.7,0.6,1.5])- 546 -

Programming manual(V2.10)

Application Commands

8
9
10

11

app_weld_weave_cond_trapezoidal(wv_offset=[0,0], wv_ang=0, wv_param=[0,5,0,-5.7,0.2,0.5,0.7,0.2,0.5])# Trapezoidal Weaving Pattern, Offset=0,0, Tilt Angle=0, Weaving Point
1=(0,5), Weaving Point 2=(0,-5), Weaving Time=0.7 (sec) (same in both
directions), Weaving Dec/Acc Time=0.2 (sec) (same in both directions),
Weaving Point 1 Dwell Time=0.5 sec, Weaving Point 2 Dwell Time=0.5 sec
app_weld_disable_analog ()12.3.20 app_weld_weave_cond_zigzag(wv_offset=[0,0], wv_ang=0,
wv_param=[3,0.6])
FeaturesThis sets the zigzag weaving condition. It is only valid within the welding section defined with the EnableWelding (app_weld_enable_analog()) and Disable Welding (app_weld_disable_analog()/
app_weld_disable_digital()) commands, and any operations starting at a point outside the welding section will
generate an error. The weaving condition is defined by the weaving coordinates, which are defined with the TCP
direction from the weaving x-axis as the weaving z-axis, and the vector-multiplied (cross product) direction as
the weaving y-axis with the welding path direction as the weaving x-axis. Refer to the figure below for thecoordinates and weaving setting factor. Only one weaving condition is allowed in a single welding section. The
offset or weaving width can be adjusted during welding with the app_weld_adj_welding_cond_analog()/
app_weld_set_weld_cond_digital() command or the voltage/current/speed and the offset can be adjusted fromthe Welding Condition Adjustment popup of the teaching pendant. However, from the teaching pendant,
welding condition adjustments are only available if the welding condition adjustment status is set to RESET
using a command (the welding condition setting is designated with app_weld_set_weld_cond_analog()/
app_weld_set_weld_cond_digital()).

Parameter
Parameter Name

Data TypeDefault
Value

Description

wv_offset

float[2]0Weaving Coordinate-Y Direction Offset (mm)

- 547 -

Programming manual(V2.10)

Application Commands

Parameter Name

Data TypeDefault
Value

Description

0

Weaving Coordinate-Z Direction Offset (mm)wv_angle

float

0

Weaving Coordinate-Weaving Plane Tile Angle centeringon X-Axis (deg)wv_paramlist(float[2])3Weaving Width (mm)0.6

Weaving Period (sec)ReturnValue

Description

0

Setting Success

Negative value

Setting Failure

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error

DR_Error(DR_ERROR_VALUE)

Invalid parameter value

DR_Error(DR_ERROR_RUNTIME)C Extension module error

DR_Error(DR_ERROR_STOP)

Program terminated forcibly

Example1

app_weld_enable_analog(ch_v_out=[1,1], spec_v_out=[0,0,300,10], ch_f_out =[2,,2- 548 -

Programming manual(V2.10)

Application Commands

3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

spec_f_out =[0,0,40,10], ch_v_in =[1,1], spec_v_in =[0,0,300,10], ch_c_in=[2,1],
spec_c_in=[0,0,40,10], ch_arc_on=1, ch_gas_on=2, ch_inching_fwd=3,
ch_inching_bwd=4, ch_blow_out=5)

app_weld_set_weld_cond_analog(flag_dry_run=1, v_target=200, f_target=150,
vel_target=10, vel_min=10,
vel_max=100, weld_proc_param=[0.5,0.3,2,1,0.7,0.4,0.7,0.6,1.5])

app_weld_weave_cond_zigzag(wv_offset=[0,0], wv_ang=0, wv_param=[10,0.5])# Zigzag Weaving Pattern, Offset=0,0 Tilt Angle=0, Weaving Width=10 (mm),Weaving Period=0.5 (sec)app_weld_disable_analog()

12.3.21 app_weld_weave_cond_circular(wv_offset=[0,0], wv_ang=0,
wv_param=[3,3,0.3,0.3])
FeaturesThis sets the circular weaving condition. It is only valid within the welding section defined with the EnableWelding (app_weld_enable_analog()) and Disable Welding (app_weld_disable_analog()/
app_weld_disable_digital()) commands, and any operations starting at a point outside the welding section will
generate an error. The weaving condition is defined by the weaving coordinates, which are defined with the TCP
direction from the weaving x-axis as the weaving z-axis, and the vector-multiplied (cross product) direction as
the weaving y-axis with the welding path direction as the weaving x-axis. Refer to the figure below for thecoordinates and weaving setting factor. Only one weaving condition is allowed in a single welding section. The
offset or weaving width can be adjusted during welding with the app_weld_adj_welding_cond_analog()/
app_weld_set_weld_cond_digital() command or the voltage/current/speed and the offset can be adjusted fromthe Welding Condition Adjustment popup of the teaching pendant. However, from the teaching pendant,
welding condition adjustments are only available if the welding condition adjustment status is set to RESET
using a command (the welding condition setting is designated with app_weld_set_weld_cond_analog()/
app_weld_set_weld_cond_digital()).

- 549 -

Programming manual(V2.10)

Application Commands

Parameter
Parameter Name

Data TypeDefault
Value

Description

wv_offset

float[2]0Weaving Coordinate-Y Direction Offset (mm)0

Weaving Coordinate-Z Direction Offset (mm)wv_angle

float

0

Weaving Coordinate-Weaving Plane Tile Angle centeringon X-Axis (deg)wv_paramlist(float[4])3

X Direction Weaving Width (mm)3

Y Direction Weaving Width (mm)0.3

X Direction Weaving Period (sec)

0.3

Y Direction Weaving Period (sec)ReturnValue

Description

0

Setting Success

Negative value

Setting Failure- 550 -

Programming manual(V2.10)

Application Commands

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error

DR_Error(DR_ERROR_VALUE)

Invalid parameter value

DR_Error(DR_ERROR_RUNTIME)C Extension module error

DR_Error(DR_ERROR_STOP)

Program terminated forcibly

Example
1
2
3
4
5
6
7
8
9

10

app_weld_enable_analog(ch_v_out=[1,1], spec_v_out=[0,0,300,10], ch_f_out =[2,,spec_f_out =[0,0,40,10], ch_v_in =[1,1], spec_v_in =[0,0,300,10], ch_c_in=[2,1],
spec_c_in=[0,0,40,10], ch_arc_on=1, ch_gas_on=2, ch_inching_fwd=3,
ch_inching_bwd=4, ch_blow_out=5)
app_weld_set_weld_cond_analog(flag_dry_run=1, v_target=200, f_target=150,
vel_target=10, vel_min=10,
vel_max=100, weld_proc_param=[0.5,0.3,2,1,0.7,0.4,0.7,0.6,1.5])
app_weld_weave_cond_circular(wv_offset=[0,0], wv_ang=0, wv_param=[3,3,0.3,0.3])# Circular Weaving Pattern, Offset=0,0 Tilt Angle=0, X Direction Weaving
Width=3 (mm), Y Direction Weaving=3 (mm), X Direction Weaving Period=0.3(s), Y Direction Weaving Period=0.3 (s)app_weld_disable_analog()

12.3.22 app_weld_weave_cond_sinusoidal(wv_offset=[0,0], wv_ang=0,
wv_param=[3,0.6])
FeaturesThis sets the sinusoidal weaving condition. It is only valid within the welding section defined with the EnableWelding (app_weld_enable_analog()) and Disable Welding (app_weld_disable_analog()/
app_weld_disable_digital()) commands, and any operations starting at a point outside the welding section will

- 551 -

Programming manual(V2.10)

Application Commands

generate an error. The weaving condition is defined by the weaving coordinates, which are defined with the TCP
direction from the weaving x-axis as the weaving z-axis, and the vector-multiplied (cross product) direction as
the weaving y-axis with the welding path direction as the weaving x-axis. Refer to the figure below for thecoordinates and weaving setting factor. Only one weaving condition is allowed in a single welding section. The
offset or weaving width can be adjusted during welding with the app_weld_adj_welding_cond_analog()/
app_weld_set_weld_cond_digital() command or the voltage/current/speed and the offset can be adjusted fromthe Welding Condition Adjustment popup of the teaching pendant. However, from the teaching pendant,
welding condition adjustments are only available if the welding condition adjustment status is set to RESET
using a command (the welding condition setting is designated with app_weld_set_weld_cond_analog()/
app_weld_set_weld_cond_digital()).

Parameter
Parameter Name

Data TypeDefault
Value

Description

wv_offset

float[2]0Weaving Coordinate-Y Direction Offset (mm)0

Weaving Coordinate-Z Direction Offset (mm)wv_angle

float

0

Weaving Coordinate-Weaving Plane Tile Angle centeringon X-Axis (deg)wv_paramlist(float[2])3Weaving Width (mm)0.6

Weaving Period (sec)ReturnValue

Description

0

Setting Success- 552 -

Programming manual(V2.10)

Application Commands

Value

Description

Negative value

Setting Failure

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data error

DR_Error(DR_ERROR_VALUE)

Invalid parameter value

DR_Error(DR_ERROR_RUNTIME)C Extension module error

DR_Error(DR_ERROR_STOP)

Program terminated forcibly

Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

app_weld_enable_analog(ch_v_out=[1,1], spec_v_out=[0,0,300,10], ch_f_out =[2,,spec_f_out =[0,0,40,10], ch_v_in =[1,1], spec_v_in =[0,0,300,10], ch_c_in=[2,1],
spec_c_in=[0,0,40,10], ch_arc_on=1, ch_gas_on=2, ch_inching_fwd=3,
ch_inching_bwd=4, ch_blow_out=5)

app_weld_set_weld_cond_analog(flag_dry_run=1, v_target=200, f_target=150,
vel_target=10, vel_min=10,
vel_max=100, weld_proc_param=[0.5,0.3,2,1,0.7,0.4,0.7,0.6,1.5])

app_weld_weave_cond_sinusoidal(wv_offset=[0,0], wv_ang=0, wv_param=[10,0.5])# Sinusoidal Weaving Pattern, Offset=0,0 Tilt Angle=0, Weaving Width=10(mm), Weaving Period=0.5 (s)- 553 -

Programming manual(V2.10)

Application Commands

18
19

app_weld_disable_analog()- 554 -

Programming manual(V2.10)

A-Series Command

13 A-Series Command
13.1 Controller
13.1.1 get_function_input(index)
FeaturesThis function reads a state of the function button from the process button device.

Parameters
Parameter Name

Data TypeDefault
Value

Description

index

int

-

It is the index of the function button mounted on theprocess button to be read. It is available 1 to 4.

ReturnValue

Description

1

ON

0

OFF

Negative value

FailedException
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred- 555 -

Programming manual(V2.10)

A-Series Command

Exception

Description

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

Example12

in1 = get_function_input(1)input
in8 = get_function input(4)input# Reads the no. 1 function button# Reads the no. 4 function button

13.2 Flange I/O
13.2.1 flange_serial_open(baudrate=115200, bytesize=DR_EIGHTBITS,
parity=DR_PARITY_NONE, stopbits = DR_STOPBITS_ONE)
FeaturesA command used for opening the Pseudo Flange Serial communication port.
The characteristics of pseudo flange serial communication are different from normal serial communication.
Therefore, handshaking communication is recommended. (e.g., modbus RTU) Due to the internal buffer size
limit (255bytes) and internal delay, overflow may occur when used in sensors, etc.

Parameters
Parameter Name

Data TypeDefault
Value

Description

baudrate

int

115200

Baud rate
2400, 4800, 9600, 19200, 38400, 57600, 115200 etc

bytesize

int8

Number of data bits
• DR_FIVEBITS : 5• DR_SIXBITS : 6• DR_SEVENBITS : 7• DR_EIGHTBITS : 8- 556 -

Programming manual(V2.10)

A-Series Command

Parameter Name

Data TypeDefault
Value

Description

paritystr"N"

Parity checking• DR_PARITY_NONE: "N"• DR_PARITY_EVEN: "E"• DR_PARITY_ODD: "O"

stopbits

int1

Number of stop bits
• DR_STOPBITS_ONE =1• DR_STOPBITS_TWO = 2

ReturnValue

Description0

Successful connection

Negative value

Fail to connection

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

13.2.2 flange_serial_close()
FeaturesThis function closes a flange serial communication port.

- 557 -

Programming manual(V2.10)

A-Series Command

ReturnValue

Description0

Success

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

13.2.3 flange_serial_write(tx_data)
FeaturesThis function records the data (data) to a flange serial port.

Parameters
Parameter Name

Data TypeDefault
Value

Description

tx_databyte-

Data to be transmitted (max 32byte)• The data type must be a byte.
• Refer to the example below.

ReturnValue

Description0

Success- 558 -

Programming manual(V2.10)

A-Series Command

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_VALUE)

Parameter value is invalid

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

13.2.4 flange_serial_read(timeout=None)
FeaturesThis function reads the data from a flange serial port.

ReturnValue

Description

res

Number of bytes of the received data

rx_data

Number of bytes read (byte type)

Exception
Exception

Description

DR_Error(DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error(DR_ERROR_RUNTIM
E)

C extension module error occurred- 559 -

Programming manual(V2.10)

A-Series Command

Exception

Description

DR_Error(DR_ERROR_STOP)

Program terminated forcefully

13.2.5 Integrated example - A-Series Command
This example controls robotiq 2f using Pseudo Flange Serial.

Example : robotiq 2f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

Def recv_data():Res, data = flange_serial_read(3) #timeout 3s
If res == -1:#Exception Handling Required
tp_log(“Response time out!!”)elif res == -2#Exception Handling Required
tp_log(“Buffer Overflow!!”)else :
if Modbus_recv_check(data) == True:
tp_log(“recv size [“+str(res)+”] :” +str(data))
else#Exception Handling Required
tp_log(“CRC Check Fail!!”)flange_serial_open(baudrate=115200, bytesize=DR_EIGHTBITS, parity=DR_PARIT
Y_NONE, stopbits = DR_STOPBITS_ONE)wait(0.1)#Step1:Activation Request(clear Act)
flange_serial_write(modbus_send_make(b"\x09\x10\x03\xE8\x00\x03\x06\x00\x00\x00\x00\x00\x00"))
res, data = flange_serial_read()#Step1:Activation Request(set Act)
flange_serial_write(modbus_send_make(b"\x09\x10\x03\xE8\x00\x03\x06\x01\x00\x00\x00\x00\x00"))
res, data = flange_serial_read()#Step 2: Read Gripper status until the activation is completed
flange_serial_write(modbus_send_make(b"\x09\x03\x07\xD0\x00\x01"))
res, data = flange_serial_read()#Step 3: Move the robot to the pick-up location
wait(1)#Step 4: Close the Gripper at full speed and full force
flange_serial_write(modbus_send_make(b"\x09\x10\x03\xE8\x00\x03\x06\x09\x00\x00\xFF\xFF\xFF"))- 560 -

Programming manual(V2.10)

A-Series Command

36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53

res, data = flange_serial_read()#Step 5: Read Gripper status until the grasp is completed
flange_serial_write(modbus_send_make(b"\x09\x03\x07\xD0\x00\x03"))
res, data = flange_serial_read()#Step 6: Move the robot to the release location
wait(1)#Step 7: Open the Gripper at full speed and full force
flange_serial_write(modbus_send_make(b"\x09\x10\x03\xE8\x00\x03\x06\x09\x00\x00\x00\xFF\xFF"))res, data = flange_serial_read()#Step 8: Read Gripper status until the opening is completed
flange_serial_write(modbus_send_make(b"\x09\x03\x07\xD0\x00\x03"))
res, data = flange_serial_read()flange_serial_close()- 561 -

Programming manual(V2.10)