KMtronic ModBus Relays

 

COM port settings:

Baud Rate:      9600
Data Bits:        8
Parity:             None
Stop Bits:        1
Flow Control:  None

 

MODBUS commands:

 

01 (0x01) Read Coil (check relay status)

The coils in the response message are packed as one coil per bit of the data field.

Status is indicated as 1= ON and 0= OFF.

 

Status request commands:

>> 01 01 00 00 00 01 (CS) (CS)  - Request for status relay 1
>> 01 01 00 01 00 01 (CS) (CS)  - Request for status relay 2
>> 01 01 00 02 00 01 (CS) (CS)  - Request for status relay 3
>> 01 01 00 03 00 01 (CS) (CS)  - Request for status relay 4
>> 01 01 00 04 00 01 (CS) (CS)  - Request for status relay 5
>> 01 01 00 05 00 01 (CS) (CS)  - Request for status relay 6
>> 01 01 00 06 00 01 (CS) (CS)  - Request for status relay 7
>> 01 01 00 07 00 01 (CS) (CS)  - Request for status relay 8

 

Response relay board:

<< 01 01 01 00 (CS) (CS)  - relay is OFF

or

<< 01 01 01 01 (CS) (CS)  - relay is ON

 

 

05 (0x05) Write Single Coil (turn relay ON/OFF)

The normal response is an echo of the request, returned after the coil state has been written.

 

ON commands:

>> 01 05 00 00 FF 00 (CS) (CS)  - Turn relay 1 ON

     << 01 05 00 00 FF 00 (CS) (CS)  - Respond that relay 1 is turned ON

>> 01 05 00 01 FF 00 (CS) (CS)  - Turn relay 2 ON

     << 01 05 00 01 FF 00 (CS) (CS)  - Respond that relay 2 is turned ON

>> 01 05 00 02 FF 00 (CS) (CS)  - Turn relay 3 ON

     << 01 05 00 02 FF 00 (CS) (CS)  - Respond that relay 3 is turned ON

>> 01 05 00 03 FF 00 (CS) (CS)  - Turn relay 4 ON

     << 01 05 00 03 FF 00 (CS) (CS)  - Respond that relay 4 is turned ON

>> 01 05 00 04 FF 00 (CS) (CS)  - Turn relay 5 ON

     << 01 05 00 04 FF 00 (CS) (CS)  - Respond that relay 5 is turned ON

>> 01 05 00 05 FF 00 (CS) (CS)  - Turn relay 6 ON

     << 01 05 00 05 FF 00 (CS) (CS)  - Respond that relay 6 is turned ON

>> 01 05 00 06 FF 00 (CS) (CS)  - Turn relay 7 ON

     << 01 05 00 06 FF 00 (CS) (CS)  - Respond that relay 7 is turned ON

>> 01 05 00 07 FF 00 (CS) (CS)  - Turn relay 8 ON

     << 01 05 00 07 FF 00 (CS) (CS)  - Respond that relay 8 is turned ON

 

             OFF commands:

>> 01 05 00 00 00 00 (CS) (CS)  - Turn relay 1 OFF

     << 01 05 00 00 00 00 (CS) (CS)  - Respond that relay 1 is turned OFF

>> 01 05 00 01 00 00 (CS) (CS)  - Turn relay 2 OFF

     << 01 05 00 01 00 00 (CS) (CS)  - Respond that relay 2 is turned OFF

>> 01 05 00 02 00 00 (CS) (CS)  - Turn relay 3 OFF

     << 01 05 00 02 00 00 (CS) (CS)  - Respond that relay 3 is turned OFF

>> 01 05 00 03 00 00 (CS) (CS)  - Turn relay 4 OFF

     << 01 05 00 03 00 00 (CS) (CS)  - Respond that relay 4 is turned OFF

>> 01 05 00 04 00 00 (CS) (CS)  - Turn relay 5 OFF

     << 01 05 00 04 00 00 (CS) (CS)  - Respond that relay 5 is turned OFF

>> 01 05 00 05 00 00 (CS) (CS)  - Turn relay 6 OFF

     << 01 05 00 05 00 00 (CS) (CS)  - Respond that relay 6 is turned OFF

>> 01 05 00 06 00 00 (CS) (CS)  - Turn relay 7 OFF

     << 01 05 00 06 00 00 (CS) (CS)  - Respond that relay 7 is turned OFF

>> 01 05 00 07 00 00 (CS) (CS)  - Turn relay 8 OFF

     << 01 05 00 07 00 00 (CS) (CS)  - Respond that relay 8 is turned OFF

 

 

 

MODBUS Test Software:

Download test software from:

http://www.info.kmtronic.com/software/ModBus/KMtronic_ModBus_Tester.zip

 

 

Select COM port where the Relay is installed (in this example it is COM Port 4) and click to OPEN button.

 

Write (copy/paste) command without Check Sum (CS) and click on SEND button. Software calculate Check Sum and send command to relay board.

 

In this example last command is:

"01 01 00 00 00 01 FD CA"  - Request for status relay 1. "FD CA" is Check Sum

"01 01 01 01 90 48" - Reply from relay board that status relay 1 is ON.  "90 48" is Check Sum

 

NOTE: You don't need to enter checksum manually. The software automatically calculates checksum and adds it to the main command.

 

RS485 Commands

http://www.info.kmtronic.com/kmtronic-modbus-relays-commands.html

 

 

 

 

 

 

 

 

Read 24865 times