Download Modbus Master Source Code Library
Transcript
Modbus Master C# Source Code Library Users Manual Sl. No. Parameter Name Description 1 SlaveIPAddr Network over which to open the Modbus communication 2 IPPortNo IP Port Number Data Type string int Return Value: byte - MBDEFS_TRUE: If initialisation successful MBDEFS_FALSE: If initialisation fails Here MBDEFS_TRUE = 1 and MBDEFS_FALSE = 0 7.3) MBSendRequest Format: byte MBSendRequest( byte SlaveNo, byte FunctionCode, ushort VarAddress, ushort NItems, ushort[] data, uint TimeOut, byte Retries ) This function is used to send the request and receive the response from the Modbus slave. Parameters: Sl. Parameter No. Name 1 SlaveNo Description Slave ID from which data is to be read Data Type byte 2 FunctionCode Type of data to be requested from the slave byte 3 VarAddress Starting variable address of the ushort data to be read 4 NItems No of items of the specified type ushort to be read 5 data Memory allocated data buffer for ushort receiving the requested data 6 TimeOut Time out in milliseconds for the Read operation uint 7 Retries No of retries in case of transmission failure byte Values 1 - 247 Supported list given in Technical Specification section. 1 – 65535 **Number of Coils / DiscreteInputs / Registers. Valid data buffer with memory allocated for receiving ‘Items’ As decided by the end user. As decided by the end user. Return Value: byte - MBDEFS_TRUE: If initialisation successful MBDEFS_FALSE: If initialisation fails Here MBDEFS_TRUE = 1 and MBDEFS_FALSE = 0 Sunlux Technologies Page 26 of 37