Modbus 4 j - Java 버전의 modbus 프로토콜 구현

freeFree Technical Resource

This content is free to read, suitable for basic learning and search traffic.

Modbus 4 j - Java 버전의 modbus 프로토콜 구현

GitHub:

Infin ite Autom aation Systems 와 Ser ot onIn Software 가 Java 로 작성 한 Mod bus 프로토 콜 의 고 성 능 과 사용 편 의 성을 구현 합니다 . AS C II , R TU , TCP 및 U DP 전송 을 슬 레이 브 또는 마스터 로 지원 하며 , 자동 요청 파티 션 및 응답 데이터 형 식 구 문 분석 을 지원 합니다 .

이제 최신 버전 의 공 용 Ma ven 저장 소를 사용하여 pom . x ml 에 추가 할 수 있습니다 .

<리 포 지 토 리>
    <저장 소>
        <릴 리스>
            <enabled>
        </ rele ases>
        <스 냅 샷>
            <enabled>
        </ snap sh ots>
        <id>
        <name>
        <url>
    </ 리 포 지 토 리>
    <저장 소>
        <릴 리스>
            <enabled>
        </ rele ases>
        <스 냅 샷>
            <enabled>
        </ snap sh ots>
        <id>
        <name>
        <url>
    </ 리 포 지 토 리>
</ 리 포 지 토 리>

종 속 성 정보는 다음과 같습니다 .

<종 속 성>
    <groupId>
    <artifactId>
    <version>
</ 의존 성>

코 어 클래 스

  • 호스트 마스터 및 그 하 위 클래 스 : 호스트 의 포 털 , 데이터 스트 림 의 시작 및 끝 .
  • 데이터 포 트 클래 스 Stream Trans port : 데이터 쓰 기 및 읽 기를 담당 합니다 .
  • Mod bus 메시지 클래 스 Mod bus Message 및 그 하 위 클래 스 : Mod bus 정의 를 지원 하는 다양한 메 서 드 (Fun ction Code)
  • 메시지 제어 : 시간 초 과 , 재 시 도 , 기본 값 200 ms , 1 회 를 지원 합니다 .
    • Wa iting Room : 송 수 신 논 리의 동기 화를 담당 합니다 .
    • 출 력 Re quest 메시지 클래 스 : Out go ing Re quest M ess age 및 그 하 위 클래 스 .
    • 수신 된 응답 메시지 클래 스 : In coming Response M ess age 및 그 하 위 클래 스 .
    • Message Par ser : 수신 된 메시지를 분석 합니다 .
  • 프로토 콜 데이터 유형 정의 : Data Ty pe
  • 프로토 콜 기능 코드 정의 : Fun ction Code
  • 프로토 콜 레 지 스터 범위 : Register R ange

데이터 흐름

  1. 透过
  2. 封装需要送信的指令,比如
  3. Master
  4. 透过驱动层,
  5. 기다 리지 않으면 null 을 반환 하고 시간 초 과 에 대한 경고 를 제공합니다 .
  6. もし等到了有效戻る,则

단 위 테스트

mod bus 4 j / sr c _ test / 에서는 일련 의 단 위 테스트 메 서 드를 정의 하여 모 드 bus 프로토 콜 의 실제 작동 흐 름을 이해할 수 있습니다 .

Put this resource to use in a real project?

Go to the Tool Center for message parsing, CRC verification and device debugging, or submit your requirements for selection and integration advice.

Engineer Membership

Turn this article into actionable debugging resources

After activation, you can use advanced message parsing, resource pack downloads, code examples, engineering cases and priority technical support, suitable for real project delivery.

Unlimited Advanced Tools
Resource & Code Packs
Complete Engineering Case Library
Priority Technical Support

Leave a Reply

Your email address will not be published. Required fields are marked *.