modbus_rtu_get_serial_mode.txt 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. modbus_rtu_get_serial_mode(3)
  2. =============================
  3. NAME
  4. ----
  5. modbus_rtu_get_serial_mode - get the current serial mode
  6. SYNOPSIS
  7. --------
  8. *int modbus_rtu_get_serial_mode(modbus_t *'ctx');*
  9. DESCRIPTION
  10. -----------
  11. The *modbus_rtu_get_serial_mode()* function shall return the serial mode
  12. currently used by the libmodbus context:
  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 available on Linux kernels 2.6.28 onwards and can only be
  25. used with a context using a RTU backend.
  26. RETURN VALUE
  27. ------------
  28. The function shall return `MODBUS_RTU_RS232` or `MODBUS_RTU_RS485` if
  29. successful. Otherwise it shall return -1 and set errno to one of the values
  30. defined below.
  31. ERRORS
  32. ------
  33. *EINVAL*::
  34. The current libmodbus backend is not RTU.
  35. AUTHORS
  36. -------
  37. The libmodbus documentation was written by Stéphane Raimbault
  38. <stephane.raimbault@gmail.com>