SampleSmart 1.0.0.0
SampleSmart 사용 방법을 보여 주는 예제 프로젝트입니다.
로딩중...
검색중...
일치하는것 없음
SampleSmart.Pages.PageSub.PlcTabs.PlcSampleRuntime 클래스 참조sealed

더 자세히 ...

Public 멤버 함수

 PlcSampleRuntime ()
void UseInMemoryClient ()
void UseSimulatorTcpClient (string host, int port)
void UseMitsubishiMcClient (string host, int port, string transportText, int retryCount)
void UseOmronFinsClient (string host, int port, string transportText, int retryCount)
void UseMitsubishiMxComponentClient (string progId, int logicalStationNumber)
void UseOmronCxComponentClient (string progId, string peerAddress)
async Task StartProtocolServerAsync (string modeText, string host, int port)
async Task StopProtocolServerAsync ()
Task StartSimulatorServerAsync (string host, int port)
Task StopSimulatorServerAsync ()
async Task RunHandshakeTestAsync (short startValue, int iterations, int delayMs, CancellationToken cancellationToken=default)

속성

PlcMonitorViewModel Monitor [get]
string ServerStatus = "Server stopped." [get, private set]

Private 멤버 함수

bool IsAnyServerRunning ()
void OnSimulatorServerStatusChanged (object? sender, string e)

정적 Private 멤버 함수

static MitsubishiMcSimulatorServerOptions CreateMcSimulatorOptions (string host, int port)
static OmronFinsSimulatorServerOptions CreateFinsSimulatorOptions (string host, int port)
static string NormalizeMode (string? modeText)

Private 속성

readonly InMemoryPlcClient _inMemoryClient = new()
readonly DefaultPlcAddressParser _addressParser = new()
IPlcClient _activeClient
PlcSimulatorServer? _simulatorServer
MitsubishiMcTcpSimulatorServer? _mcTcpSimulatorServer
MitsubishiMcUdpSimulatorServer? _mcUdpSimulatorServer
OmronFinsTcpSimulatorServer? _finsTcpSimulatorServer
OmronFinsUdpSimulatorServer? _finsUdpSimulatorServer
PlcSimulatorTcpClient? _simulatorClient
MitsubishiMcPlcClient? _mitsubishiMcClient
MitsubishiMxComponentPlcClient? _mitsubishiMxComponentClient
OmronFinsPlcClient? _omronFinsClient
OmronCxComponentPlcClient? _omronCxComponentClient
string _activeServerMode = string.Empty

상세한 설명

PLC 샘플 전체에서 공유되는 Runtime 컨텍스트입니다.

PlcSampleRuntime.cs 파일의 28 번째 라인에서 정의되었습니다.

생성자 & 소멸자 문서화

◆ PlcSampleRuntime()

SampleSmart.Pages.PageSub.PlcTabs.PlcSampleRuntime.PlcSampleRuntime ( )
inline

PlcSampleRuntime 클래스의 새 인스턴스를 초기화합니다.

PlcSampleRuntime.cs 파일의 165 번째 라인에서 정의되었습니다.

166 {
167 _activeClient = _inMemoryClient;
168 Monitor = new PlcMonitorViewModel(_inMemoryClient, "InMemory PLC");
169 }

다음을 참조함 : _activeClient, _inMemoryClient, Monitor.

멤버 함수 문서화

◆ CreateFinsSimulatorOptions()

OmronFinsSimulatorServerOptions SampleSmart.Pages.PageSub.PlcTabs.PlcSampleRuntime.CreateFinsSimulatorOptions ( string host,
int port )
inlinestaticprivate

Fins Simulator Options 값을 생성합니다.

매개변수
hosthost에 사용할 string 값입니다.
portport에 사용할 int 값입니다.
반환값
Create Fins Simulator Options 작업에서 생성한 OmronFinsSimulatorServerOptions 결과입니다.

PlcSampleRuntime.cs 파일의 871 번째 라인에서 정의되었습니다.

