GithubHelp home page GithubHelp logo

iotopo / go-mcprotocol Goto Github PK

View Code? Open in Web Editor NEW

This project forked from future-architect/go-mcprotocol

0.0 0.0 0.0 47 KB

MC Protocol(MELSEC Communication Protocol) client implementation for golang

License: Apache License 2.0

Go 100.00%

go-mcprotocol's Introduction

go-mcprotocol

go-mcprotocol is a library for PLC (Programmable Logic Controller) access

Project Status

Work In Progress

Usage for Library

You can read plc register bellow codes.

	client, _ := mcp.New3EClient(opts.Host, opts.Port, mcp.NewLocalStation())
	read, _ := client.Read("D", 100, 3)
	registerBinary, _ := mcp.NewParser().Do(read)

	fmt.Println(string(registerBinary.Payload))

Health Check

	if err := client.HealthCheck(); err != nil {
		log.Fatalf("failed health check for plc: %v", err)
	}

Usage Tool

Output file format

Format is CSV. Items are timestamp and Base64 encoded MC Protocol response.

2019-10-07T07:08:00.3623052Z,0AAA//8DAAwAAAAAAAAAAAAAAAAA
2019-10-07T07:08:00.8622182Z,0AAA//8DAAwAAAAAAAAAAAAAAAAA
2019-10-07T07:08:01.3616205Z,0AAA//8DAAwAAAAAAAAAAAAAAAAA
...

Usage for tool

Collect the register values​of PLC by MC Protocol(MELSEC Communication Protocol). This tools is gather plc register data and dump local files.

Examples

$ plcmirror -H <Your PLC Host> -P <Your PLC Port> --device D --offset 100 --num 10 --dir /var/log/plcmirror

Options

> plcmirror -help
  Usage:
    plcmirror [OPTIONS]
  
  Application Options:
    /H, /host:      PLC hostname
    /P, /port:      Melsec communication protocol port number
    /D, /device:    Register name like D that is mirror target
    /O, /offset:    PLC register offset addr that is mirror target
    /N, /num:       number of device points
        /dir:       file output path (default: .)
    /I, /interval:  mirroring interval [milli sec] (default: 500)
  
  Help Options:
    /?              Show this help message
    /h, /help       Show this help message

License

Apache 2

go-mcprotocol's People

Contributors

ma91n avatar d-tsuji avatar maito1201 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.