Skip to main content
Skip table of contents

focas_pmc_write_char(handle, addr_type, start_num, write_data, write_count)

기능

Machine Center Controller의 PMC Data를 쓰기 위해서 사용되는 명령어 입니다.
데이터의 반환 형태가 char(1Byte)일 경우 사용합니다.

주의

DRL구동 전 해당 컨트롤러의 PMC Signal Map을 반드시 확인 후 구동하시기 바랍니다.

인수

인수명자료형기본값설명

handle

int

-

FOCAS 사용에 필요한 통신 고유의 제어상수값

addr_type

str


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)

  • 대소문자 구분안함

start_num

Int


Strart Address Number(0~9999)

write_data

byte


전송할 데이터의 형태는 byte입니다.

write_count

Int


전송할 char Data의 개수를 입력합니다.

최대 5

리턴

설명

errorCode

0:성공(정상으로 통신해제)

0이외의 값 : 에러(focas_get_error_str 참조)

예외

예외설명

DR_Error (DR_ERROR_TYPE)

인수들의 데이터형 오류 시

DR_Error (DR_ERROR_VALUE)

인수의 값이 유효하지 않을 시

DR_Error (DR_ERROR_RUNTIME)

C Extension 모듈 에러 발생 시

DR_Error (DR_ERROR_STOP)

프로그램 강제 종료 시

예제

PY
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)
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.