872 {
873 return new OmronFinsSimulatorServerOptions
874 {
875 Host = host,
876 Port = port,
877 EnableAutoWordResponse = true,
878 AutoResponseTriggerOffset = 100,
879 AutoResponseOffset = 101,
880 AutoResponseIncrement = 1
881 };
882 }

다음에 의해서 참조됨 : StartProtocolServerAsync().

이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ CreateMcSimulatorOptions()

MitsubishiMcSimulatorServerOptions SampleSmart.Pages.PageSub.PlcTabs.PlcSampleRuntime.CreateMcSimulatorOptions ( string host,
int port )
inlinestaticprivate

Mc Simulator Options 값을 생성합니다.

매개변수
hosthost에 사용할 string 값입니다.
portport에 사용할 int 값입니다.
반환값
Create Mc Simulator Options 작업에서 생성한 MitsubishiMcSimulatorServerOptions 결과입니다.

PlcSampleRuntime.cs 파일의 824 번째 라인에서 정의되었습니다.

825 {
826 return new MitsubishiMcSimulatorServerOptions
827 {
828 Host = host,
829 Port = port,
830 EnableAutoWordResponse = true,
831 AutoResponseTriggerDeviceCode = 0xA8,
832 AutoResponseTriggerOffset = 100,
833 AutoResponseDeviceCode = 0xA8,
834 AutoResponseOffset = 101,
835 AutoResponseIncrement = 1
836 };
837 }

다음에 의해서 참조됨 : StartProtocolServerAsync().

이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ IsAnyServerRunning()

bool SampleSmart.Pages.PageSub.PlcTabs.PlcSampleRuntime.IsAnyServerRunning ( )
inlineprivate

Is Any Server Running 조건을 확인합니다.

반환값
Is Any Server Running 조건이 충족되면 true이고, 그렇지 않으면 false입니다.

PlcSampleRuntime.cs 파일의 900 번째 라인에서 정의되었습니다.

901 {
902 return _simulatorServer is not null
903 || _mcTcpSimulatorServer is not null
904 || _mcUdpSimulatorServer is not null
905 || _finsTcpSimulatorServer is not null
906 || _finsUdpSimulatorServer is not null;
907 }

다음을 참조함 : _finsTcpSimulatorServer, _finsUdpSimulatorServer, _mcTcpSimulatorServer, _mcUdpSimulatorServer, _simulatorServer.

다음에 의해서 참조됨 : StartProtocolServerAsync(), StopProtocolServerAsync().

이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ NormalizeMode()

string SampleSmart.Pages.PageSub.PlcTabs.PlcSampleRuntime.NormalizeMode ( string? modeText)
inlinestaticprivate

Normalize Mode 작업을 수행합니다.

매개변수
modeTextmode Text에 사용할 string? 값입니다.
반환값
Normalize Mode 작업에서 생성한 string 결과입니다.

PlcSampleRuntime.cs 파일의 933 번째 라인에서 정의되었습니다.

934 {
935 return string.IsNullOrWhiteSpace(modeText)
936 ? "SIMULATORTCP"
937 : modeText.Trim().ToUpperInvariant();
938 }

다음에 의해서 참조됨 : StartProtocolServerAsync().

이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ OnSimulatorServerStatusChanged()

void SampleSmart.Pages.PageSub.PlcTabs.PlcSampleRuntime.OnSimulatorServerStatusChanged ( object? sender,
string e )
inlineprivate

Simulator Server Status Changed 이벤트 또는 상태 변경을 처리합니다.

매개변수
sender이벤트를 발생시킨 객체입니다.
e이벤트와 관련된 데이터를 포함합니다.

PlcSampleRuntime.cs 파일의 964 번째 라인에서 정의되었습니다.

965 {
966 ServerStatus = e;
967 Monitor.StatusMessage = e;
968 }

다음을 참조함 : ServerStatus.

다음에 의해서 참조됨 : StartProtocolServerAsync(), StopProtocolServerAsync().

이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ RunHandshakeTestAsync()

async Task SampleSmart.Pages.PageSub.PlcTabs.PlcSampleRuntime.RunHandshakeTestAsync ( short startValue,
int iterations,
int delayMs,
CancellationToken cancellationToken = default )
inline

Run Handshake Test Async 작업을 수행합니다.

