Modbus Communication

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 12

Modbus Communication

1. System configuration

GM4: Modbus master (station number: 1), user-define mode (operation mode: 2)
GM6: Modbus slave (station number: 2), * online mode (operation mode: 9)
In GM6 operation mode, select ‘Library Mode’ of online mode.

2. Programming
2.1 Parameter setting in G4L-CUEA
2.1.1 After running Frame Editor, click on ‘Connect’ of Online in main menu. Set the
‘Basic Parameters’.
2.1.2 Write them on the GM4 Cnet module, choosing ‘Write’ of Online

* Set the slot number where Cnet interface module is installed. Here, Slot No. is 0 as is
shown in “System Configuration” on page 1.

2.1.3 After writing parameters, change the status of GM4 Cnet module. Select [Online]-
[Change Run/Stop], which opens the dialog box (refer to the below), and click on ‘Run’.

2.1.4 [Online]-[Disconnect]
2.2 Parameter setting in G6L-CUEC
2.2.1 Communication driver download
If GM6 is turned on with G6L-CUEC set to ‘Flash Writing Mode (ver 2.0 or later):
operation mode: 8)’, LED no. 0 turns on and off with a period of 1 second. Select
[File]-[Open Lib] after click on [Online]-[Connect], which pops up a dialog box where
you choose modbus6.lib.

2.2.2 Click [Online]-[Flash Memory]-[Write], then ‘Write Library’ window will appear
where you select the slot number of Cnet and choose ‘Write’ button.
Disconnect and turn off PLC after library writing to Cnet module is completed.

2.2.3 Communication mode setting


Change the operation mode of G6L-CUEC to 9, and turn on GM6 for Online connection.
Select [Online]-[Online Change Mode], then the following dialog box will pop up.

Here, you can select G6L-CUEC for RS-232C or RS-422. For Modbus communication
of GM4 (Modbus master) and GM6 (Modbus slave), click on ‘Library Mode’ of RS-422
and write.
2.3 Basic parameter setting of G6L-CUEC
2.3.1 Click [Online]-[Connect] in main menu. Set the ‘Basic Parameters’.

2.3.2 Write them on the G6L-CUEC, choosing ‘Write’ of Online

* Set the slot number where Cnet interface module is installed. Here, Slot No. is 0 as is
shown in “System Configuration” on page 1.

2.3.3 After writing parameters, change the status of G6L-CUEC. Select [Online]-
[Change Run/Stop], which opens the dialog box (refer to the below), and click on ‘Run’.
2.3.4 [Online]-[Disconnect]
3. Program
3.1 GM4 Program
3.1.1 Insert libraries: [Project]-[Insert Library].

MODBUS.4FB, COMMUNI.4FB: Modbus communication


APP.4FU: to use ‘SWAP_WORD’ function for swapping upper byte for lower one.
3.1.2 Program

You might also like