|
readMyCoils |
Top |
|
readMyCoils read Modbus Server Coils register value Since R2019b
Library: Modbus Server ( Dafulai Electronics) /readMyCoils
Description
This block reads Coils register values. Start Address is from Input port "StartAddr" (1-based address without 0X prefix), Read Quantities are from Input port "RegQTY".
Those Coils register values are controlled by "Outside Modbus Master", Simulator cannot control these values. If any error (CRC, Timeout, Not supported FC, address range,....) occurs, Outport "Data" will return "Empty"
Parameters
Please double click this block to open parameters dialog below:
Let us explain parameters.
Ports
Input
Outport
Examples
Example:
Every 800ms (Wait 0.8 sec block), We are reading coil registers address from 1 to 8 of Modbus TCP Server.
Please open "your Modbus Server library folder"/examples/example2_readCoils.slx (You must change USB serial Port number in CAN_setup block according to your physical USB port number).
For "Modbus Server Setup" block, the parameters are set up below:
For "Read my Coils address 1 to 8 " block, the parameters are set up below:
You can run general Modbus master software such as Modbus Poll or ModScan32 to change coil registers values addressing 1 to 8, you will see its result in Simulink Display block.
|