매개변수
startValuestart Value에 사용할 short 값입니다.
iterationsiterations에 사용할 int 값입니다.
delayMsdelay Ms에 사용할 int 값입니다.
cancellationToken취소 요청을 감시하는 토큰입니다.
반환값
Run Handshake Test Async 작업에서 생성한 Task 결과입니다.

PlcSampleRuntime.cs 파일의 724 번째 라인에서 정의되었습니다.

729 {
730 if (iterations <= 0)
731 {
732 Monitor.StatusMessage = "Handshake iterations must be greater than zero.";
733 Monitor.AppendLog("Handshake", "D100/D101", iterations.ToString(), false, Monitor.StatusMessage);
734 return;
735 }
736
737 if (_activeClient.State != PlcConnectionState.Connected)
738 {
739 Monitor.StatusMessage = "Handshake test requires a connected PLC client.";
740 Monitor.AppendLog("Handshake", "D100/D101", string.Empty, false, Monitor.StatusMessage);
741 return;
742 }
743
744 var clientWriteAddress = _addressParser.Parse("D100").Value;
745 var serverResponseAddress = _addressParser.Parse("D101").Value;
746 var value = startValue;
747
748 for (var index = 0; index < iterations; index++)
749 {
750 cancellationToken.ThrowIfCancellationRequested();
751
752 var writeResult = await _activeClient.WriteWordsAsync(clientWriteAddress, [value], cancellationToken).ConfigureAwait(true);
753 if (!writeResult.IsSuccess)
754 {
755 Monitor.StatusMessage = writeResult.Message ?? "Handshake write failed.";
756 Monitor.AppendLog("HandshakeWrite", "D100", value.ToString(), false, Monitor.StatusMessage);
757 return;
758 }
759
760 var rawExpected = value + 1;
761 if (rawExpected > short.MaxValue)
762 {
763 Monitor.StatusMessage = $"Handshake stopped before 16-bit overflow. last={value}, next={rawExpected}.";
764 Monitor.AppendLog("Handshake", "D100/D101", $"last={value}, next={rawExpected}", false, Monitor.StatusMessage);
765 return;
766 }
767
768 var expected = (short)rawExpected;
769 var readResult = await _activeClient.ReadWordsAsync(serverResponseAddress, 1, cancellationToken).ConfigureAwait(true);
770 var actual = readResult.Value is { Length: > 0 } ? readResult.Value[0] : short.MinValue;
771 if (!readResult.IsSuccess || actual != expected)
772 {
773 Monitor.StatusMessage = readResult.IsSuccess
774 ? $"Handshake mismatch. expected={expected}, actual={actual}."
775 : readResult.Message ?? "Handshake read failed.";
776 Monitor.AppendLog("HandshakeRead", "D101", $"expected={expected}, actual={actual}", false, Monitor.StatusMessage);
777 return;
778 }
779
780 Monitor.StatusMessage = $"Handshake OK {index + 1}/{iterations}. D100={value}, D101={actual}";
781 Monitor.AppendLog("Handshake", "D100/D101", $"{value}->{actual}", true, Monitor.StatusMessage);
782 value = actual;
783
784 if (delayMs > 0)
785 {
786 await Task.Delay(delayMs, cancellationToken).ConfigureAwait(true);
787 }
788 }
789 }

다음을 참조함 : _activeClient, _addressParser, Monitor.

◆ StartProtocolServerAsync()

async Task SampleSmart.Pages.PageSub.PlcTabs.PlcSampleRuntime.StartProtocolServerAsync ( string modeText,
string host,
int port )
inline

선택된 모드에 맞는 PLC Protocol Simulator Server를 시작합니다.

매개변수
modeText서버 모드입니다. SimulatorTcp, McTcp, McUdp를 사용합니다.
hostBind Host입니다.
portBind Port입니다.
반환값
Start Protocol Server Async 작업에서 생성한 Task 결과입니다.

PlcSampleRuntime.cs 파일의 488 번째 라인에서 정의되었습니다.

