[Из песочницы] Runtime программирование промышленного робота на RCML

include "chars.rcml"
function main(){
  try {
//Задействование робота
    @fr = robot_fanuc;
    system.echo("Start move program\n");
//Предварительная настройка окружения робота, координатная система, нагрузка, скорость
    @fr->set_real_di("speed", SPEED);
    @fr->set_real_di("cnt", CNT);
    @fr->startProgram(UFRAME, UTOOL, PAYLOAD);

    system.echo("prepare\n");
    @fr->prepare();
    system.echo("start draw\n");
//Сгенерированный, на Python, участок
    @fr->draw_r_P(0, 0);
    @fr->draw_P(1, 0);
    @fr->draw_r_I(2, 0);
    @fr->draw_B(3, 0);
    @fr->draw_E(4, 0);
    @fr->draw_T(5, 0);
    @fr->draw_Comm(6, 0);

    @fr->draw_r_L(8, 0);
    @fr->draw_r_Yu(9, 0);
    @fr->draw_r_D(10, 0);
    @fr->draw_r_I(11, 0);
    @fr->draw_Exclamation(12, 0);

    @fr->draw_H(14, 0);
    @fr->draw_A(15, 0);
    @fr->draw_M(16, 0);

    @fr->draw_H(18, 0);
    @fr->draw_r_U(19, 0);
    @fr->draw_r_Je(20, 0);
    @fr->draw_E(21, 0);
    @fr->draw_H(22, 0);

    @fr->draw_P(0, 1);
    @fr->draw_A(1, 1);
    @fr->draw_r_Z(2, 1);
    @fr->draw_P(3, 1);
    @fr->draw_A(4, 1);
    @fr->draw_r_B(5, 1);
    @fr->draw_O(6, 1);
    @fr->draw_T(7, 1);
    @fr->draw_r_Che(8, 1);
    @fr->draw_r_I(9, 1);
    @fr->draw_K(10, 1);
    @fr->draw_Dot(11, 1);
    @fr->draw_r_D(12, 1);
    @fr->draw_r_L(13, 1);
    @fr->draw_r_Ya(14, 1);

    @fr->draw_C(16, 1);
    @fr->draw_O(17, 1);
    @fr->draw_r_Z(18, 1);
    @fr->draw_r_D(19, 1);
    @fr->draw_A(20, 1);
    @fr->draw_H(21, 1);
    @fr->draw_r_I(22, 1);
    @fr->draw_r_Ya(23, 1);

    @fr->draw_B(25, 1);
    @fr->draw_E(26, 1);
    @fr->draw_r_B(27, 1);

    @fr->draw_r_I(0, 2);
    @fr->draw_H(1, 2);
    @fr->draw_T(2, 2);
    @fr->draw_E(3, 2);
    @fr->draw_P(4, 2);
    @fr->draw_r_F(5, 2);
    @fr->draw_E(6, 2);
    @fr->draw_r_Ii(7, 2);
    @fr->draw_C(8, 2);
    @fr->draw_A(9, 2);

    @fr->draw_C(11, 2);
    @fr->draw_r_I(12, 2);
    @fr->draw_C(13, 2);
    @fr->draw_T(14, 2);
    @fr->draw_E(15, 2);
    @fr->draw_M(16, 2);
    @fr->draw_r_y(17, 2);

    @fr->draw_H(19, 2);
    @fr->draw_A(20, 2);
    @fr->draw_r_Sha(21, 2);
    @fr->draw_r_I(22, 2);
    @fr->draw_X(23, 2);

    @fr->draw_r_Z(0, 3);
    @fr->draw_H(1, 3);
    @fr->draw_A(2, 3);
    @fr->draw_H(3, 3);
    @fr->draw_r_I(4, 3);
    @fr->draw_r_Ii(5, 3);
    @fr->draw_Dot(6, 3);

    @fr->draw_T(8, 3);
    @fr->draw_A(9, 3);
    @fr->draw_K(10, 3);

    @fr->draw_M(12, 3);
    @fr->draw_r_y(13, 3);

    @fr->draw_C(15, 3);
    @fr->draw_M(16, 3);
    @fr->draw_O(17, 3);
    @fr->draw_r_Je(18, 3);
    @fr->draw_E(19, 3);
    @fr->draw_M(20, 3);

    @fr->draw_r_P(22, 3);
    @fr->draw_E(23, 3);
    @fr->draw_P(24, 3);
    @fr->draw_E(25, 3);
    @fr->draw_H(26, 3);
    @fr->draw_r_Ya(27, 3);
    @fr->draw_T(28, 3);
    @fr->draw_soft_sign(29, 3);

    @fr->draw_O(0, 4);
    @fr->draw_T(1, 4);

    @fr->draw_B(3, 4);
    @fr->draw_A(4, 4);
    @fr->draw_C(5, 4);

    @fr->draw_r_Ge(7, 4);
    @fr->draw_r_U(8, 4);
    @fr->draw_M(9, 4);
    @fr->draw_A(10, 4);
    @fr->draw_H(11, 4);
    @fr->draw_O(12, 4);
    @fr->draw_r_Ii(13, 4);
    @fr->draw_r_D(14, 4);
    @fr->draw_O(15, 4);
    @fr->draw_B(16, 4);

    @fr->draw_r_Z(18, 4);
    @fr->draw_H(19, 4);
    @fr->draw_A(20, 4);
    @fr->draw_H(21, 4);
    @fr->draw_r_I(22, 4);
    @fr->draw_r_Ya(23, 4);
    @fr->draw_Dot(24, 4);

//Изменение ориентации маркера, чтобы роботу было проще дотянуться до края стола
    @fr->set_real_di("speed", 10); 
    @fr->rotateMarker();
    @fr->set_real_di("speed", SPEED); 

    @fr->draw_r_I(0, 6);

    @fr->draw_H(2, 6);
    @fr->draw_A(3, 6);
    @fr->draw_K(4, 6);
    @fr->draw_O(5, 6);
    @fr->draw_H(6, 6);
    @fr->draw_E(7, 6);
    @fr->draw_r_Ce(8, 6);
    @fr->draw_Minus(9, 6);
    @fr->draw_T(10, 6);
    @fr->draw_O(11, 6);

    @fr->draw_M(13, 6);
    @fr->draw_r_y(14, 6);

    @fr->draw_C(16, 6);
    @fr->draw_M(17, 6);
    @fr->draw_O(18, 6);
    @fr->draw_r_Je(19, 6);
    @fr->draw_E(20, 6);
    @fr->draw_M(21, 6);

    @fr->draw_r_Z(0, 7);
    @fr->draw_A(1, 7);
    @fr->draw_X(2, 7);
    @fr->draw_B(3, 7);
    @fr->draw_A(4, 7);
    @fr->draw_T(5, 7);
    @fr->draw_r_I(6, 7);
    @fr->draw_T(7, 7);
    @fr->draw_soft_sign(8, 7);

    @fr->draw_r_U(10, 7);
    @fr->draw_r_L(11, 7);
    @fr->draw_r_U(12, 7);
    @fr->draw_r_Che(13, 7);
    @fr->draw_r_Sha(14, 7);
    @fr->draw_r_I(15, 7);
    @fr->draw_T(16, 7);
    @fr->draw_soft_sign(17, 7);

    @fr->draw_r_aE(19, 7);
    @fr->draw_T(20, 7);
    @fr->draw_O(21, 7);
    @fr->draw_T(22, 7);

    @fr->draw_M(24, 7);
    @fr->draw_r_I(25, 7);
    @fr->draw_P(26, 7);

    @fr->draw_r_P(0, 9);
    @fr->draw_O(1, 9);
    @fr->draw_r_D(2, 9);
    @fr->draw_P(3, 9);
    @fr->draw_O(4, 9);
    @fr->draw_r_B(5, 9);
    @fr->draw_H(6, 9);
    @fr->draw_E(7, 9);
    @fr->draw_E(8, 9);
    @fr->draw_two_dots(9, 9);

    @fr->draw_H(11, 9);
    @fr->draw_T(12, 9);
    @fr->draw_T(13, 9);
    @fr->draw_P(14, 9);
    @fr->draw_two_dots(15, 9);
    @fr->draw_Slash(16, 9);
    @fr->draw_Slash(17, 9);
    @fr->draw_R(18, 9);
    @fr->draw_O(19, 9);
    @fr->draw_B(20, 9);
    @fr->draw_O(21, 9);
    @fr->draw_T(22, 9);
    @fr->draw_C(23, 9);
    @fr->draw_T(24, 9);
    @fr->draw_Dot(25, 9);
    @fr->draw_C(26, 9);
    @fr->draw_O(27, 9);
    @fr->draw_M(28, 9);
    @fr->draw_Slash(29, 9);
    @fr->draw_H(30, 9);
    @fr->draw_I(31, 9);

    @fr->draw_r_I(2, 10);
    @fr->draw_C(3, 10);
    @fr->draw_K(4, 10);
    @fr->draw_P(5, 10);
    @fr->draw_E(6, 10);
    @fr->draw_H(7, 10);
    @fr->draw_H(8, 10);
    @fr->draw_E(9, 10);

    @fr->draw_B(11, 10);
    @fr->draw_A(12, 10);
    @fr->draw_r_Sha(13, 10);

    @fr->draw_S(15, 10);
    @fr->draw_K(16, 10);
    @fr->draw_Y(17, 10);
    @fr->draw_N(18, 10);
    @fr->draw_E(19, 10);
    @fr->draw_T(20, 10);

    @fr->draw_Equal(22, 10);
    @fr->draw_Roof(23, 10);
    @fr->draw_Minus(24, 10);
    @fr->draw_Roof(25, 10);
    @fr->draw_Equal(26, 10);
// Конец сгенерированного участка
    @fr->stopProgram();
    @fr->go_home();
  } catch(E){
    system.echo("Exception catched!");
    return E;
  }
  return 0;
}


© Habrahabr.ru