|
Dreamine.PLC.Core 1.0.1
Dreamine.PLC.Core 산업 자동화 및 I/O 기능을 제공합니다.
|


Public 멤버 함수 | |
| PlcSimulatorServer (PlcSimulatorServerOptions options) | |
| PlcSimulatorServer (PlcSimulatorServerOptions options, InMemoryPlcMemory memory) | |
| Task | StartAsync (CancellationToken cancellationToken=default) |
| async Task | StopAsync () |
| async ValueTask | DisposeAsync () |
속성 | |
| bool | IsRunning [get] |
이벤트 | |
| EventHandler< string >? | StatusChanged |
Private 멤버 함수 | |
| async Task | AcceptLoopAsync (CancellationToken cancellationToken) |
| async Task | HandleClientAsync (TcpClient client, CancellationToken cancellationToken) |
| string | ExecuteLine (string line) |
| string | ExecuteReadBits (Abstractions.Devices.PlcAddress address, string argument) |
| string | ExecuteReadWords (Abstractions.Devices.PlcAddress address, string argument) |
| string | ExecuteWriteBits (Abstractions.Devices.PlcAddress address, string argument) |
| string | ExecuteWriteWords (Abstractions.Devices.PlcAddress address, string argument) |
| void | ApplyAutoWordResponse (Abstractions.Devices.PlcAddress writtenAddress, IReadOnlyList< short > values) |
정적 Private 멤버 함수 | |
| static bool | TryParseCount (string text, out int count, out string error) |
| static IPAddress | ParseAddress (string host) |
Private 속성 | |
| readonly PlcSimulatorServerOptions | _options |
| readonly InMemoryPlcMemory | _memory |
| readonly DefaultPlcAddressParser | _addressParser = new() |
| readonly List< Task > | _clientTasks = [] |
| readonly object | _syncRoot = new() |
| CancellationTokenSource? | _cts |
| TcpListener? | _listener |
| Task? | _acceptTask |
샘플과 PC 간 테스트용 경량 TCP PLC 시뮬레이터 서버를 제공합니다.
PlcSimulatorServer.cs 파일의 16 번째 라인에서 정의되었습니다.
|
inline |
새 메모리 저장소와 지정한 옵션으로 서버를 초기화합니다.
| options | 서버 옵션입니다. |
| ArgumentNullException | options 가 null인 경우 발생합니다. |
PlcSimulatorServer.cs 파일의 115 번째 라인에서 정의되었습니다.
|
inline |
지정한 옵션과 공유 메모리 저장소로 서버를 초기화합니다.
| options | 서버 옵션입니다. |
| memory | 공유 PLC 메모리입니다. |
| ArgumentNullException | 옵션 또는 메모리가 null인 경우 발생합니다. |
PlcSimulatorServer.cs 파일의 151 번째 라인에서 정의되었습니다.
|
inlineprivate |
TCP 클라이언트를 수락하고 각 연결 처리 작업을 추적합니다.
| cancellationToken | 루프 취소 토큰입니다. |
PlcSimulatorServer.cs 파일의 319 번째 라인에서 정의되었습니다.
다음을 참조함 : _clientTasks, _listener, _syncRoot, HandleClientAsync().
다음에 의해서 참조됨 : StartAsync().


|
inlineprivate |
구성된 트리거에 단일 워드가 기록되면 증가된 자동 응답 값을 씁니다.
| writtenAddress | 기록된 주소입니다. |
| values | 기록된 값입니다. |
PlcSimulatorServer.cs 파일의 696 번째 라인에서 정의되었습니다.
다음을 참조함 : _addressParser, _memory, _options, StatusChanged.
다음에 의해서 참조됨 : ExecuteWriteWords().

|
inline |
TCP 시뮬레이터 서버를 중지하고 리소스를 해제합니다.
PlcSimulatorServer.cs 파일의 292 번째 라인에서 정의되었습니다.
다음을 참조함 : StopAsync().