489 {
490 var mode = NormalizeMode(modeText);
491 if (IsAnyServerRunning())
492 {
493 ServerStatus = $"Server already running. mode={_activeServerMode}. Stop the current server first.";
494 Monitor.StatusMessage = ServerStatus;
495 return;
496 }
497
498 switch (mode)
499 {
500 case "SIMULATORTCP":
501 _simulatorServer = new PlcSimulatorServer(new PlcSimulatorServerOptions
502 {
503 Host = host,
504 Port = port,
505 EnableAutoWordResponse = true,
506 AutoResponseTriggerAddress = "D100",
507 AutoResponseAddress = "D101",
508 AutoResponseIncrement = 1
509 });
510
511 _simulatorServer.StatusChanged += OnSimulatorServerStatusChanged;
512 await _simulatorServer.StartAsync();
513 _activeServerMode = "SimulatorTcp";
514 break;
515
516 case "MCTCP":
517 _mcTcpSimulatorServer = new MitsubishiMcTcpSimulatorServer(CreateMcSimulatorOptions(host, port));
518 _mcTcpSimulatorServer.StatusChanged += OnSimulatorServerStatusChanged;
519 await _mcTcpSimulatorServer.StartAsync();
520 _activeServerMode = "McTcp";
521 break;
522
523 case "MCUDP":
524 _mcUdpSimulatorServer = new MitsubishiMcUdpSimulatorServer(CreateMcSimulatorOptions(host, port));
525 _mcUdpSimulatorServer.StatusChanged += OnSimulatorServerStatusChanged;
526 await _mcUdpSimulatorServer.StartAsync();
527 _activeServerMode = "McUdp";
528 break;
529
530 case "FINSTCP":
531 _finsTcpSimulatorServer = new OmronFinsTcpSimulatorServer(CreateFinsSimulatorOptions(host, port));
532 _finsTcpSimulatorServer.StatusChanged += OnSimulatorServerStatusChanged;
533 await _finsTcpSimulatorServer.StartAsync();
534 _activeServerMode = "FinsTcp";
535 break;
536
537 case "FINSUDP":
538 _finsUdpSimulatorServer = new OmronFinsUdpSimulatorServer(CreateFinsSimulatorOptions(host, port));
539 _finsUdpSimulatorServer.StatusChanged += OnSimulatorServerStatusChanged;
540 await _finsUdpSimulatorServer.StartAsync();
541 _activeServerMode = "FinsUdp";
542 break;
543
544 default:
545 Monitor.StatusMessage = "Server mode must be SimulatorTcp, McTcp, McUdp, FinsTcp, or FinsUdp.";
546 return;
547 }
548
549 ServerStatus = $"{_activeServerMode} server running. {host}:{port}";
550 Monitor.StatusMessage = ServerStatus;
551 }

다음을 참조함 : _activeServerMode, _finsTcpSimulatorServer, _finsUdpSimulatorServer, _mcTcpSimulatorServer, _mcUdpSimulatorServer, _simulatorServer, CreateFinsSimulatorOptions(), CreateMcSimulatorOptions(), IsAnyServerRunning(), NormalizeMode(), OnSimulatorServerStatusChanged(), ServerStatus.

다음에 의해서 참조됨 : StartSimulatorServerAsync().

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:
이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ StartSimulatorServerAsync()

Task SampleSmart.Pages.PageSub.PlcTabs.PlcSampleRuntime.StartSimulatorServerAsync ( string host,
int port )
inline

이전 호환성을 위해 SimulatorTcp 서버를 시작합니다.

매개변수
hostBind Host입니다.
portBind Port입니다.
반환값
Start Simulator Server Async 작업에서 생성한 Task 결과입니다.

PlcSampleRuntime.cs 파일의 650 번째 라인에서 정의되었습니다.

651 {
652 return StartProtocolServerAsync("SimulatorTcp", host, port);
653 }

다음을 참조함 : StartProtocolServerAsync().

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

◆ StopProtocolServerAsync()

async Task SampleSmart.Pages.PageSub.PlcTabs.PlcSampleRuntime.StopProtocolServerAsync ( )
inline

실행 중인 PLC Protocol Simulator Server를 중지합니다.

