Presentation is loading. Please wait.

Presentation is loading. Please wait.

Modbus Serial (Server)

Similar presentations


Presentation on theme: "Modbus Serial (Server)"— Presentation transcript:

1 Modbus Serial (Server)
There are two ways to select ML200 as Modbus server: 1) CPU; 2) Snet I/F module Modbus Serial (S) - CPU - Snet I/F Modbus Serial (C) Modbus TCP/IP (S) - FEnet I/F Modbus TCP/IP (C) 2MLI CPU as Modbus server 1. Configuration 1 Modbus Client 2 There are two ports in 2MLI. One is SoftMaster programming port and the other is the built-in Modbus server port.

2 Modbus Serial (Server)
2. SoftMaster setting Modbus Serial (S) - CPU - Snet I/F Modbus Serial (C) Modbus TCP/IP (S) - FEnet I/F Modbus TCP/IP (C) Double-click 'Basic Parameter' and select 'MODBUS Setup'. Select its communication parameter and set its memory area for Modbus server. Here we set DI area as %MW0000, DO area as %MW0100, AI area as %MW1000 and AO area as %MW2000, which are starting word register.

3 Modbus Serial (Server)
3. Modbus Setup in 2MLI Modbus Serial (S) - CPU - Snet I/F Modbus Serial (C) Modbus TCP/IP (S) - FEnet I/F Modbus TCP/IP (C) As other PLC functions as Modbus client, 2MLI CPU is regarded as Modbus server having Modicon address. ML200 0xxxx (bit output) Read by code 01 Write by 05, 15 1xxxx (bit input) Read by code 02 SoftMaster Basic parameter 4xxxx (word output) Read by 03 Write by 06, 16 3xxxx (word input) Read by 04

4 Modbus Serial (Server)
4. Modbus Function code/memory mapping Modbus Serial (S) - CPU - Snet I/F Modbus Serial (C) Modbus TCP/IP (S) - FEnet I/F Modbus TCP/IP (C) If Modbus client uses function code 06, for example, it will preset 4xxxx-corresponding area of Modbus server device. Now %M area area starting %MW2000 is set as 40000 and it will be preset by function code 06. Refer to the following slide.

5 Modbus Serial (Server)
When the built-in Modbus server of 2MLI CPU is set as previous slide, if Modbus client uses function code 16 (preset multiple registers) and preset 3 words, then it will preset 3 registers of 4xxxx area of Modbus server. And 2MLI corresponding area for 4xxxx is set as %MW2000. Therefore %MW2000~%MW2002 area will be preset by Modbus client. The following is the relationship between Modbus client and Modbus server (2MLI). Modbus Serial (S) - CPU - Snet I/F Modbus Serial (C) Modbus TCP/IP (S) - FEnet I/F Modbus TCP/IP (C) When the built-in Modbus server of 2MLI CPU is set as previous slide, 1) if Modbus client uses function code 01 (read coil status) and reads 5bits, then it will read 0xxxx area of Modbus server which means 5bits of %MW100 (bit: %MW100.0~%MW100.4). 2) if Modbus client uses function code 02 (read input status) and read 6bits, then it will read 1xxxx area of Modbus server which means 6bits of %MW0 (bit: %MW0.0~%MW0.5). 3) if Modbus client uses function code 03 (read holding registers) and read 2words, then it will read 4xxxx area of Modbus server which means 2words from %MW2000 (%MW2000~%MW2001). 4) if Modbus client uses function code 04 (read input registers) and read 3 words, then it will read 3xxxx area of Modbus server which means 3words from %MW1000 (%MW1000~%MW1002). 5) if Modbus client uses function code 05 (force single coil), then it will force 1bit of 0xxxx area which is %MW0.0. 6) if Modbus client uses function code 06 (preset single register), then it will preset single register of 4xxxx area which is %MW2000. 7) if Modbus client uses function code 15 (force multiple coils) and force 12bits, then it will force 0xxxx area which means 12bits of %MW0 (bit: %MW0.0~%MW0.11). 8) if Modbus client uses function code 16 (preset multiple registers) and preset 3 words, then it will preset 3registers of 4xxxx area which means %MW2000~%MW2002.

