Communications.LS
네임스페이스 Going.Basis.Communications.LS — LS Electric PLC CNet 프로토콜 시리얼 통신
public enum CNetFunc
CNet 통신 함수 코드
Values
NONE
READ_SINGLE
READ_BLOCK
WRITE_SINGLE
WRITE_BLOCK
public class CNetValue
쓰기 요청 시 디바이스 주소와 값을 묶는 데이터 클래스
Constructor
| CNetValue | (string dev, int value) |
Properties
| string | Device get | 디바이스 주소 문자열 (예: "D0100") |
| int | Value get | 쓸 정수 값 |
public class SchedulerStopException : Exception
시리얼 포트 오류 시 스케줄러 루프를 중단하기 위한 내부 예외
Description
IOException, UnauthorizedAccessException 등 시리얼 통신 오류 발생 시 throw 되어 Process 루프를 종료합니다.
public class CNet
: IDisposable
LS Electric PLC CNet 프로토콜 시리얼 통신 클라이언트. 자동/수동 스케줄링으로 단어/블록 읽기·쓰기.
Properties
| string | Port get set | 시리얼 포트 이름 (예: "COM1") |
| int | Baudrate get set | 통신 속도 (bps) |
| Parity | Parity get set | 패리티 설정 |
| int | DataBits get set | 데이터 비트 수 |
| StopBits | StopBits get set | 정지 비트 |
| int | Timeout get set | 응답 대기 시간 (ms). 기본값: 100 |
| int | Interval get set | 메시지 전송 간격 (ms). 기본값: 10 |
| int | BufferSize get set | 수신 버퍼 크기 (bytes). 기본값: 1024 |
| bool | IsOpen get | 시리얼 포트 열림 여부 |
| bool | IsStart get | 통신 시작 여부 |
| bool | AutoReconnect get set | 포트 닫힘 시 자동 재연결 여부 |
| bool | IsDisposed get | Dispose 호출 여부 |
| object? | Tag get set | 사용자 정의 데이터 |
Methods — 제어
| void | Start | () | 통신 시작 |
| void | Stop | () | 통신 정지 |
| void | Dispose | () | 리소스 해제 |
| bool | ContainAutoID | (int MessageID) | 자동 메시지 ID 존재 여부 확인 |
| bool | RemoveManual | (int MessageID) | 수동 메시지 제거 |
| bool | RemoveAuto | (int MessageID) | 자동 메시지 제거 |
| void | ClearManual | () | 모든 수동 메시지 삭제 |
| void | ClearAuto | () | 모든 자동 메시지 삭제 |
| void | ClearWorkSchedule | () | 작업 스케줄 전체 삭제 |
Methods — 자동 읽기 (Auto Read)
| void | AutoRSS | (int id, int slave, string device, int? timeout = null) | 단일 디바이스 자동 읽기 등록 |
| void | AutoRSS | (int id, int slave, string[] devices, int? timeout = null) | 복수 디바이스 자동 읽기 등록 |
| void | AutoRSB | (int id, int slave, string device, int length, int? timeout = null) | 블록 자동 읽기 등록 |
Methods — 수동 읽기 (Manual Read)
| void | ManualRSS | (int id, int slave, string device, int? repeatCount = null, int? timeout = null) | 단일 디바이스 수동 읽기 |
| void | ManualRSS | (int id, int slave, string[] devices, int? repeatCount = null, int? timeout = null) | 복수 디바이스 수동 읽기 |
| void | ManualRSB | (int id, int slave, string device, int length, int? repeatCount = null, int? timeout = null) | 블록 수동 읽기 |
Methods — 수동 쓰기 (Manual Write)
| void | ManualWSS | (int id, int slave, string device, int value, int? repeatCount = null, int? timeout = null) | 단일 디바이스 수동 쓰기 |
| void | ManualWSS | (int id, int slave, IEnumerable<CNetValue> values, int? repeatCount = null, int? timeout = null) | 복수 디바이스 수동 쓰기 |
| void | ManualWSB | (int id, int slave, string device, int[] values, int? repeatCount = null, int? timeout = null) | 블록 수동 쓰기 |
Events
| EventHandler<DataReadEventArgs> | DataReceived | 읽기 응답 수신 시 발생. DataReadEventArgs: MessageID, Slave, Function, Data, ReadAddress |
| EventHandler<WriteEventArgs> | WriteResponseReceived | 쓰기 응답 수신 시 발생 |
| EventHandler<TimeoutEventArgs> | TimeoutReceived | 응답 타임아웃 발생 시 |
| EventHandler<BCCErrorEventArgs> | BCCErrorReceived | BCC 체크섬 오류 시 |
| EventHandler<NAKEventArgs> | NAKReceived | NAK 응답 수신 시. NAKEventArgs.ErrorCode에 오류 코드 |
| EventHandler | DeviceOpened | 포트 열림 시 |
| EventHandler | DeviceClosed | 포트 닫힘 시 |
public class DataReadEventArgs : EventArgs
읽기 응답 이벤트 인수
Properties
| int | MessageID get | 메시지 ID |
| int | Slave get | 슬레이브 번호 |
| CNetFunc | Function get | 함수 코드 |
| int[] | Data get | 수신 데이터 배열 |
| string[] | ReadAddress get | 읽기 주소 배열 |
public class WriteEventArgs : EventArgs
쓰기 응답 이벤트 인수
Properties
| int | MessageID get | 메시지 ID |
| int | Slave get | 슬레이브 번호 |
| CNetFunc | Function get | 함수 코드 |
public class TimeoutEventArgs : EventArgs
타임아웃 이벤트 인수
Properties
| int | MessageID get | 메시지 ID |
| int | Slave get | 슬레이브 번호 |
| CNetFunc | Function get | 함수 코드 |
public class BCCErrorEventArgs : EventArgs
BCC 체크섬 오류 이벤트 인수
Properties
| int | MessageID get | 메시지 ID |
| int | Slave get | 슬레이브 번호 |
| CNetFunc | Function get | 함수 코드 |
public class NAKEventArgs : EventArgs
NAK 응답 이벤트 인수
Properties
| int | MessageID get | 메시지 ID |
| int | Slave get | 슬레이브 번호 |
| CNetFunc | Function get | 함수 코드 |
| int | ErrorCode get | 오류 코드 |
검색 결과가 없습니다.