Skip to content

5.外部제어与통신방식

디렉터리


원격프로그램설정

원격 모드연결상태

조회 Modbus、外部 IO 연결상태

명령어: 0x5032 REMOTE_CONNECT_INQUIRE

요청包体:

json
{}

반환연결상태

명령어: 0x5033 REMOTE_CONNECT_RESPOND

응답包体:

json
{
  "ModbusConnect": false,
  "ExternIOConnect": true,
  "type": 2
}
매개변수유형설명
ModbusConnectboolModbus 연결상태:false 미연결,true 已연결
ExternIOConnectbool外部 IO 연결상태:false 미연결,true 已연결
typeint연결유형:0:NAN, 1:RTU, 2:TCP

원격작업파일설정

설정원격작업파일

명령어: 0x2C01 REMOTE_JOBFILE_SET

매개변수유형설명
robotint로봇번호
jobFilearray작업파일열테이블

jobFile 배열요소:

매개변수유형설명
namestring작업파일이름
timesint실행회수

요청包体:

json
{
  "robot": 1,
  "jobFile": [
    {"name": "Q1", "times": 1},
    {"name": "Q2", "times": 1},
    {"name": "Q3", "times": 1},
    {"name": "Q4", "times": 1},
    {"name": "Q5", "times": 1}
  ]
}

最多 10 번째작업파일

가져오기원격작업파일

명령어: 0x2C02 REMOTE_JOBFILE_INQUIRE

요청包体:

json
{
  "robot": 1
}

반환작업파일조회결과

명령어: 0x2C03 REMOTE_JOBFILE_RESPOND

응답包体:

json
{
  "robot": 1,
  "jobFile": [
    {"name": "Q1", "times": 3},
    {"name": "Q2", "times": 3},
    {"name": "", "times": 1},
    {"name": "Q4", "times": 2},
    {"name": "", "times": 1}
  ]
}

원격 모드매개변수설정

설정원격 모드매개변수

명령어: 0x2C04 REMOTE_PARA_SET

매개변수유형설명
robotint로봇번호
remoteDefaultSpeedint원격 모드속도,범위 1~100
reserveIsStartint예약并시작:1 시작,0 닫기
reserveTrgTimeint确认시작시간,범위 200~1000ms
waitingTimeintIO 重复触发시간

요청包体:

json
{
  "robot": 1,
  "remoteDefaultSpeed": 15,
  "reserveIsStart": 1,
  "reserveTrgTime": 200,
  "waitingTime": 500
}

조회원격 모드매개변수

명령어: 0x2C05 REMOTE_PARA_INQUIRE

요청包体:

json
{
  "robot": 1
}

반환원격 모드매개변수조회결과

명령어: 0x2C06 REMOTE_PARA_RESPOND

응답包体:

json
{
  "robot": 1,
  "remoteDefaultSpeed": 15,
  "reserveIsStart": 1,
  "reserveTrgTime": 200,
  "waitingTime": 500
}

Lua프로그램

Lua파일存放在 ~/robot/job/lua 디렉터리内。

업로드파일和查看파일열테이블用 SCP 的방식。

실행프로그램

호스트 컴퓨터 전송: 0x2511

json
{
  "fileName": "xxx.lua"
}

컨트롤러 응답: 0x2512

json
{
  "fileName": "xxx.lua",
  "result": true,
  "error": "오류原因"
}
매개변수유형필수설명
fileNamestringLua파일이름
resultbool실행여부성공
errorstring오류原因,성공时을/를空문자열

정지프로그램

호스트 컴퓨터 전송: 0x2513

json
{
  "fileName": "xxx.lua"
}
매개변수유형필수설명
fileNamestringLua파일이름

현재실행

호스트 컴퓨터 전송: 0x2515

json
{}

컨트롤러응답: 0x2516

json
{
  "fileNames": [
    {
      "fileName": "xxx.lua",
      "status": 1
    }
  ]
}
매개변수유형필수설명
fileNamesarray실행中的파일열테이블
fileNames[].fileNamestringLua파일이름
fileNames[].statusint1-일시정지,2-실행