6 Modbus Serial (Server)
2MLI Snet I/F module as Modbus server Modbus Serial (S) - CPU - Snet I/F Modbus Serial (C) Modbus TCP/IP (S) - FEnet I/F Modbus TCP/IP (C) 1. Configuration Modbus Client You are supposed to select Modbus server in SM-NM to communicate with Modbus client module.

7 Modbus Serial (Server)
e.g.) Modbus Function code/memory mapping Modbus Serial (S) - CPU - Snet I/F Modbus Serial (C) Modbus TCP/IP (S) - FEnet I/F Modbus TCP/IP (C)

8 Modbus Serial (Server)
2. SoftMaster-NM setting Modbus Serial (S) - CPU - Snet I/F Modbus Serial (C) Modbus TCP/IP (S) - FEnet I/F Modbus TCP/IP (C) Channel 1 and 2 type should be identical to its hardware type. If channel 2 type is not equal to its real hardware, even though that channel is not used, it does not run normally. bit device To communicate with Modbus client, basic parameter setting in SM-NM will do. Note that bit area is denoted as bit device and word area is done as word. word device

9 Modbus Serial (Server)
2. SoftMaster-NM setting Modbus Serial (S) - CPU - Snet I/F Modbus Serial (C) Modbus TCP/IP (S) - FEnet I/F Modbus TCP/IP (C) [Online]—[Connect]—[Write Parameter]. Modbus server parameter is set up in basic parameter section. [Reset]. After downloading parameter, select [Reset].

10 Modbus Serial (Server)
3. SoftMaster-NM setup in detail Modbus Serial (S) - CPU - Snet I/F Modbus Serial (C) Modbus TCP/IP (S) - FEnet I/F Modbus TCP/IP (C) As other PLC functions as Modbus client, Snet I/F module is regarded as Modbus server having Modicon address. ML200 0xxxx (bit output) Read by code 01 Write by 05, 15 1xxxx (bit input) Read by code 02 SoftMaster Basic parameter 4xxxx (word output) Read by 03 Write by 06, 16 3xxxx (word input) Read by 04 If Modbus client uses function code 06, for example, it will preset 4xxxx-corresponding area of Modbus server device. Now %M area starting %MW2000 is set as 40000 and it will be preset by function code 06.

11 Modbus Serial (Client)
Snet I/F module as Modbus client Modbus Serial (S) - CPU - Snet I/F Modbus Serial (C) Modbus TCP/IP (S) - FEnet I/F Modbus TCP/IP (C) 1. Configuration Modbus Server Modbus Client Station: 2 Station: 1 You are supposed to select P2P and Modbus client in SM-NM to communicate with Modbus server device.

12 Modbus Serial (Client)
2. SM-NM setting: basic parameter Modbus Serial (S) - CPU - Snet I/F Modbus Serial (C) Modbus TCP/IP (S) - FEnet I/F Modbus TCP/IP (C) Channel 1 and 2 type should be identical to its hardware type. Select Use P2P in Active mode of basic parameter setting. Now let's set P2P part. Refer to the next slide.

13 Modbus Serial (Client)
2. SM-NM setting: P2P Modbus Serial (S) - CPU - Snet I/F Modbus Serial (C) Modbus TCP/IP (S) - FEnet I/F Modbus TCP/IP (C) 2 1

14 Modbus Serial (Client)
2. SM-NM setting: P2P Modbus Serial (S) - CPU - Snet I/F Modbus Serial (C) Modbus TCP/IP (S) - FEnet I/F Modbus TCP/IP (C) Modbus function: 01 (read coil status) user-edit area bit area 1 2 This setting means Snet I/F module is to read one bit (00000) from station #2 (Modbus server) when %MX1 bit turns on. Since its read area is (Modbus bit output area) we know that Modbus client (Snet I/F module) uses function code 01. In the above, single for command type is selected, which means single bit is read and it has nothing to do with function code. If you choose continuous, Snet I/F module reads continuous bits using function code 01 as long as it holds the above setting.

