File: README.md

package info (click to toggle)
golang-github-goburrow-modbus 0.1.0-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 204 kB
  • sloc: ansic: 87; makefile: 2
file content (24 lines) | stat: -rw-r--r-- 559 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
System testing for [modbus library](https://github.com/goburrow/modbus)

Modbus simulator
----------------
*   [Diagslave](http://www.modbusdriver.com/diagslave.html)
*   [socat](http://www.dest-unreach.org/socat/)

```bash
# TCP
$ diagslave -m tcp -p 5020

# RTU/ASCII
$ socat -d -d pty,raw,echo=0 pty,raw,echo=0
2015/04/03 12:34:56 socat[2342] N PTY is /dev/pts/6
2015/04/03 12:34:56 socat[2342] N PTY is /dev/pts/7
$ diagslave -m ascii /dev/pts/7

# Or
$ diagslave -m rtu /dev/pts/7

$ go test -v -run TCP
$ go test -v -run RTU
$ go test -v -run ASCII
```