Modbus

1. 설정 Modbus 프로그램

명령어: 0x5701 EXTERN_PROGRAM_SET

json
{
  "robot": 1,
  "programid": 1,
  "jobname": "xxxx"
}
매개변수이름유형필수설명
robotint로봇 번호,범위 1-4
programidint프로그램 ID,범위 1-300
jobnamestring작업파일이름(아님含后缀)

2. 조회 Modbus 프로그램

명령어: 0x5702 EXTERN_PROGRAM_INQUIRE

json
{
  "robot": 1,
  "startprogramid": 1,
  "num": 10
}
매개변수이름유형필수설명
robotint로봇 번호,범위 1-4
startprogramidint프로그램시작 ID
numint필요가져오기的프로그램번째수,범위 1-10

3. 조회 Modbus 프로그램응답

명령어: 0x5703 EXTERN_PROGRAM_RESPOND

json
{
  "robot": 1,
  "startprogramid": 1,
  "jobnamelist": ["xxx", "", "yyyy"]
}
매개변수이름유형필수설명
robotint로봇 번호,범위 1-4
startprogramidint프로그램시작 ID
jobnamelistarray작업파일이름열테이블,共 10 번째요소,没有则填空문자열

4. 설정컨트롤러的 Modbus 유형

명령어: 0x5711

json
{
  "RTU": {
    "baudrate": 115200,
    "port": 2,
    "slaveId": 1
  },
  "TCP": {
    "IP": "192.168.1.11",
    "port": 502
  },
  "master-slave": 1,
  "scancycle": 100,
  "stoprun": 0,
  "type": "TCP"
}
매개변수分클래스매개변수이름유형필수설명
RTUbaudratestringModbus RTU 통신Baud Rate
RTUportintModbus RTU 통신串口번호
RTUslaveIdintModbus RTU 통신从设备 ID
TCPIPstringModbus TCP 통신서버 IP 주소
TCPportintModbus TCP 통신포트 번호
범용master-slavestring主从모드:0 의미主모드,1 의미从모드
범용scancycleint扫描주기,단위:ms
범용stoprunbool실행정지标志:0 의미미정지,1 의미정지
범용typestring통신유형,선택 RTU 或 TCP

5. 조회컨트롤러的 Modbus 유형

명령어: 0x5712

json
{}

컨트롤러응답 (0x5713):

json
{
  "RTU": {
    "baudrate": 115200,
    "port": 2,
    "slaveId": 1
  },
  "TCP": {
    "IP": "192.168.1.11",
    "port": 502
  },
  "enable": true,
  "master-slave": 1,
  "scancycle": 100,
  "stoprun": 0,
  "type": "TCP"
}
매개변수分클래스매개변수이름유형필수설명
RTUbaudratestringModbus RTU 통신Baud Rate
RTUportintModbus RTU 통신串口번호
RTUslaveIdintModbus RTU 통신从设备 ID
TCPIPstringModbus TCP 통신서버 IP 주소
TCPportintModbus TCP 통신포트 번호
범용enablebool여부启用 Modbus 통신
범용master-slavestring主从모드:0 의미主모드,1 의미从모드
범용scancycleint扫描주기,단위:ms
범용stoprunbool실행정지标志:0 의미미정지,1 의미정지
범용typestring통신유형,선택 RTU 或 TCP

6. 컨트롤러 Modbus 활성화

명령어: 0x5714

json
{
  "enable": false
}
매개변수이름유형필수설명
enablebool여부启用 Modbus 통신:false 禁用,true 启用

7. 설정 Modbus 하트비트감지

명령어: 0x5715 MODBUS_CHECKHEART_SET

json
{
  "checkheart": true
}
매개변수이름유형필수설명
checkheartboolModbus 하트비트감지스위치

8. 조회 Modbus 하트비트감지

