{"id":37096622,"url":"https://github.com/wang-laoban/mcprotocol","last_synced_at":"2026-01-14T11:53:26.030Z","repository":{"id":253911004,"uuid":"844897665","full_name":"wang-laoban/McProtocol","owner":"wang-laoban","description":"This code is a pure Go implementation of the McProtocol, which can be used to communicate with Mitsubishi PLCs. ","archived":false,"fork":false,"pushed_at":"2024-08-23T06:59:58.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-08-23T07:34:48.118Z","etag":null,"topics":["go","golang","mcprotocol","mitsubishi","plc"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wang-laoban.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-20T07:20:09.000Z","updated_at":"2024-08-23T07:34:50.003Z","dependencies_parsed_at":"2024-08-23T07:34:47.961Z","dependency_job_id":null,"html_url":"https://github.com/wang-laoban/McProtocol","commit_stats":null,"previous_names":["wang-laoban/mcprotocol"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/wang-laoban/McProtocol","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wang-laoban%2FMcProtocol","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wang-laoban%2FMcProtocol/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wang-laoban%2FMcProtocol/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wang-laoban%2FMcProtocol/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wang-laoban","download_url":"https://codeload.github.com/wang-laoban/McProtocol/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wang-laoban%2FMcProtocol/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28419272,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:47:48.104Z","status":"ssl_error","status_checked_at":"2026-01-14T10:46:19.031Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","golang","mcprotocol","mitsubishi","plc"],"created_at":"2026-01-14T11:53:25.431Z","updated_at":"2026-01-14T11:53:26.025Z","avatar_url":"https://github.com/wang-laoban.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mitsubishi PLC Protocol Library\n\nThis Go library provides an implementation of Mitsubishi PLC communication protocols, specifically the A_1E and Qna_3E protocols. The library currently supports reading and writing methods for these protocols. Batch read/write methods and support for the 4E protocol are planned but not yet implemented.\n\n## Features\n\n- **A_1E Protocol:** Implemented methods for reading and writing data.\n- **Qna_3E Protocol:** Implemented methods for reading and writing data.\n- **Batch Operations:** Planned for future implementation.\n- **4E Protocol:** Planned for future implementation.\n\n## Installation\n\nTo install this library, you can use the following `go get` command:\n\n```sh\ngo get -u github.com/wang-laoban/mcprotocol\n```\n\n## Usage\n\nBelow is an example of how to use this library to connect to a Mitsubishi PLC using the Qna_3E protocol, read a boolean value from a specific memory address, and print the result.\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\tmc \"github.com/wang-laoban/mcprotocol\"\n)\n\nfunc main() {\n\t// Initialize a new Mitsubishi client for the Qna_3E protocol\n\tclient, err := mc.NewMitsubishiClient(mc.Qna_3E, \"127.0.0.1\", 6000, 0)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(\"Start Connecting\")\n\terr = client.Connect()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Read a boolean value from memory address M100\n\tv, err := client.ReadBool(\"M100\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(\"Read bool:\", v)\n}\n```\n\n## Functions and Methods\n### Connecting to PLC\n\n- **NewMitsubishiClient(protocol string, ip string, port int, timeout int):**\n Initializes a new Mitsubishi client with the specified protocol, IP address, port, and timeout.\n- **Connect() error:**\nEstablishes a connection to the PLC.\n\n### Reading and Writing Data\n\n- **ReadBool(address string) (bool, error):**\n Reads a boolean value from the specified memory address.\n\n- **WriteBool(address string, value bool) error:**\nWrites a boolean value to the specified memory address.\n## Contribution\nContributions to the library are welcome. If you find any issues or have suggestions for improvements, feel free to open an issue or submit a pull request.\n\n## License\nThis project is licensed under the MIT License. See the LICENSE file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwang-laoban%2Fmcprotocol","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwang-laoban%2Fmcprotocol","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwang-laoban%2Fmcprotocol/lists"}