emModbusSlaveReadCoils | Top Next

emModbusSlaveReadCoils embedded Modbus Server updates coil register value. Since R2019b Library: embeddedCreatorLib ( Dafulai Electronics) / embedded Modbus Slave & Debugger / emModbusSlaveReadCoils Description This block will update my Modbus server coil register value periodically. So External Modbus client can get the latest coil register value. Notes: Any Port name with "Right Arrow" (à) symbol contains "built-in" probe. So in PC side, you can watch its value directly by "Display" block, you don't need add "Probe" block (our emProbe) before "Display" block. Of cause, you can still use "Mux" block to collect all watching variables and then connect one "emProbe" which connects "Display" block. In this way, you can decrease communication traffic. Parameters Please double click this block to open parameters dialog below: Let us explain parameters.
• | Modbus Server ID or node address — tell system this block is for which Modbus Server node. You just choose from drop list which is from "emModbusSlaveDebugSetup" block.
• | Sample time in sec (-1 for inherited): — Sample time for this block. It is the same meaning as general Simulink block .
Ports Input
• | StartAddr — "uint16" data type's scalar. It is Modbus Server coil registers' start address (1-based without prefix "0X"). It must be from Constant block or from "emProbe" output because both PC side and embedded side must know its value.
• | Data — "logical" data type's scalar or vector. It is coil register data source.
Outport
• | Ok — "logical" data type's scalar. In PC side, it denotes whether communication between PC and Target is OK. In embedded target side, it denotes whether coil register range you read is valid.
• | Data — "logical" data type's scalar or vector. It is equal to input port Data.
Examples