modbus_rtu_set_serial_mode.txt 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. modbus_rtu_set_serial_mode(3)
  2. =============================
  3. NAME
  4. ----
  5. modbus_rtu_set_serial_mode - set the serial mode
  6. SYNOPSIS
  7. --------
  8. *int modbus_rtu_set_serial_mode(modbus_t *'ctx', int 'mode');*
  9. DESCRIPTION
  10. -----------
  11. The *modbus_rtu_set_serial_mode()* function shall set the selected serial
  12. mode:
  13. *MODBUS_RTU_RS232*:: the serial line is set for RS232 communication. RS-232
  14. (Recommended Standard 232) is the traditional name for a series of standards
  15. for serial binary single-ended data and control signals connecting between a
  16. DTE (Data Terminal Equipment) and a DCE (Data Circuit-terminating
  17. Equipment). It is commonly used in computer serial ports
  18. *MODBUS_RTU_RS485*:: the serial line is set for RS485 communication. EIA-485,
  19. also known as TIA/EIA-485 or RS-485, is a standard defining the electrical
  20. characteristics of drivers and receivers for use in balanced digital multipoint
  21. systems. This standard is widely used for communications in industrial
  22. automation because it can be used effectively over long distances and in
  23. electrically noisy environments.
  24. This function is only supported on Linux kernels 2.6.28 onwards.
  25. RETURN VALUE
  26. ------------
  27. The function shall return 0 if successful. Otherwise it shall return -1 and set
  28. errno to one of the values defined below.
  29. ERRORS
  30. ------
  31. *EINVAL*::
  32. The current libmodbus backend is not RTU.
  33. *ENOTSUP*::
  34. The function is not supported on your platform.
  35. If the call to ioctl() fails, the error code of ioctl will be returned.
  36. AUTHORS
  37. -------
  38. The libmodbus documentation was written by Stéphane Raimbault
  39. <stephane.raimbault@gmail.com>