명령어: 0x5716 MODBUS_CHECKHEART_INQUIRE

json
{}

컨트롤러응답 (0x5717):

json
{
  "checkheart": true
}
매개변수이름유형필수설명
checkheartboolModbus 하트비트감지상태:true 开启,false 닫기

9. 조회컨트롤러作을/를슬레이브여부연결

명령어: 0x5718

요청:

json
{}

응답:

json
{
  "ModbusConnect": false
}
매개변수이름유형필수설명
ModbusConnectbool연결상태:false 미연결,true 已연결

10. 컨트롤러作을/를마스터的매개변수설정

명령어: 0x5719

json
{
  "masterStation": {
    "RTU": {
      "baudrate": 115200,
      "checkBit": "E",
      "dataBit": 5,
      "port": 2,
      "slaveId": 1,
      "stopBit": 1
    },
    "TCP": {
      "IP": "192.168.10.56",
      "port": 503
    },
    "processNumber": 1,
    "type": "TCP"
  },
  "startAddress": false
}
매개변수分클래스매개변수이름유형필수설명
masterStationtypestring통신유형:RTU 或 TCP
masterStationprocessNumberint프로세스번호
masterStation.RTUbaudrateintBaud Rate
masterStation.RTUcheckBitstring검증비트:如 "E"(偶검증)、"O"(奇검증)、"N"(없음검증)
masterStation.RTUdataBitint데이터비트
masterStation.RTUportint串口번호
masterStation.RTUslaveIdint从设备 ID
masterStation.RTUstopBitint정지비트
masterStation.TCPIPstringTCP 서버 IP 주소
masterStation.TCPportintTCP 포트 번호
범용startAddressbool시작주소스위치

11. 조회컨트롤러作을/를마스터时的정보

명령어: 0x5744

json
{
  "processNumber": 2
}
매개변수이름유형필수설명
processNumberint프로세스번호

12. 조회마스터정보응답

명령어: 0x5745

json
{
  "RTU": {
    "baudrate": 115200,
    "checkBit": "E",
    "dataBit": 5,
    "port": 3,
    "slaveId": 56,
    "stopBit": 1
  },
  "TCP": {
    "IP": "192.168.1.14",
    "port": 503
  },
  "modbus_state": false,
  "response_time_out": 100,
  "startAddress": true,
  "type": "RTU"
}
매개변수分클래스매개변수이름유형필수설명
RTUbaudrateintBaud Rate
RTUcheckBitstring검증비트
RTUdataBitint데이터비트
RTUportint串口번호
RTUslaveIdint从设备 ID
RTUstopBitint정지비트
TCPIPstringTCP 서버 IP 주소
TCPportintTCP 포트 번호
범용modbus_stateboolMODBUS 상태
범용response_time_outint응답타임아웃시간,단위:ms
범용startAddressbool시작주소스위치
범용typestring통신유형:RTU 或 TCP

13. 명령어汇总

명령어기능방향
0x5701설정 Modbus 프로그램호스트 컴퓨터 → 컨트롤러
0x5702조회 Modbus 프로그램호스트 컴퓨터 → 컨트롤러
0x5703조회 Modbus 프로그램응답컨트롤러 → 호스트 컴퓨터
0x5711설정컨트롤러 Modbus 유형호스트 컴퓨터 → 컨트롤러
0x5712조회컨트롤러 Modbus 유형호스트 컴퓨터 → 컨트롤러
0x5713조회컨트롤러 Modbus 유형응답컨트롤러 → 호스트 컴퓨터
0x5714컨트롤러 Modbus 활성화호스트 컴퓨터 → 컨트롤러
0x5715설정 Modbus 하트비트감지호스트 컴퓨터 → 컨트롤러
0x5716조회 Modbus 하트비트감지호스트 컴퓨터 → 컨트롤러
0x5717조회 Modbus 하트비트감지응답컨트롤러 → 호스트 컴퓨터
0x5718조회슬레이브연결상태호스트 컴퓨터 → 컨트롤러
0x5719설정마스터매개변수호스트 컴퓨터 → 컨트롤러
0x5744조회마스터정보호스트 컴퓨터 → 컨트롤러
0x5745조회마스터정보응답컨트롤러 → 호스트 컴퓨터