반환값
Stop Protocol Server Async 작업에서 생성한 Task 결과입니다.

PlcSampleRuntime.cs 파일의 569 번째 라인에서 정의되었습니다.

570 {
571 if (!IsAnyServerRunning())
572 {
573 ServerStatus = "Server stopped.";
574 Monitor.StatusMessage = ServerStatus;
575 return;
576 }
577
578 if (_simulatorServer is not null)
579 {
580 _simulatorServer.StatusChanged -= OnSimulatorServerStatusChanged;
581 await _simulatorServer.StopAsync();
582 _simulatorServer = null;
583 }
584
585 if (_mcTcpSimulatorServer is not null)
586 {
587 _mcTcpSimulatorServer.StatusChanged -= OnSimulatorServerStatusChanged;
588 await _mcTcpSimulatorServer.StopAsync();
589 _mcTcpSimulatorServer = null;
590 }
591
592 if (_mcUdpSimulatorServer is not null)
593 {
594 _mcUdpSimulatorServer.StatusChanged -= OnSimulatorServerStatusChanged;
595 await _mcUdpSimulatorServer.StopAsync();
596 _mcUdpSimulatorServer = null;
597 }
598
599 if (_finsTcpSimulatorServer is not null)
600 {
601 _finsTcpSimulatorServer.StatusChanged -= OnSimulatorServerStatusChanged;
602 await _finsTcpSimulatorServer.StopAsync();
603 _finsTcpSimulatorServer = null;
604 }
605
606 if (_finsUdpSimulatorServer is not null)
607 {
608 _finsUdpSimulatorServer.StatusChanged -= OnSimulatorServerStatusChanged;
609 await _finsUdpSimulatorServer.StopAsync();
610 _finsUdpSimulatorServer = null;
611 }
612
613 _activeServerMode = string.Empty;
614 ServerStatus = "Server stopped.";
615 Monitor.StatusMessage = ServerStatus;
616 }

다음을 참조함 : _activeServerMode, _finsTcpSimulatorServer, _finsUdpSimulatorServer, _mcTcpSimulatorServer, _mcUdpSimulatorServer, _simulatorServer, IsAnyServerRunning(), OnSimulatorServerStatusChanged(), ServerStatus.

다음에 의해서 참조됨 : StopSimulatorServerAsync().

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:
이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ StopSimulatorServerAsync()

Task SampleSmart.Pages.PageSub.PlcTabs.PlcSampleRuntime.StopSimulatorServerAsync ( )
inline

이전 호환성을 위해 실행 중인 서버를 중지합니다.

반환값
Stop Simulator Server Async 작업에서 생성한 Task 결과입니다.

PlcSampleRuntime.cs 파일의 671 번째 라인에서 정의되었습니다.

672 {
673 return StopProtocolServerAsync();
674 }

다음을 참조함 : StopProtocolServerAsync().

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

◆ UseInMemoryClient()

void SampleSmart.Pages.PageSub.PlcTabs.PlcSampleRuntime.UseInMemoryClient ( )
inline

InMemory PLC Client를 모니터에 연결합니다.

PlcSampleRuntime.cs 파일의 199 번째 라인에서 정의되었습니다.

200 {
201 _activeClient = _inMemoryClient;
202 Monitor.SetClient(_inMemoryClient, "InMemory PLC");
203 Monitor.StatusMessage = "InMemory PLC client selected.";
204 }

다음을 참조함 : _activeClient, _inMemoryClient, Monitor.

◆ UseMitsubishiMcClient()

void SampleSmart.Pages.PageSub.PlcTabs.PlcSampleRuntime.UseMitsubishiMcClient ( string host,
int port,
string transportText,
int retryCount )
inline

Mitsubishi MC Client를 모니터에 연결합니다.

매개변수
hostPLC Host입니다.
portPLC Port입니다.
transportTextTransport 문자열입니다. Tcp 또는 Udp를 사용합니다.
retryCount송수신 재시도 횟수입니다.

PlcSampleRuntime.cs 파일의 284 번째 라인에서 정의되었습니다.

