Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
en:sw:02-apis:02-modbus-tcp [2020/05/15 08:06]
avsetula
en:sw:02-apis:02-modbus-tcp [2021/05/07 08:26]
avsetula
Line 1: Line 1:
 ======%hide Modbus TCP ====== ======%hide Modbus TCP ======
 ~~NOTOC~~ ​ ~~NOTOC~~ ​
-uhhfciujds 
 ====== Modbus TCP Server ====== ====== Modbus TCP Server ======
 +<WRAP group>
 +<WRAP half column 81%>
 Modbus TCP is standard interface to interact with the IOs of Unipi PLCs. Each PLC has its own mapping of I/O to a Modbus Register or Coil which can be downloaded from the [[files:​products:​00-start|Products section.]] Modbus TCP is standard interface to interact with the IOs of Unipi PLCs. Each PLC has its own mapping of I/O to a Modbus Register or Coil which can be downloaded from the [[files:​products:​00-start|Products section.]]
 +</​WRAP>​
 +<WRAP half column 15%>
 +;;#
 +<​html><​span class="​dev-tag dev-patron">​Patron</​span></​html>​ \\
 +<​html><​span class="​dev-tag dev-neuron">​Neuron</​span></​html>​ \\
 +<​html><​span class="​dev-tag dev-axon">​Axon</​span></​html>​
 +;;#
 +</​WRAP>​
 +</​WRAP>​
  
-<WRAP center round info 60%>+<WRAP center round info 90%>
 1Wire devices are not mapped to Modbus TCP and have to be implemented differently,​ eg. using OWFS. 1Wire devices are not mapped to Modbus TCP and have to be implemented differently,​ eg. using OWFS.
-</W +</WRAP> 
-RAP+ 
-==== Systemd service ==== + 
-The Modbus TCP server interface is provided by a unipitcp service. By default, the server only listening ​to request on the local loopback ​and requests ​from other hosts are forbidden due to security reasons. To change this, the unipitcp has to be run with the parameter "​-l 0.0.0.0"​ (-L). If you wish, you can also change the listening port in parameter -p to a different one.+===== Storage life status ===== 
 +There are also registers indicating storage status for all Unipi controllers (except Unipi 1.1) that are available on the Modbus TCP server: 
 +  * <html><span class="​kbBlueText">​Erase cycles used [%]</​span></​html>​ -> indicates the number of memory erase cycles compared to the maximum cycles (in percent) 
 +  * <​html><​span class="​kbBlueText">​Good blocks [%]</​span></​html>​ -> indicates the number of blocks that are all right (in percent) 
 + 
 +For Neuron units, there is also the number of power cycles (on/off) available with the current SD card, or the name of the card manufacturer'​s detection. For Neuron units, only a limited selection of SD cards is supported for these features. 
 + 
 + 
 +===== Systemd service ​===== 
 +The Modbus TCP server interface is provided by a unipitcp service. By default, the server only listens ​to request on the local loopback. Requests ​from other hosts than 127.0.0.1 ​are forbidden due to security reasons. To change this, the unipitcp has to be run with the parameter "​-l 0.0.0.0"​ (-L). If you wish, you can also change the listening port in parameter -p to a different one than the default 502.
  
 <​code>​ <​code>​
-/opt/unipi-bin/​unipi_tcp_server -p 502 -l 0.0.0.0+/opt/unipi/tools/​unipi_tcp_server -p 503 -l 0.0.0.0
 </​code>​ </​code>​
  
-To make the change permanent, modify the service script in /lib/systemd/system/​unipitcp.service and reload ​and restart the service by <​code>​systemctl daemon-reload</​code>​ and <​code>​systemctl restart unipitcp</​code>​+To make the change permanent, modify the default configuration file **/etc/default/unipi-modbus-tools** ​and restart the service by <​code>​systemctl restart unipitcp</​code>​