modbus-poll modbus-slave and tool of learning to use - built environment

In modbus learning tools, non modbus-poll modbus-slave and none other than the process on a computer simulation, both are indispensable, of course, also need virtual serial port tool: Configure Virtual Serial Port Driver, so you can create virtual serial, rather than physical serial port.

Online software can be used are, of course, can use harmony, learning only. After learning well, you can customize the PC, so to avoid copyright disputes.

1, Configure Virtual Serial Port Driver create virtual serial port:

add pair can be easy to use.

 

2, modbus-slave connection:

 

3, modbus-poll connection:

 

 

Two serial ports are not the same, it should be noted:

4, communication settings:

slave ID that is the address of the slave, the range is 1 to 127,

The function code is 1: reading coil / discrete output state

modbus protocol address is the address of the register, refer to the following:

 

 Protocol address at the end incentive poll shows that while 3x, 4x, 1x, 0x four types of address, but in the agreement, are starting from zero, because of the different function codes, they will not clash.

0 represents a register address 0x0001 (Case coil state).

 

 quantity = 10, the display 10 is the data interface, after each click ok, as follows:

 

 Although they still open up the same, but in fact every 1s, poll sends information to the slave side, the slave terminal receives the data, the data is returned immediately, you can> communication view through display- units:

 

 

 So far, the communication can be simulated by two modbus software, of course, there are many details - see modbus follow-up article.

This article merely "We must first of its profits" of the device. After all, you can not make bricks without straw.

Guess you like

Origin www.cnblogs.com/CodeWorkerLiMing/p/11831507.html