MODBUS Master Special module program Service
Outline
General information
CM1-SC01A/SC01B/SC02A cards are used for this service, which is the protocol using RS232/485 MODBUS Master to exchange data between the Slaves. The specifications are as follows.
Maximum connectable Slaves: 128 units.
Easy to recognize to communicate successful or not with result bits of communication.
Sequnce program is not necessary when periodic communication.
It is Flexible for Slaves supported variable commands
To communication in special events is possible with command, "SEND"”
CAUTION, identify a version of program for MODBUS Master special program. If it cannot support program as lower version, please make sure whether it is the recommend version
| CICON | CM1-CPxx(CPU) | CM1-SC0xx |
Version | V1.89 | V1.56 | V1.40 |
Supported MODBUS RTU commands
Command | Substance | Remark | Domain |
1 (Read Coil) | Read the bit device coil | Read Bit | 0X |
2 (Read Input) | Read the bit device input | Read Bit | 1X |
3 (Read Holding) | Read the word device holding register | Read Word | 4X |
4 (Read Input) | Read the word device input | Read Word | 3X |
5 (Force Single Coil) | Write the bit device coil | Write Bit | 0X |
6 (Preset Single Register) | Write Accesses the word device register | Write Word | 4X |
16 (Preset Multiple Regs.) | Write the word device register | Write Word | 4X |
SETTING UP COMMUNICATION CARD
To run MODBUS Master function, the parameter have to be set up in the special module setup. After running the CICON, select the
menu [ tool - Special Module Setup – RS232C/422 module...]
Please select "MODBUS Master Program".
REGISTER SPECIAL PROGRAM
Start scan program
Select [NEW program – MODBUS/RTU Master Program], and register program name.
Select the [OK] button.
MODBUS_RTU dialog box will appear, set up a device.
Base: This is used select the base of MODBUS/RTU Master module configured.
Slot: This is used select the slot of MODBUS/RTU Master module configured.
Ch : This is used select the channel of MODBUS/RTU Master module configured.
Result: This is used to appear the send/receive data’s result of communication frame.
result | Frame No. | The comm. Result Flag | The comm. Result Flag Running | ||
Succeed | Fail | Succeed | Fail | ||
M0000 | 0 | M0000 | M0080 | 1 Scan On | On at all times Off at communication flag success |
11 | M000B | M000B | |||
127 | M007F | M007F |
Example of configuration " result " M0000
REGISTER COMM. BLOCK
Dest. Station. : This is used to select a station number of RTU MODBUS Slave configured, In case of connecting between several slaves used through RS422/485 communication, the station number have to be different between slaves each other.
Function : This is used to select a suitable function when a data read/write between slaves. Please refer to the manual of "Command"
Point Number : Resister read/write domains referred to a address table of slaves. Please refer to " Address table in SLAVE "
Start Address: It is used to register the address of a read/write domain which is referred to address tables of slave. Please refer to the manual of " Address table of slave "
Data Type : This is used to select a type of send/receive data between slaves. Only selected analog data (Function 3, 4, 6, 16), they are valid
Scale Vector: Not Necessary
Data Count: This is used to set up a count of read/write slaves data.
Command(Function) | Data Size |
1 - Read Coil Status 2 - Read Input Status | Bit Size |
3 – Read Holding Registers 4 – Read Input Registers | Word Size |
5 – Force Single Coil | Not Necessary.(1Bit Write) |
6 – Preset Single Registers | Not Necessary.(2Byte Write) |
16 - Preset Multiple Registers | Word Size |
device: This is used to select a device address of send/receive data stored.
Function | device | Substance |
Read Function | D0000 | Address stored receive data between slaves |
Write Function | D0010 | Address stored send data between slaves |
Do not transmit Automatically : This is used to communicate the block configured MODBUS RTU Master program sequencely(0~15). When you don’t use this function, check the blank. It is possible to receive data if only SEND command when check the blank,
Example of MODBUS RTU Master Special Programming Communication
Following picture shows slaves, communication system and frame structure which supported CIMON-PLC and MODBUS RTU Protocol.
[Information of slave ]
Parameter of slave | Substance |
Comm. Protocol | MODBUS RTU protocol(Slave) |
Comm. Type | RS232C |
Station | 1 |
Baud Rate | 9600bps |
Parity | None |
Data bit | 8 |
Stop bit | 1 |
[ Address table of slave ]
Address | Substance | PLC device address |
00001 | PV(present) | D00000 |
00002 | SV(set value) | D00010 |
… | … | … |
EXAMPLE OF REGISTE
Register " special module setup ". Please refer to " Communication Setup "
Register " a communication parameter of slave" . Please compare to " special module setup " whether it’s the same or not.
Register " MODBUS RTU MASTER special program "
Register a communication block for receiving PV value
Register a communication block for sending SV value
Complete to register two communication blocks ,‘a’ and ‘b’
Download PLC program. After downloading, please change the mode to " RUN "
Program PLC scan program for debugging.
In case of succeed in receiving PV value, Increase a data in D00100..
In case of succeed in sending SV value, Increase a data in D00101.