15 Modbus Serial (Client)
2. SM-NM setting: P2P Modbus Serial (S) - CPU - Snet I/F Modbus Serial (C) Modbus TCP/IP (S) - FEnet I/F Modbus TCP/IP (C) Modbus function: 02 (read input status) user-edit area bit area 1 2 This setting means Snet I/F module is to read one bit (10000) from station #2 (Modbus server) when %MX0 bit turns on. Since its read area is (Modbus bit input area) we know that Modbus client (Snet I/F module) uses function code 02. In the above, single for command type is selected. This means single bit is read and it has nothing to do with function code. If you choose continuous, Snet I/F module reads continuous bits with function code 02 as long as it holds the above setting.

16 Modbus Serial (Client)
2. SM-NM setting: P2P Modbus Serial (S) - CPU - Snet I/F Modbus Serial (C) Modbus TCP/IP (S) - FEnet I/F Modbus TCP/IP (C) Modbus function: 03 (read holding registers) word area user-edit area 1 2 This setting means Snet I/F module is to read one word (40000) from station #2 (Modbus server) when %MX2 bit turns on. Since its read area is (Modbus word output area) we know that Modbus client (Snet I/F module) uses function code 03. In the above, single for command type is selected. This means single word is read. If you choose continuous, Snet I/F module reads continuous words with function code 03 as long as it holds the above setting.

17 Modbus Serial (Client)
2. SM-NM setting: P2P Modbus Serial (S) - CPU - Snet I/F Modbus Serial (C) Modbus TCP/IP (S) - FEnet I/F Modbus TCP/IP (C) Modbus function: 04 (read input registers) user-edit area word area 1 2 This setting means Snet I/F module is to read one word (30000) from station #2 (Modbus server) when %MX3 bit turns on. Since its read area is (Modbus word input area) we know that Modbus client (Snet I/F module) uses function code 04. In the above, single for command type is selected. This means single word is read. If you choose continuous, Snet I/F module reads continuous words with function code 04 as long as it holds the above setting.

18 Modbus Serial (Client)
2. SM-NM setting: P2P Modbus Serial (S) - CPU - Snet I/F Modbus Serial (C) Modbus TCP/IP (S) - FEnet I/F Modbus TCP/IP (C) Modbus function: 05 (force single coil) user-edit area bit area 1 2 This setting means Snet I/F module is to write one bit (%MW ) to station #2 (Modbus server) area when %MX4 bit turns on. Since its force area is 00000 (Modbus bit output area) we know that Modbus client uses function code 05. In the above, single for command type is selected. This means single bit is written. If you choose continuous, Snet I/F module forces continuous (multiple) bits with function code 15 instead of 05.

19 Modbus Serial (Client)
2. SM-NM setting: P2P Modbus Serial (S) - CPU - Snet I/F Modbus Serial (C) Modbus TCP/IP (S) - FEnet I/F Modbus TCP/IP (C) Modbus function: 06 (preset single register) user-edit area word area 1 2 This setting means Snet I/F module is to write one word (%MW2000) to station #2 (Modbus server) area when %MX5 bit turns on. Since its preset area is 40000 (Modbus word output area) we know that Modbus client uses function code 06. In the above, single for command type is selected. This means single word is written. If you choose continuous, Cnet I/F module presets continuous (multiple) words with function code 16 instead of 06.

20 Modbus Serial (Client)
2. SM-NM setting: P2P Modbus Serial (S) - CPU - Snet I/F Modbus Serial (C) Modbus TCP/IP (S) - FEnet I/F Modbus TCP/IP (C) Modbus function: 15 (force multiple coils) user-edit area bit area 1 2 This setting means Snet I/F module is to write multiple bits (10bits: %MW ~ %MW3000.9) to station #2 (Modbus server) 00000~00009 area when %MX6 bit turns on. Since its force area is (Modbus bit output area), Snet I/F uses function code 05. In the above, continuous for command type is selected. This means multiple bits are written with function code 15. If you choose single, then Data size cell is disabled and Snet I/F module forces single bit with function code 05.

