Previous Topic

Next Topic

Book Contents

Book Index

ModBus Master control script commands

ModBus tutorial

ModBus script commands are stored as table entries in NVEM page 0. In the following pages, each command consists of a 1-byte numeric command code followed by 0 to several parameters. 16 bit parameters have '16' as part of their name. Other parameters are 8-bit.

Command codes less than 128 map to the same-numbered ModBus function. Codes 128 and over provide internal functions.

Previous Topic

Next Topic

In This Chapter

ReadCoil(s) - 1, SlaveAddr, CoilAddr16, ItemCount, SPAddr16

ReadInputs - 2, SlaveAddr, InAddr16, ItemCount, SPAddr16

ReadHregs - 3, SlaveAddr, RegAddr16, ItemCount, SPAddr16, SPMode

ReadInRegs - 4, SlaveAddr, InRegAddr16, ItemCount, SPAddr16

ForceCoil - 5, SlaveAddr, CoilAddr16, SPAddr16

PresetHreg - 6, SlaveAddr, RegAddr16, SPAddr16, SPMode

ForceMultCoils - 15, SlaveAddr, CoilAddr16, ItemCount, SPAddr16

PresetMultRegs - 16, SlaveAddr, RegAddr16, ItemCount, SPAddr16, SPMode

GoTo - 128, NVPtr16

Stop - 129

Delay - 130, Time