285 {
286 if (!Enum.TryParse<MitsubishiMcTransportType>(transportText, ignoreCase: true, out var transportType))
287 {
288 Monitor.StatusMessage = "MC transport must be Tcp or Udp.";
289 return;
290 }
291
292 _mitsubishiMcClient = new MitsubishiMcPlcClient(new MitsubishiMcConnectionOptions
293 {
294 Host = host,
295 Port = port,
296 TransportType = transportType,
297 RetryCount = Math.Max(1, retryCount),
298 ConnectTimeoutMs = 3000,
299 ReceiveTimeoutMs = 3000,
300 SendTimeoutMs = 3000
301 });
302
303 _activeClient = _mitsubishiMcClient;
304 Monitor.SetClient(_mitsubishiMcClient, $"Mitsubishi MC {transportType} ({host}:{port})");
305 Monitor.StatusMessage = $"Mitsubishi MC {transportType} client selected.";
306 }

다음을 참조함 : _activeClient, _mitsubishiMcClient, Monitor.

◆ UseMitsubishiMxComponentClient()

void SampleSmart.Pages.PageSub.PlcTabs.PlcSampleRuntime.UseMitsubishiMxComponentClient ( string progId,
int logicalStationNumber )
inline

Mitsubishi MX Component Client를 모니터에 연결합니다.

매개변수
progIdMX Component ProgID입니다.
logicalStationNumberMX Component logical station number입니다.

PlcSampleRuntime.cs 파일의 398 번째 라인에서 정의되었습니다.

399 {
400 _mitsubishiMxComponentClient = new MitsubishiMxComponentPlcClient(new MitsubishiMxComponentOptions
401 {
402 ProgId = string.IsNullOrWhiteSpace(progId) ? MitsubishiMxComponentOptions.DefaultProgId : progId.Trim(),
403 LogicalStationNumber = logicalStationNumber
404 });
405
406 _activeClient = _mitsubishiMxComponentClient;
407 Monitor.SetClient(_mitsubishiMxComponentClient, $"Mitsubishi MX Component LS={logicalStationNumber}");
408 Monitor.StatusMessage = "Mitsubishi MX Component client selected. Vendor runtime must be installed before Connect.";
409 }

다음을 참조함 : _activeClient, _mitsubishiMxComponentClient, Monitor.

◆ UseOmronCxComponentClient()

void SampleSmart.Pages.PageSub.PlcTabs.PlcSampleRuntime.UseOmronCxComponentClient ( string progId,
string peerAddress )
inline

Omron CX-Compolet Client를 모니터에 연결합니다.

매개변수
progIdCX-Compolet ProgID입니다.
peerAddressPLC peer address입니다.

PlcSampleRuntime.cs 파일의 435 번째 라인에서 정의되었습니다.

436 {
437 _omronCxComponentClient = new OmronCxComponentPlcClient(new OmronCxComponentOptions
438 {
439 ProgId = string.IsNullOrWhiteSpace(progId) ? "OMRON.Compolet.CJ2Compolet" : progId.Trim(),
440 PeerAddress = string.IsNullOrWhiteSpace(peerAddress) ? "127.0.0.1" : peerAddress.Trim()
441 });
442
443 _activeClient = _omronCxComponentClient;
444 Monitor.SetClient(_omronCxComponentClient, $"Omron CX-Compolet ({peerAddress})");
445 Monitor.StatusMessage = "Omron CX-Compolet client selected. Vendor runtime must be installed before Connect.";
446 }

다음을 참조함 : _activeClient, _omronCxComponentClient, Monitor.

◆ UseOmronFinsClient()

void SampleSmart.Pages.PageSub.PlcTabs.PlcSampleRuntime.UseOmronFinsClient ( string host,
int port,
string transportText,
int retryCount )
inline

Omron FINS Client를 모니터에 연결합니다.

매개변수
hostPLC Host입니다.
portPLC Port입니다.
transportTextTransport 문자열입니다. Tcp 또는 Udp를 사용합니다.
retryCount송수신 재시도 횟수입니다.

PlcSampleRuntime.cs 파일의 349 번째 라인에서 정의되었습니다.

