QModbusRtuSerialServer Class

QModbusRtuSerialServer 클래스는 모드버스 클라이언트와의 통신에 직렬 포트를 사용하는 모드버스 서버를 나타냅니다. 더 보기...

헤더: #include <QModbusRtuSerialServer>
CMake: find_package(Qt6 REQUIRED COMPONENTS SerialBus)
target_link_libraries(mytarget PRIVATE Qt6::SerialBus)
qmake: QT += serialbus
이후: Qt 6.2
상속합니다: QModbusServer

공용 함수

QModbusRtuSerialServer(QObject *parent = nullptr)
virtual ~QModbusRtuSerialServer()
(since 6.2) int interFrameDelay() const
(since 6.2) void setInterFrameDelay(int microseconds)

재구현된 공용 함수

virtual bool processesBroadcast() const override

재구현된 보호 함수

virtual void close() override
virtual bool open() override
virtual QModbusResponse processRequest(const QModbusPdu &request) override

상세 설명

모드버스를 통한 통신은 단일 모드버스 클라이언트 인스턴스와 여러 모드버스 서버 간의 상호 작용이 필요합니다. 이 클래스는 직렬 포트를 통해 모드버스 서버 구현을 제공합니다.

여러 모드버스 서버 인스턴스가 동시에 (직렬 버스를 사용하여) 모드버스 클라이언트와 상호 작용할 수 있으므로 서버는 serverAddress()로 식별됩니다.

멤버 함수 문서

[explicit] QModbusRtuSerialServer::QModbusRtuSerialServer(QObject *parent = nullptr)

지정된 parent 으로 QModbusRtuSerialServer를 구축합니다. serverAddress 프리셋은 1 입니다.

[virtual noexcept] QModbusRtuSerialServer::~QModbusRtuSerialServer()

QModbusRtuSerialServer 인스턴스를 삭제합니다.

[override virtual protected] void QModbusRtuSerialServer::close()

다시 구현합니다: QModbusDevice::close().

[since 6.2] int QModbusRtuSerialServer::interFrameDelay() const

두 개의 연속된 모드버스 메시지 사이의 무음 간격(마이크로초)을 반환합니다.

이 함수는 Qt 6.2에 도입되었습니다.

setInterFrameDelay()도 참조하십시오 .

[override virtual protected] bool QModbusRtuSerialServer::open()

다시 구현합니다: QModbusDevice::open().

참고: 이 함수를 호출하면 기존 버퍼 데이터가 직렬 포트에서 제거됩니다.

[override virtual protected] QModbusResponse QModbusRtuSerialServer::processRequest(const QModbusPdu &request)

재구현합니다: QModbusServer::processRequest(const QModbusPdu &request).

request 에 지정된 모드버스 클라이언트 요청을 처리하고 모드버스 응답을 반환합니다.

MEI 유형 13(0x0D) CANopen 일반 참조가 있는 모드버스 함수 QModbusRequest::EncapsulatedInterfaceTransport 는 일반적으로 모드버스 TCP 또는 모드버스 직렬 ASCII 전용이므로 필터링됩니다.

RTU 직렬 서버에 대한 요청은 예외 코드 QModbusExceptionResponse::IllegalFunction이 포함된 모드버스 예외 응답으로 응답됩니다.

[override virtual] bool QModbusRtuSerialServer::processesBroadcast() const

재구현합니다: QModbusServer::processesBroadcast() const.

[since 6.2] void QModbusRtuSerialServer::setInterFrameDelay(int microseconds)

두 개의 연속된 모드버스 메시지 사이의 무음 간격에 대해 microseconds 의 양을 설정합니다. 기본적으로 클래스 구현은 모드버스 사양에 따라 미리 계산된 값을 사용합니다. 활성 또는 실행 중인 연결은 이러한 지연 변경의 영향을 받지 않습니다.

참고: microseconds 이 -1로 설정되거나 microseconds 이 사전 계산된 지연보다 작으면 이 사전 계산된 값이 프레임 지연으로 사용됩니다.

이 기능은 Qt 6.2에 도입되었습니다.

interFrameDelay()도 참조하세요 .

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.