프로그램 사용/libmodbus
mbpoll
구차니
2025. 8. 6. 15:36
modpoll을 매번 받아서 쓰기 싫어서 패키지로 있는지 보는데, 이름도 비슷한 mbpoll을 ai 님께서 추천!
그나저나 도움말이 왜이렇게 유사해 보이지?
[링크 : https://launchpad.net/ubuntu/+source/mbpoll]
[링크 : https://www.modbusdriver.com/]
modpoll/i686-linux-gnu$ ./modpoll --help modpoll 3.10 - FieldTalk(tm) Modbus(R) Master Simulator Copyright (c) 2002-2021 proconX Pty Ltd Visit https://www.modbusdriver.com for Modbus libraries and tools. Usage: modpoll [OPTIONS] SERIALPORT|HOST [WRITEVALUES...] Arguments: SERIALPORT Serial port when using Modbus ASCII or Modbus RTU protocol COM1, COM2 ... on Windows /dev/ttyS0, /dev/ttyS1 ... on Linux HOST Host name or dotted IP address when using MDBUS/TCP protocol WRITEVALUES List of values to be written. If none specified (default) modpoll reads data. General options: -m ascii Modbus ASCII protocol -m rtu Modbus RTU protocol (default if SERIALPORT contains a /) -m tcp MODBUS/TCP protocol (default otherwise) -m udp MODBUS UDP -m enc Encapsulated Modbus RTU over TCP -a # Slave address (1-247 for serial, 0-255 for TCP, 1 is default) -r # Start reference (1-65536, 100 is default) -c # Number of values to read (1-125, 1 is default), optional for writing (use -c 1 to force FC5 or FC6) -t 0 Discrete output (coil) data type -t 1 Discrete input data type -t 3 16-bit input register data type -t 3:hex 16-bit input register data type with hex display -t 3:int 32-bit integer data type in input register table -t 3:mod 32-bit module 10000 data type in input register table -t 3:float 32-bit float data type in input register table -t 4 16-bit output (holding) register data type (default) -t 4:hex 16-bit output (holding) register data type with hex display -t 4:int 32-bit integer data type in output (holding) register table -t 4:mod 32-bit module 10000 type in output (holding) register table -t 4:float 32-bit float data type in output (holding) register table -i Slave operates on big-endian 32-bit integers -f Slave operates on big-endian 32-bit floats -e Use Daniel/Enron single register 32-bit mode (implies -i and -f) -0 First reference is 0 (PDU addressing) instead 1 -1 Poll only once only, otherwise every poll rate interval -l # Poll rate in ms, (1000 is default) -o # Time-out in seconds (0.01 - 10.0, 1.0 s is default) Options for MODBUS/TCP, UDP and RTU over TCP: -p # IP protocol port number (502 is default) Options for Modbus ASCII and Modbus RTU: -b # Baudrate (e.g. 9600, 19200, ...) (19200 is default) -d # Databits (7 or 8 for ASCII protocol, 8 for RTU) -s # Stopbits (1 or 2, 1 is default) -p none No parity -p even Even parity (default) -p odd Odd parity -4 # RS-485 mode, RTS on while transmitting and another # ms after |
$ mbpoll -help usage : mbpoll [ options ] device|host [ writevalues... ] [ options ] ModBus Master Simulator. It allows to read and write in ModBus slave registers connected by serial (RTU only) or TCP. Arguments : device Serial port when using ModBus RTU protocol COM1, COM2 ... on Windows /dev/ttyS0, /dev/ttyS1 ... on Linux /dev/ser1, /dev/ser2 ... on QNX host Host name or dotted IP address when using ModBus/TCP protocol writevalues List of values to be written. If none specified (default) mbpoll reads data. If negative numbers are provided, it will precede the list of data to be written by two dashes ('--'). for example : mbpoll -t4:int /dev/ttyUSB0 -- 123 -1568 8974 -12 General options : -m # mode (rtu or tcp, TCP is default) -a # Slave address (1-255 for rtu, 0-255 for tcp, 1 is default) for reading, it is possible to give an address list separated by commas or colons, for example : -a 32,33,34,36:40 read [32,33,34,36,37,38,39,40] -r # Start reference (1 is default) -c # Number of values to read (1-125, 1 is default) -u Read the description of the type, the current status, and other information specific to a remote device (RTU only) -t 0 Discrete output (coil) data type (binary 0 or 1) -t 1 Discrete input data type (binary 0 or 1) -t 3 16-bit input register data type -t 3:hex 16-bit input register data type with hex display -t 3:int 32-bit integer data type in input register table -t 3:float 32-bit float data type in input register table -t 4 16-bit output (holding) register data type (default) -t 4:hex 16-bit output (holding) register data type with hex display -t 4:int 32-bit integer data type in output (holding) register table -t 4:float 32-bit float data type in output (holding) register table -0 First reference is 0 (PDU addressing) instead 1 -B Big endian word order for 32-bit integer and float -1 Poll only once only, otherwise every poll rate interval -l # Poll rate in ms, ( > 10, 1000 is default) -o # Time-out in seconds (0.01 - 10.00, 1.00 s is default) Options for ModBus / TCP : -p # TCP port number (502 is default) Options for ModBus RTU : -b # Baudrate (1200-921600, 19200 is default) -d # Databits (7 or 8, 8 for RTU) -s # Stopbits (1 or 2, 1 is default) -P # Parity (none, even, odd, even is default) -R RS-485 mode (/RTS on (0) after sending) -F RS-485 mode (/RTS on (0) when sending) -h Print this help summary page -V Print version and exit -v Verbose mode. Causes mbpoll to print debugging messages about its progress. This is helpful in debugging connection... |