IPC@CHIP Modbus library – API Documentation

Header image

Main page

int mbRTU_mst_init ( MbHandle handle,
int  port,
u32  baud,
int  parity,
int  rtuMode,
u16  bcastAddress,
u8  async 

Initialize the Modbus RTU master connection, setup communication, serial settings,...

[out] handle,: Handle that must be passed to other functions
[in] port,: Serial port index 0..15 (0:UART1, .. 5:UART6, 6 , ..Extensions?)
[in] baud,: Desired baud rate , bits per second
[in] parity,: UART parity: 0: None (with 2 Stopbits), 1: Odd (1 Stopbit), 2: Even (1 Stopbit), 3: None ((1 Stopbit)
[in] rtuMode,: Serial modes
  0: RS232 with RTS/CTS flow
  1: RS232 no flow control
  2: RS485 High active
  3: RS485 Low active
  4: RS485 High active, echo enabled
  5: RS485 Low active, echo enabled
[in] bcastAddress : Define one address as a broadcast address (e.g. 0, recommended)
  A value == 256 signals, that the broadcast address is not used.
[in] async,: If this boolean parameter is set, asynchronous mode will be activated. In asynchronous mode request function may return MB_WOULD_BLOCK_RECV or MB_WOULD_BLOCK_SEND. In this case they should be called again with the same parameters. However other request functions that do not affect the same serial line can be called in between.
0 : Success
elsewise error code:
-1 : Failed
-2 : Illegal port number
-3 : Semaphore creation failed
-4 : Port already in use, mbRTU_mst_deinit(int port) required
-5 : Fossil_init() fault
-6 : Fossil_setbaud() fault
MB_OUT_OF_MEMORY : Out of memory

Top of page | Main page

Copyright © 2017 Beck IPC GmbH
Generated on Thu Mar 9 18:00:33 2017 by Doxygen 1.6.1