commands:builtin
차이
문서의 선택한 두 판 사이의 차이를 보여줍니다.
| 다음 판 | 이전 판 | ||
| commands:builtin [2026/08/31 18:24] – 만듦 - 바깥 편집 127.0.0.1 | commands:builtin [2026/09/15 11:47] (현재) – 바깥 편집 127.0.0.1 | ||
|---|---|---|---|
| 줄 1: | 줄 1: | ||
| ====== ILOGICS 내장 명령어 설명서 ====== | ====== ILOGICS 내장 명령어 설명서 ====== | ||
| - | ILOGICS | + | ILOGICS 보드를 선택하면 |
| - | 이 설명서는 디지털 입출력, 입력 필터, 타이머, 카운터, 아날로그·온도 처리, PWM, PID, 표시 | + | ===== 내장 명령어를 |
| - | ===== 내장 명령어를 사용하는 순서 ===== | + | - [[https:// |
| + | - Arduino IDE의 **도구 → 보드**에서 사용할 보드를 선택합니다. | ||
| + | - 내장 명령어를 사용합니다. | ||
| - | - Arduino IDE에 ILOGICS 보드 패키지를 설치합니다. | + | ===== 내장 |
| - | - **도구 → 보드**에서 실제 사용하는 제품 모델을 정확히 선택합니다. | + | |
| - | - 제품 설명서에서 전원, 단자, 핀 번호 또는 논리 채널을 확인합니다. | + | |
| - | - 아래 기능별 | + | |
| - | - 입출력 확인 후 타이머, 카운터, PID와 통신 기능을 단계적으로 추가합니다. | + | |
| - | ===== 보드별 번호 | + | 예제에 표시된 입출력 주소는 제품별로 다릅니다. |
| - | ^ 제품군 ^ 프로그램에서 사용하는 번호 ^ 확인할 내용 ^ | + | **카테고리별 보기** |
| - | | MPINO | 선택한 제품의 Arduino 핀 번호 | 해당 제품의 핀맵 확인 | | + | |
| - | | MPAINO | 디지털 입력은 '' | + | |
| - | | MPS·MPA | MP STUDIO의 래더 접점과 메모리 사용 | Arduino 스케치용 내장 명령어를 사용하지 않음 | | + | |
| - | | MNET | Modbus RTU 또는 LS산전 Cnet 통신으로 I/O 제어 | Arduino 스케치를 다운로드하지 않음 | | + | |
| - | 같은 숫자라도 MPINO에서는 Arduino 핀 번호, MPAINO에서는 모듈의 논리 채널일 수 있습니다. 다른 | + | * [[commands: |
| + | * [[commands: | ||
| + | * [[commands: | ||
| + | * [[commands: | ||
| - | ===== 기능별 빠른 | + | ^ 카테고리 ^ 명령어 ^ 설명 ^ |
| + | | 디지털 입력 필터 | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | 에지 검출 | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | 상태 반전 | [[commands: | ||
| + | | 범위 변환 | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | 타이머 | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | 타이머 상태 | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | 콜백 타이머 | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | 카운터 | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | 데이터 버퍼 | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | 아날로그 입력 | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | 아날로그 입력 필터 | [[commands: | ||
| + | | 아날로그 범위 변환 | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | 4~20mA 입력 | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | 4~20mA 범위 변환 | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | 온도 입력 | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | 아날로그 출력 | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | 4~20mA 출력 | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | PWM 출력 | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | 펄스 출력 | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | PID 제어 | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | TM1637 FND | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | 문자 LCD | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | RTC | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | 디버그 | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | Watchdog | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | 고속카운터 | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | Modbus RTU Slave | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | Modbus RTU Master | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | LS산전 Cnet Slave | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | Mitsubishi MC Protocol | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| + | | ::: | [[commands: | ||
| - | ^ 하고 싶은 작업 ^ 사용할 명령어 ^ | + | ===== 디지털 |
| - | | 입력 | + | |
| - | | 입력이 변하는 순간 한 번만 실행 | '' | + | |
| - | | 버튼을 누를 때마다 출력 ON/OFF 전환 | '' | + | |
| - | | 일정 시간 뒤 출력 ON/OFF | '' | + | |
| - | | 일정 시간만 펄스 출력 | '' | + | |
| - | | 동작 횟수 계산 | '' | + | |
| - | | 센서값 범위 변환 | '' | + | |
| - | | NTC·PT100 온도 측정 | '' | + | |
| - | | 아날로그·PWM 출력 | '' | + | |
| - | | 목표값 자동 제어 | '' | + | |
| - | | 주기적인 작업 실행 | '' | + | |
| - | | 통신으로 HMI·PLC 연결 | '' | + | |
| - | ===== 기본 제어 명령어 | + | ^ 명령어 형식 ^ 반환값 ^ 사용 기준 ^ |
| + | | [[commands: | ||
| + | | [[commands: | ||
| + | | [[commands: | ||
| + | | [[commands: | ||
| + | |||
| + | '' | ||
| + | |||
| + | ===== 에지 검출 | ||
| ^ 명령어 형식 ^ 반환값 ^ 설명 ^ | ^ 명령어 형식 ^ 반환값 ^ 설명 ^ | ||
| - | | '' | + | | [[commands: |
| - | | '' | + | | [[commands: |
| - | | '' | + | |
| - | | '' | + | |
| - | | '' | + | |
| - | '' | + | '' |
| + | |||
| + | ===== 상태 반전 ===== | ||
| + | |||
| + | ^ 명령어 형식 ^ 반환값 ^ 설명 ^ | ||
| + | | [[commands: | ||
| + | |||
| + | 다음 예제는 MPAINO-8A8R(T)의 첫 입력 '' | ||
| <code cpp> | <code cpp> | ||
| bool lampState = false; | bool lampState = false; | ||
| + | |||
| + | void setup() {} | ||
| void loop() { | void loop() { | ||
| 줄 60: | 줄 187: | ||
| </ | </ | ||
| - | ===== 디지털 입력과 노이즈 필터 | + | ===== 범위 변환 |
| - | ^ 명령어 형식 ^ 반환값 ^ 사용 기준 | + | ^ 명령어 형식 ^ 반환값 ^ 설명 |
| - | | '' | + | | [[commands: |
| - | | '' | + | | [[commands: |
| - | | '' | + | |
| - | | '' | + | |
| - | | '' | + | |
| - | '' | + | ===== 타이머 ===== |
| - | + | ||
| - | ===== PLC 스타일 | + | |
| ^ 명령어 형식 ^ 동작 ^ | ^ 명령어 형식 ^ 동작 ^ | ||
| - | | '' | + | | [[commands: |
| - | | '' | + | | [[commands: |
| - | | '' | + | | [[commands: |
| - | | '' | + | | [[commands: |
| - | | '' | + | | [[commands: |
| - | | '' | + | |
| PLC 스타일 타이머는 '' | PLC 스타일 타이머는 '' | ||
| + | |||
| + | 다음 예제는 MPAINO-8A8R(T)의 첫 입력 '' | ||
| <code cpp> | <code cpp> | ||
| + | void setup() {} | ||
| + | |||
| void loop() { | void loop() { | ||
| bool run = Ibounce(0, 30); | bool run = Ibounce(0, 30); | ||
| 줄 91: | 줄 216: | ||
| </ | </ | ||
| - | ===== 주기 | + | ===== 타이머 상태 ===== |
| + | |||
| + | ^ 명령어 형식 ^ 반환값 ^ 설명 ^ | ||
| + | | [[commands: | ||
| + | | [[commands: | ||
| + | |||
| + | ===== 콜백 타이머 ===== | ||
| ^ 명령어 형식 ^ 설명 ^ | ^ 명령어 형식 ^ 설명 ^ | ||
| - | | '' | + | | [[commands: |
| - | | '' | + | | [[commands: |
| - | | '' | + | | [[commands: |
| - | | '' | + | | [[commands: |
| - | | '' | + | | [[commands: |
| - | | '' | + | | [[commands: |
| 콜백 함수는 인터럽트 안에서 실행됩니다. 콜백에서는 플래그나 짧은 카운트만 변경하고 '' | 콜백 함수는 인터럽트 안에서 실행됩니다. 콜백에서는 플래그나 짧은 카운트만 변경하고 '' | ||
| 줄 123: | 줄 254: | ||
| </ | </ | ||
| - | ===== 카운터와 데이터 버퍼 | + | ===== 카운터 ===== |
| ^ 명령어 형식 ^ 설명 ^ | ^ 명령어 형식 ^ 설명 ^ | ||
| - | | '' | + | | [[commands: |
| - | | '' | + | | [[commands: |
| - | | '' | + | | [[commands: |
| - | | '' | + | | [[commands: |
| - | | '' | + | | [[commands: |
| - | | '' | + | |
| - | | '' | + | |
| 카운터 명령어는 '' | 카운터 명령어는 '' | ||
| - | ===== 아날로그 입력과 범위 변환 ===== | + | ===== 데이터 버퍼 ===== |
| + | |||
| + | ^ 명령어 형식 ^ 설명 ^ | ||
| + | | [[commands: | ||
| + | | [[commands: | ||
| + | |||
| + | ===== 아날로그 입력 | ||
| + | |||
| + | ^ 명령어 형식 ^ 반환값·용도 ^ | ||
| + | | [[commands: | ||
| + | | [[commands: | ||
| + | | [[commands: | ||
| + | |||
| + | ===== 아날로그 입력 필터 ===== | ||
| + | |||
| + | ^ 명령어 형식 ^ 반환값·용도 ^ | ||
| + | | [[commands: | ||
| + | |||
| + | ===== 아날로그 범위 변환 ===== | ||
| + | |||
| + | ^ 명령어 형식 ^ 반환값·용도 ^ | ||
| + | | [[commands: | ||
| + | |||
| + | ===== 4~20mA 입력 ===== | ||
| + | |||
| + | ^ 명령어 형식 ^ 반환값·용도 ^ | ||
| + | | [[commands: | ||
| + | | [[commands: | ||
| + | |||
| + | ===== 4~20mA | ||
| ^ 명령어 형식 ^ 반환값·용도 ^ | ^ 명령어 형식 ^ 반환값·용도 ^ | ||
| - | | '' | + | | [[commands: |
| - | | '' | + | |
| - | | '' | + | |
| - | | '' | + | |
| - | | '' | + | |
| - | | '' | + | |
| - | | '' | + | |
| MPAINO에서는 장착된 아날로그 입력 모듈과 딥스위치의 전압·전류 범위를 먼저 확인합니다. 샘플링 속도를 높이면 응답은 빨라지지만 노이즈와 측정 특성이 달라질 수 있습니다. | MPAINO에서는 장착된 아날로그 입력 모듈과 딥스위치의 전압·전류 범위를 먼저 확인합니다. 샘플링 속도를 높이면 응답은 빨라지지만 노이즈와 측정 특성이 달라질 수 있습니다. | ||
| 줄 165: | 줄 317: | ||
| ^ 명령어 형식 ^ 반환값 ^ 대상 ^ | ^ 명령어 형식 ^ 반환값 ^ 대상 ^ | ||
| - | | '' | + | | [[commands: |
| - | | '' | + | | [[commands: |
| - | | '' | + | | [[commands: |
| NTC와 PT100은 센서 종류와 입력 회로가 다릅니다. 서로 바꾸어 사용하지 말고 선택 제품에 해당 입력 기능이 있는지 확인하십시오. | NTC와 PT100은 센서 종류와 입력 회로가 다릅니다. 서로 바꾸어 사용하지 말고 선택 제품에 해당 입력 기능이 있는지 확인하십시오. | ||
| - | ===== 아날로그 출력과 PWM ===== | + | ===== 아날로그 출력 ===== |
| ^ 명령어 형식 ^ 설명 ^ | ^ 명령어 형식 ^ 설명 ^ | ||
| - | | '' | + | | [[commands: |
| - | | '' | + | | [[commands: |
| - | | '' | + | | [[commands: |
| - | | '' | + | | [[commands: |
| - | | '' | + | |
| - | | '' | + | ===== 4~20mA 출력 ===== |
| - | | '' | + | |
| - | | '' | + | ^ 명령어 형식 ^ 설명 ^ |
| - | | '' | + | | [[commands: |
| + | | [[commands: | ||
| + | |||
| + | ===== PWM 출력 ===== | ||
| + | |||
| + | ^ 명령어 형식 ^ 설명 ^ | ||
| + | | [[commands: | ||
| + | | [[commands: | ||
| + | | [[commands: | ||
| + | |||
| + | ===== 펄스 출력 ===== | ||
| + | |||
| + | ^ 명령어 형식 ^ 설명 ^ | ||
| + | | [[commands: | ||
| PWM, 고속펄스, | PWM, 고속펄스, | ||
| 줄 189: | 줄 354: | ||
| ^ 명령어 형식 ^ 설명 ^ | ^ 명령어 형식 ^ 설명 ^ | ||
| - | | '' | + | | [[commands: |
| - | | '' | + | | [[commands: |
| - | | '' | + | | [[commands: |
| - | | '' | + | | [[commands: |
| - | | '' | + | | [[commands: |
| - | | '' | + | | [[commands: |
| <code cpp> | <code cpp> | ||
| 줄 210: | 줄 375: | ||
| PID 출력은 계산값일 뿐 안전장치가 아닙니다. 센서 단선, 과온, 출력 고착과 비상정지는 별도의 안전회로로 처리하십시오. | PID 출력은 계산값일 뿐 안전장치가 아닙니다. 센서 단선, 과온, 출력 고착과 비상정지는 별도의 안전회로로 처리하십시오. | ||
| - | ===== 표시 장치와 RTC ===== | + | ===== TM1637 FND ===== |
| - | ^ 기능 | + | ^ 대상 |
| - | | TM1637 4자리 FND | '' | + | | TM1637 4자리 FND | [[commands: |
| - | | PCF8574 문자 LCD | '' | + | |
| - | | DS3231 RTC | '' | + | ===== 문자 LCD ===== |
| + | |||
| + | ^ 대상 ^ 주요 명령어 ^ 설명 ^ | ||
| + | | PCF8574 문자 LCD | [[commands: | ||
| + | |||
| + | ===== RTC ===== | ||
| + | |||
| + | ^ 대상 ^ 주요 명령어 ^ 설명 ^ | ||
| + | | DS3231 RTC | [[commands: | ||
| 표시 장치와 RTC는 각각의 '' | 표시 장치와 RTC는 각각의 '' | ||
| - | ===== Debug와 Watchdog | + | ===== 디버그 |
| ^ 명령어 형식 ^ 설명 ^ | ^ 명령어 형식 ^ 설명 ^ | ||
| - | | '' | + | | [[commands: |
| - | | '' | + | | [[commands: |
| - | | '' | + | | [[commands: |
| - | | '' | + | |
| - | | '' | + | ===== Watchdog ===== |
| + | |||
| + | ^ 명령어 형식 ^ 설명 ^ | ||
| + | | [[commands: | ||
| + | | [[commands: | ||
| Watchdog를 활성화한 뒤 '' | Watchdog를 활성화한 뒤 '' | ||
| 줄 233: | 줄 410: | ||
| ^ 명령어 형식 ^ 설명 ^ | ^ 명령어 형식 ^ 설명 ^ | ||
| - | | '' | + | | [[commands: |
| - | | '' | + | | [[commands: |
| 현재 타이머 외부 클럭 방식의 전용 고속카운터 지원 제품은 MPINO-8A8R과 MPINO-16A8R8T입니다. 다른 제품은 제품별 인터럽트 입력을 확인해 '' | 현재 타이머 외부 클럭 방식의 전용 고속카운터 지원 제품은 MPINO-8A8R과 MPINO-16A8R8T입니다. 다른 제품은 제품별 인터럽트 입력을 확인해 '' | ||
| - | ===== 산업용 통신 | + | ===== Modbus RTU Slave ===== |
| - | ^ 프로토콜 | + | ^ 초기 설정 ^ '' |
| - | | Modbus RTU Slave | '' | + | | [[commands: |
| - | | Modbus RTU Master | '' | + | |
| - | | LS산전 Cnet Slave | '' | + | |
| - | | Mitsubishi MC Protocol Slave | '' | + | |
| <code cpp> | <code cpp> | ||
| 줄 257: | 줄 431: | ||
| } | } | ||
| </ | </ | ||
| + | |||
| + | ===== Modbus RTU Master ===== | ||
| + | |||
| + | ^ 초기 설정 ^ 실행 명령어 ^ | ||
| + | | [[commands: | ||
| + | |||
| + | ===== LS산전 Cnet Slave ===== | ||
| + | |||
| + | ^ 초기 설정 ^ '' | ||
| + | | [[commands: | ||
| + | |||
| + | ===== Mitsubishi MC Protocol ===== | ||
| + | |||
| + | ^ 초기 설정 ^ '' | ||
| + | | [[commands: | ||
| 제품별 RS-232, RS-485와 UART의 '' | 제품별 RS-232, RS-485와 UART의 '' | ||
| 줄 268: | 줄 457: | ||
| const uint8_t outputChannel = 64; | const uint8_t outputChannel = 64; | ||
| - | void setup() { | + | void setup() {} |
| - | pinMode(inputChannel, | + | |
| - | pinMode(outputChannel, | + | |
| - | } | + | |
| void loop() { | void loop() { | ||
| 줄 301: | 줄 487: | ||
| * [[products: | * [[products: | ||
| - | * [[products:mpino|MPINO 제품 특징과 사용 흐름]] | + | * [[products:mpino_series|MPINO 제품 특징과 사용 흐름]] |
| * [[products: | * [[products: | ||
| * [[guide: | * [[guide: | ||
| - | * [[guide: | + | * [[guide: |
| - | * [[safety|안전 및 설치 주의사항]] | + | * [[:safety|안전 및 설치 주의사항]] |
commands/builtin.1788168251.txt.gz · 마지막으로 수정됨: 저자 127.0.0.1
