This function is called from YOUR application code to read coils from a Modbus slave.
Prototype
CPU_INT16U MBM_FC01_CoilRd (MODBUS_CH *pch, CPU_INT08U slave_addr, CPU_INT16U start_addr, CPU_INT08U *p_coil_tbl, CPU_INT16U nbr_coils);
Arguments
pch
is a pointer to the channel (returned by MB_CfgCh()
). This pointer specifies onto which channel the Modbus master will be communicating on. Of course, ‘pch
’ must have been configured as a Master when you configured the channel.
...
specifies the number of coils you want to read from the slave.
Returned Value
MODBUS_ERR_NONE
if the call was successful.
...
If the expected number of bytes to receive doesn't correspond to the number of bytes received.
Notes / Warnings
None
Called By
Your Modbus master application.