eMBMasterSerialInit() function
Initialize the Modbus Master protocol stack. This functions initializes the ASCII or RTU module and calls the init functions of the porting layer to prepare the hardware. Please note that the receiver is still disabled and no Modbus frames are processed until eMBMasterEnable( ) has been called.
Arguments
eMode
If ASCII or RTU mode should be used.
ucPort
The port to use. E.g. 1 for COM1 on windows. This value is platform dependent and some ports simply choose to ignore it.
ulBaudRate
The baudrate. E.g. 19200. Supported baudrates depend on the porting layer.
eParity
Parity used for serial transmission.
Return value
If no error occurs the function returns eMBErrorCode::MB_ENOERR. The protocol is then in the disabled state and ready for activation by calling eMBMasterEnable( ). Otherwise one of the following error codes is returned: - eMBErrorCode::MB_EPORTERR IF the porting layer returned an error.