ZLAN1043 is a single-chip Ethernet to serial port chip. In addition, it also has the functions of Modbus TCP to RTU, timing sending heartbeat packet, sending registration packet, JSON to Modbus RTU, MQTT gateway, etc. This paper mainly introduces the network IO control function of ZLAN1043.
The network IO controller is a kind of device that controls the digital output (DO) by reading the digital input (DI) of the device through the network port. The finished devices, such as ZLAN6042 (4 channel DI/DO controller), ZLAN6842 (8 channel DI/DO controller), etc. This paper introduces method of how to design similar products ZLAN6042, ZLAN6842 with ZLAN1043 chip.
ZLAN1043 Design Network IO controller advantages include:
1. As long as a core chip with some resistors and capacitors, DI/DO can be achieved. Simple to use, high cost performance.
2. No complex network programming, pure hardware design, only need to configure various DI/DO input corresponding network port instructions.
3. Network control instructions can be customized, and Modbus instructions are the most commonly used.
4. Currently 8 DI/DO is supported (DI/DO adds up to 8). DI/DO can be defined in use.
The reference schematic diagram of network IO is shown in Figure 2 and Figure 3.
It can be seen from the above circuit diagram that ZLAN1043 is used to design the IO controller of the network port, and only 3.3V and 1.8V power supply and network port are provided externally. Refer to the documentation for pin definitions for the 8 GPIO. When used as input, GPIO can be pulled up by 1K; When it is the output, please use triode, Darlington tube, etc. for current amplification when driving large current devices such as drive relays.
Define the 8 pins provided as PIN[1]... PIN [8]. Using the configuration tool ZLVircom, you can set each pin as input or output. If it is input, the format of network query and return instructions can be Modbus TCP or custom protocol; if it is custom protocol, the format of custom command is input. Can set the format of network control instructions corresponding to high level and low level output to control PIN[1]... PIN[8].
After the design is completed, the design file is downloaded to the ZLAN1043 chip through the network port. After the power is restored, the chip will accept the network command just designed to realize the network DI/DO function.
If the device and the computer are inside the LAN, it is recommended to configure the chip to work in TCP server mode (default mode). If the controlled server is on the public network and has public network IP, it is recommended to use TCP client mode and configure ZLAN1043 to connect to the public network server.
If using P2P mode for remote IO input/output please use ZLAN1043N chip. For the use of P2P, please refer to ZLAN P2P related documents.