Industrielle styresystemer - Wiki
...
TCP vs UDP: Differences between the protocols. The main difference between TCP (transmission control protocol) and UDP (user datagram protocol) is that TCP is a connection-based protocol and UDP is connectionless. While TCP is more reliable, it transfers data more slowly. UDP is less reliable but works more quickly.
Advantages | Disadvantages |
---|---|
Easy to use | Uses UDP protocol, UDP provides a simpler and less reliable form of data transmission |
Data transmission efficiency: NVL sends data in packets | Delivery is not guaranteed |
Absence of a main node: NVL does not have a binding to a main or subordinate node, making it more flexible in usage and management | Only UDP protocol or it's limited protocol support |
Optional data reading: Since data can be available to all nodes, there is no guarantee that all nodes will read or use this data |
Advantages | Disadvantages |
---|---|
Reliability: Modbus TCP protocol ensures reliable data transmission with acknowledgment of receipt | Use of master and slave in data transmission |
Wide support | Limited data transmission speed: More complex data transmission protocol. |
Delivery is guaranteed |
...
A Modbus address is a 16-bit unsigned integer that is transmitted with every request to indicate which data should be read or written. Address occupies two characters in the Modbus message and the most significant byte is sent first (big-endian).
Functions code | Functions | Spesifics | |
---|---|---|---|
FC01 | Read Coils | This function code allows the master to query the state of slave’s coils. | A read coils request is always 8 bytes long. A read coils response is at least 6 bytes long. |
FC02 | Read Discrete Inputs | This function code allows the master to query the state of slave’s discrete inputs. | A read discrete inputs request is always 8 bytes long. A read discrete inputs response is at least 6 bytes long. |
FC03 | Read Holding Registers | This function code allows the master to query the state of slave’s holding registers. | A read holding registers request is always 8 bytes long. A read holding registers response is at least 7 bytes long. |
FC04 | Read Input Registers | With this function code, master queries the state of slave’s input registers. | A read input registers request is always 8 bytes long. A read holding registers response is at least 7 bytes long. |
FC05 | Write Single Coil | Sets the value of a single slave’s coil. | A write single coil request is always 8 bytes long. response? |
FC15 | Write Multiple Coils | Sets the value of a single slave’s holding register. | |
FC06 | Write Single Register | Sets the value of a consecutive range of slave’s coils. | |
FC16 | Write Multiple Registers | Sets the value of a consecutive range of slave’s holding registers. | |
FC23 | Read/Write Multiple Registers | It combines reading and writing functions, allowing the master to read and write values of multiple holding registers in a single request |
To send and receive data we need to use 2 channels:
Start configuration with a client/master Modbus TCP Client/Master
...