|
inlineprivate |
한 프로토콜 명령 라인을 분석하고 성공 또는 오류 응답을 만듭니다.
| line | 명령 라인입니다. |
PlcSimulatorServer.cs 파일의 423 번째 라인에서 정의되었습니다.
다음을 참조함 : _addressParser, Dreamine.PLC.Core.Simulation.PlcSimulatorProtocol.Error(), ExecuteReadBits(), ExecuteReadWords(), ExecuteWriteBits(), ExecuteWriteWords(), Dreamine.PLC.Core.Simulation.PlcSimulatorProtocol.ReadBits, Dreamine.PLC.Core.Simulation.PlcSimulatorProtocol.ReadWords, Dreamine.PLC.Core.Simulation.PlcSimulatorProtocol.WriteBits, Dreamine.PLC.Core.Simulation.PlcSimulatorProtocol.WriteWords.
다음에 의해서 참조됨 : HandleClientAsync().


|
inlineprivate |
비트 읽기 명령을 실행합니다.
| address | 시작 주소입니다. |
| argument | 읽기 수 인수입니다. |
PlcSimulatorServer.cs 파일의 487 번째 라인에서 정의되었습니다.
다음을 참조함 : _memory, Dreamine.PLC.Core.Simulation.PlcSimulatorProtocol.Error(), Dreamine.PLC.Core.Simulation.PlcSimulatorProtocol.FormatBits(), Dreamine.PLC.Core.Simulation.PlcSimulatorProtocol.Ok(), TryParseCount().
다음에 의해서 참조됨 : ExecuteLine().


|
inlineprivate |
워드 읽기 명령을 실행합니다.
| address | 시작 주소입니다. |
| argument | 읽기 수 인수입니다. |
PlcSimulatorServer.cs 파일의 529 번째 라인에서 정의되었습니다.
다음을 참조함 : _memory, Dreamine.PLC.Core.Simulation.PlcSimulatorProtocol.Error(), Dreamine.PLC.Core.Simulation.PlcSimulatorProtocol.FormatWords(), Dreamine.PLC.Core.Simulation.PlcSimulatorProtocol.Ok(), TryParseCount().
다음에 의해서 참조됨 : ExecuteLine().


|
inlineprivate |
비트 쓰기 명령을 실행합니다.
| address | 시작 주소입니다. |
| argument | 비트 페이로드입니다. |
PlcSimulatorServer.cs 파일의 625 번째 라인에서 정의되었습니다.
다음을 참조함 : _memory, Dreamine.PLC.Core.Simulation.PlcSimulatorProtocol.Error(), Dreamine.PLC.Core.Simulation.PlcSimulatorProtocol.Ok(), Dreamine.PLC.Core.Simulation.PlcSimulatorProtocol.ParseBits().
다음에 의해서 참조됨 : ExecuteLine().


|
inlineprivate |
워드 쓰기 명령을 실행하고 자동 응답을 적용합니다.
| address | 시작 주소입니다. |
| argument | 워드 페이로드입니다. |
PlcSimulatorServer.cs 파일의 661 번째 라인에서 정의되었습니다.
다음을 참조함 : _memory, ApplyAutoWordResponse(), Dreamine.PLC.Core.Simulation.PlcSimulatorProtocol.Error(), Dreamine.PLC.Core.Simulation.PlcSimulatorProtocol.Ok(), Dreamine.PLC.Core.Simulation.PlcSimulatorProtocol.ParseWords().
다음에 의해서 참조됨 : ExecuteLine().


|
inlineprivate |
한 클라이언트의 라인 명령을 읽고 실행 결과를 응답합니다.
| client | 처리할 TCP 클라이언트입니다. |
| cancellationToken | 처리 취소 토큰입니다. |
PlcSimulatorServer.cs 파일의 376 번째 라인에서 정의되었습니다.
다음을 참조함 : ExecuteLine(), StatusChanged.
다음에 의해서 참조됨 : AcceptLoopAsync().


|
inlinestaticprivate |
바인딩 호스트를 IP 주소로 변환하며 비어 있거나 잘못되면 Any를 사용합니다.
| host | 호스트 텍스트입니다. |
PlcSimulatorServer.cs 파일의 750 번째 라인에서 정의되었습니다.
다음에 의해서 참조됨 : StartAsync().

|
inline |
TCP 수신기를 시작하고 클라이언트 수락 루프를 실행합니다.
| cancellationToken | 서버 수명 취소 토큰입니다. |
PlcSimulatorServer.cs 파일의 200 번째 라인에서 정의되었습니다.
다음을 참조함 : _acceptTask, _cts, _listener, _options, AcceptLoopAsync(), ParseAddress(), StatusChanged.

|
inline |
수신기를 중지하고 수락 및 클라이언트 작업 종료를 기다립니다.
PlcSimulatorServer.cs 파일의 232 번째 라인에서 정의되었습니다.
다음을 참조함 : _acceptTask, _clientTasks, _cts, _listener, _syncRoot, StatusChanged.
다음에 의해서 참조됨 : DisposeAsync().

|
inlinestaticprivate |
양의 읽기 수를 구문 분석합니다.
| text | 수 텍스트입니다. |
| count | 구문 분석된 수입니다. |
| error | 실패 메시지입니다. |
true입니다.PlcSimulatorServer.cs 파일의 578 번째 라인에서 정의되었습니다.
다음에 의해서 참조됨 : ExecuteReadBits(), ExecuteReadWords().

|
private |
accept Task 값을 보관합니다.
PlcSimulatorServer.cs 파일의 89 번째 라인에서 정의되었습니다.
다음에 의해서 참조됨 : StartAsync(), StopAsync().
|
private |
address Parser 값을 보관합니다.
PlcSimulatorServer.cs 파일의 44 번째 라인에서 정의되었습니다.
다음에 의해서 참조됨 : ApplyAutoWordResponse(), ExecuteLine().
|
private |
client Tasks 값을 보관합니다.
PlcSimulatorServer.cs 파일의 53 번째 라인에서 정의되었습니다.
다음에 의해서 참조됨 : AcceptLoopAsync(), StopAsync().
|
private |
cts 값을 보관합니다.
PlcSimulatorServer.cs 파일의 71 번째 라인에서 정의되었습니다.
다음에 의해서 참조됨 : StartAsync(), StopAsync().
|
private |
listener 값을 보관합니다.
PlcSimulatorServer.cs 파일의 80 번째 라인에서 정의되었습니다.
다음에 의해서 참조됨 : AcceptLoopAsync(), StartAsync(), StopAsync().
|
private |
memory 값을 보관합니다.
PlcSimulatorServer.cs 파일의 35 번째 라인에서 정의되었습니다.
다음에 의해서 참조됨 : ApplyAutoWordResponse(), ExecuteReadBits(), ExecuteReadWords(), ExecuteWriteBits(), ExecuteWriteWords(), PlcSimulatorServer().
|
private |
options 값을 보관합니다.
PlcSimulatorServer.cs 파일의 26 번째 라인에서 정의되었습니다.
다음에 의해서 참조됨 : ApplyAutoWordResponse(), PlcSimulatorServer(), StartAsync().
|
private |
sync Root 값을 보관합니다.
PlcSimulatorServer.cs 파일의 62 번째 라인에서 정의되었습니다.
다음에 의해서 참조됨 : AcceptLoopAsync(), StopAsync().
|
get |
시뮬레이터 서버 실행 여부를 가져옵니다.
PlcSimulatorServer.cs 파일의 175 번째 라인에서 정의되었습니다.
| EventHandler<string>? Dreamine.PLC.Core.Simulation.PlcSimulatorServer.StatusChanged |
서버 상태 메시지가 변경될 때 발생합니다.
PlcSimulatorServer.cs 파일의 165 번째 라인에서 정의되었습니다.
다음에 의해서 참조됨 : ApplyAutoWordResponse(), HandleClientAsync(), StartAsync(), StopAsync().