21 Modbus Serial (Client)
2. SM-NM setting: P2P Modbus Serial (S) - CPU - Snet I/F Modbus Serial (C) Modbus TCP/IP (S) - FEnet I/F Modbus TCP/IP (C) Modbus function: 16 (preset multiple registers) user-edit area word area 1 2 This setting means Snet I/F module is to write multiple words (10words: %MW5000 ~ %MW5009) to station #2 (Modbus server) area when %MX7 bit turns on. Since its preset area is (Modbus word output area), Snet I/F uses function code 16. In the above, continuous for command type is selected. This means multiple words are written with function code 16. If you choose single, then Data size cell is disabled and Cnet I/F module presets single word with function code 6.

22 Modbus Serial (Client)
2. SM-NM setting Modbus Serial (S) - CPU - Snet I/F Modbus Serial (C) Modbus TCP/IP (S) - FEnet I/F Modbus TCP/IP (C) [Online]—[Connect]—[Write Parameter] [Online]—[Reset] [Online]—[Enable Link]

23 Modbus TCP/IP (Server)
2MLI FEnet I/F module as Modbus server Modbus Serial (S) - CPU - Snet I/F Modbus Serial (C) Modbus TCP/IP (S) - FEnet I/F Modbus TCP/IP (C) 1. Configuration Modbus Server Modbus TCP/IP Client Hub IP address: IP address: You are supposed to select Modbus TCP/IP server in XG-PD to communicate with Modbus client module.

24 Modbus TCP/IP (Server)
2. SM-NM setting Modbus Serial (S) - CPU - Snet I/F Modbus Serial (C) Modbus TCP/IP (S) - FEnet I/F Modbus TCP/IP (C) bit device To communicate with Modbus TCP/IP client, basic parameter setting in SM-NM will do. Note that bit area is denoted as bit device and word area is done as word. word device

25 Modbus TCP/IP (Server)
2. SM-NM setting Modbus Serial (S) - CPU - Snet I/F Modbus Serial (C) Modbus TCP/IP (S) - FEnet I/F Modbus TCP/IP (C) [Online]—[Connect]—[Write Parameter]. Modbus server parameter is set up in basic parameter section. [Reset]. After downloading parameter, select [Reset].

26 Modbus TCP/IP (Client)
2MLI FEnet I/F module as Modbus client0 Modbus Serial (S) - CPU - Snet I/F Modbus Serial (C) Modbus TCP/IP (S) - FEnet I/F Modbus TCP/IP (C) 1. Configuration Modbus TCP/IP Client Modbus Server Hub IP address: IP address: You are supposed to select P2P and Modbus TCP/IP client in SM-NM to communicate with Modbus server device.

27 Modbus TCP/IP (Client)
2. SM-NM setting: basic parameter Modbus Serial (S) - CPU - Snet I/F Modbus Serial (C) Modbus TCP/IP (S) - FEnet I/F Modbus TCP/IP (C) Now let's set P2P part. Refer to the next slide.

28 Modbus TCP/IP (Client)
2. SM-NM setting: P2P Modbus Serial (S) - CPU - Snet I/F Modbus Serial (C) Modbus TCP/IP (S) - FEnet I/F Modbus TCP/IP (C) 2 1 Server IP

29 Modbus TCP/IP (Client)
2. SM-NM setting: P2P Modbus Serial (S) - CPU - Snet I/F Modbus Serial (C) Modbus TCP/IP (S) - FEnet I/F Modbus TCP/IP (C) Modbus function: 04 (read input registers) user-edit area word area 1 2 This setting means FEnet I/F module is to read 10words (30000) from station #2 (Modbus TCP/IP server) at every 1 second (_T1S turns on). Since its read area is (Modbus word input area) we know that Modbus TCP/IP client uses function code 04. In the above, continuous for command type is selected, which means multiple words are read and to 3000A data are saved in %MW1000 to %MW1009. If you choose single, it reads single word with function code 04. For the rest of P2P block setting is similar to that of Modbus serial (Client).

30 Modbus TCP/IP (Client)
2. SM-NM setting Modbus Serial (S) - CPU - Snet I/F Modbus Serial (C) Modbus TCP/IP (S) - FEnet I/F Modbus TCP/IP (C) [Online]—[Connect]—[Write Parameter] [Online]—[Reset] [Online]—[Enable Link]


Download ppt "Modbus Serial (Server)"

Similar presentations


Ads by Google