350 {
351 if (!Enum.TryParse<OmronFinsTransportType>(transportText, ignoreCase: true, out var transportType))
352 {
353 Monitor.StatusMessage = "FINS transport must be Tcp or Udp.";
354 return;
355 }
356
357 _omronFinsClient = new OmronFinsPlcClient(new OmronFinsConnectionOptions
358 {
359 Host = host,
360 Port = port,
361 TransportType = transportType,
362 RetryCount = Math.Max(1, retryCount),
363 ConnectTimeoutMs = 3000,
364 ReceiveTimeoutMs = 3000,
365 DestinationNode = 0x00,
366 SourceNode = 0x01
367 });
368
369 _activeClient = _omronFinsClient;
370 Monitor.SetClient(_omronFinsClient, $"Omron FINS {transportType} ({host}:{port})");
371 Monitor.StatusMessage = $"Omron FINS {transportType} client selected.";
372 }

다음을 참조함 : _activeClient, _omronFinsClient, Monitor.

◆ UseSimulatorTcpClient()

void SampleSmart.Pages.PageSub.PlcTabs.PlcSampleRuntime.UseSimulatorTcpClient ( string host,
int port )
inline

TCP Simulator Client를 모니터에 연결합니다.

매개변수
host서버 Host입니다.
port서버 Port입니다.

PlcSampleRuntime.cs 파일의 230 번째 라인에서 정의되었습니다.

231 {
232 _simulatorClient = new PlcSimulatorTcpClient(new PlcSimulatorClientOptions
233 {
234 Host = host,
235 Port = port
236 });
237
238 _activeClient = _simulatorClient;
239 Monitor.SetClient(_simulatorClient, $"PLC Simulator TCP Client ({host}:{port})");
240 Monitor.StatusMessage = "PLC Simulator TCP client selected.";
241 }

다음을 참조함 : _activeClient, _simulatorClient, Monitor.

멤버 데이터 문서화

◆ _activeClient

IPlcClient SampleSmart.Pages.PageSub.PlcTabs.PlcSampleRuntime._activeClient
private

active Client 값을 보관합니다.

PlcSampleRuntime.cs 파일의 56 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : PlcSampleRuntime(), RunHandshakeTestAsync(), UseInMemoryClient(), UseMitsubishiMcClient(), UseMitsubishiMxComponentClient(), UseOmronCxComponentClient(), UseOmronFinsClient(), UseSimulatorTcpClient().

◆ _activeServerMode

string SampleSmart.Pages.PageSub.PlcTabs.PlcSampleRuntime._activeServerMode = string.Empty
private

active Server Mode 값을 보관합니다.

PlcSampleRuntime.cs 파일의 155 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : StartProtocolServerAsync(), StopProtocolServerAsync().

◆ _addressParser

readonly DefaultPlcAddressParser SampleSmart.Pages.PageSub.PlcTabs.PlcSampleRuntime._addressParser = new()
private

address Parser 값을 보관합니다.

PlcSampleRuntime.cs 파일의 47 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : RunHandshakeTestAsync().

◆ _finsTcpSimulatorServer

OmronFinsTcpSimulatorServer? SampleSmart.Pages.PageSub.PlcTabs.PlcSampleRuntime._finsTcpSimulatorServer
private

fins Tcp Simulator Server 값을 보관합니다.

PlcSampleRuntime.cs 파일의 92 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : IsAnyServerRunning(), StartProtocolServerAsync(), StopProtocolServerAsync().

◆ _finsUdpSimulatorServer

OmronFinsUdpSimulatorServer? SampleSmart.Pages.PageSub.PlcTabs.PlcSampleRuntime._finsUdpSimulatorServer
private

fins Udp Simulator Server 값을 보관합니다.

PlcSampleRuntime.cs 파일의 101 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : IsAnyServerRunning(), StartProtocolServerAsync(), StopProtocolServerAsync().

◆ _inMemoryClient

readonly InMemoryPlcClient SampleSmart.Pages.PageSub.PlcTabs.PlcSampleRuntime._inMemoryClient = new()
private

in Memory Client 값을 보관합니다.

PlcSampleRuntime.cs 파일의 38 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : PlcSampleRuntime(), UseInMemoryClient().