TCP통신

설정네트워크매개변수

명령어: 0x4180 MSGCOMM_PARAM_SET

클라이언트

요청 매개변수

필드유형설명
frameHeaderstring帧头
ipstringIP주소
numberSystemint0: 10진수, 1: 16진수
portint포트 번호
separatorstring分隔符
terminatorstring종료符
craftint프로세스번호 (1~9)
robotint로봇번호
typeint0: 서버, 1: 클라이언트

요청 예시

json
{
  "client": {
    "frameHeader": "@",
    "ip": "192.168.1.111",
    "numberSystem": 1,
    "port": 9000,
    "separator": ",",
    "terminator": "!"
  },
  "craft": 1,
  "robot": 1,
  "type": 1
}

服务端

요청 매개변수

필드유형설명
frameHeaderstring帧头
ipstringIP주소
numberSystemint0: 10진수, 1: 16진수
portint포트 번호
separatorstring分隔符
terminatorstring종료符
craftint프로세스번호 (1~9)
robotint로봇번호
typeint0: 서버, 1: 클라이언트

요청 예시

json
{
  "craft": 3,
  "robot": 1,
  "server": {
    "frameHeader": "@A",
    "ip": "192.168.1.14",
    "numberSystem": 0,
    "port": 9001,
    "separator": "B",
    "terminator": "C"
  },
  "type": 0
}

조회네트워크매개변수

명령어: 0x4181 MSGCOMM_PARAM_INQUIRE

요청 매개변수

필드유형설명
robotint로봇번호
craftint프로세스번호
typeint0: 서버, 1: 클라이언트

요청 예시

json
{
  "robot": 1,
  "craft": 1,
  "type": 2
}

응답네트워크매개변수조회

명령어: 0x4182 MSGCOMM_PARAM_RESPOND

클라이언트

응답 매개변수

필드유형설명
frameHeaderstring帧头
ipstringIP주소
numberSystemint0: 10진수, 1: 16진수
portint포트 번호
separatorstring分隔符
terminatorstring종료符
craftint프로세스번호
netStatebooltrue: 연결, false: 연결 해제
robotint로봇번호
typeint0: 서버, 1: 클라이언트

응답 예시

json
{
  "client": {
    "frameHeader": "@",
    "ip": "192.168.1.111",
    "numberSystem": 0,
    "port": 9000,
    "separator": ",",
    "terminator": "!"
  },
  "craft": 1,
  "netState": false,
  "robot": 1,
  "type": 1
}

服务端

응답 매개변수

필드유형설명
frameHeaderstring帧头
ipstringIP주소
numberSystemint0: 10진수, 1: 16진수
portint포트 번호
separatorstring分隔符
terminatorstring종료符
craftint프로세스번호
netStatebooltrue: 연결, false: 연결 해제
robotint로봇번호
typeint0: 서버, 1: 클라이언트

응답 예시

json
{
  "craft": 1,
  "netState": false,
  "robot": 1,
  "server": {
    "frameHeader": "@",
    "ip": "192.168.1.14",
    "numberSystem": 0,
    "port": 22,
    "separator": ",",
    "terminator": "!"
  },
  "type": 0
}

연결MSGCOMM네트워크

명령어: 0x4183 MSGCOMM_DEVICE_CONNECT

요청 매개변수

필드유형설명
robotint로봇번호
craftint프로세스번호

요청 예시

json
{
  "robot": 1,
  "craft": 1
}

닫기MSGCOMM네트워크

명령어: 0x4184 MSGCOMM_DEVICE_CLOSE

요청 매개변수

필드유형설명
robotint로봇번호
craftint프로세스번호

요청 예시

json
{
  "robot": 1,
  "craft": 1
}