◆ _mcTcpSimulatorServer

MitsubishiMcTcpSimulatorServer? SampleSmart.Pages.PageSub.PlcTabs.PlcSampleRuntime._mcTcpSimulatorServer
private

mc Tcp Simulator Server 값을 보관합니다.

PlcSampleRuntime.cs 파일의 74 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : IsAnyServerRunning(), StartProtocolServerAsync(), StopProtocolServerAsync().

◆ _mcUdpSimulatorServer

MitsubishiMcUdpSimulatorServer? SampleSmart.Pages.PageSub.PlcTabs.PlcSampleRuntime._mcUdpSimulatorServer
private

mc Udp Simulator Server 값을 보관합니다.

PlcSampleRuntime.cs 파일의 83 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : IsAnyServerRunning(), StartProtocolServerAsync(), StopProtocolServerAsync().

◆ _mitsubishiMcClient

MitsubishiMcPlcClient? SampleSmart.Pages.PageSub.PlcTabs.PlcSampleRuntime._mitsubishiMcClient
private

mitsubishi Mc Client 값을 보관합니다.

PlcSampleRuntime.cs 파일의 119 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : UseMitsubishiMcClient().

◆ _mitsubishiMxComponentClient

MitsubishiMxComponentPlcClient? SampleSmart.Pages.PageSub.PlcTabs.PlcSampleRuntime._mitsubishiMxComponentClient
private

mitsubishi Mx Component Client 값을 보관합니다.

PlcSampleRuntime.cs 파일의 128 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : UseMitsubishiMxComponentClient().

◆ _omronCxComponentClient

OmronCxComponentPlcClient? SampleSmart.Pages.PageSub.PlcTabs.PlcSampleRuntime._omronCxComponentClient
private

omron Cx Component Client 값을 보관합니다.

PlcSampleRuntime.cs 파일의 146 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : UseOmronCxComponentClient().

◆ _omronFinsClient

OmronFinsPlcClient? SampleSmart.Pages.PageSub.PlcTabs.PlcSampleRuntime._omronFinsClient
private

omron Fins Client 값을 보관합니다.

PlcSampleRuntime.cs 파일의 137 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : UseOmronFinsClient().

◆ _simulatorClient

PlcSimulatorTcpClient? SampleSmart.Pages.PageSub.PlcTabs.PlcSampleRuntime._simulatorClient
private

simulator Client 값을 보관합니다.

PlcSampleRuntime.cs 파일의 110 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : UseSimulatorTcpClient().

◆ _simulatorServer

PlcSimulatorServer? SampleSmart.Pages.PageSub.PlcTabs.PlcSampleRuntime._simulatorServer
private

simulator Server 값을 보관합니다.

PlcSampleRuntime.cs 파일의 65 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : IsAnyServerRunning(), StartProtocolServerAsync(), StopProtocolServerAsync().

속성 문서화

◆ Monitor

PlcMonitorViewModel SampleSmart.Pages.PageSub.PlcTabs.PlcSampleRuntime.Monitor
get

PLC Monitor ViewModel입니다.

PlcSampleRuntime.cs 파일의 179 번째 라인에서 정의되었습니다.

179{ get; }

다음에 의해서 참조됨 : PlcSampleRuntime(), RunHandshakeTestAsync(), UseInMemoryClient(), UseMitsubishiMcClient(), UseMitsubishiMxComponentClient(), UseOmronCxComponentClient(), UseOmronFinsClient(), UseSimulatorTcpClient().

◆ ServerStatus

string SampleSmart.Pages.PageSub.PlcTabs.PlcSampleRuntime.ServerStatus = "Server stopped."
getprivate set

PLC Simulator 서버 상태 메시지입니다.

PlcSampleRuntime.cs 파일의 189 번째 라인에서 정의되었습니다.

189{ get; private set; } = "Server stopped.";

다음에 의해서 참조됨 : OnSimulatorServerStatusChanged(), StartProtocolServerAsync(), StopProtocolServerAsync().


이 클래스에 대한 문서화 페이지는 다음의 파일로부터 생성되었습니다.: