MIGRATION 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. =============================================
  2. Migration notes from the 2.0 series (for 3.0)
  3. =============================================
  4. The 3.0 release use a brand new API and this document covers only the general
  5. changes:
  6. - the structure modbus_param_t is gone and is replaced by a new opaque and
  7. dynamically allocated structure modbus_t.
  8. - the slave argument is no more an argument of the Modbus functions, you need to
  9. call modbus_set_slave first.
  10. - the public header file is smaller so some internal defines aren't accessible
  11. anymore.
  12. - all function and constants are respectively prefixed by modbus_ or MODBUS_.
  13. - the POSIX error conventions are used (if an error occured, -1 or NULL is
  14. returned and errno is set accordingly).
  15. - coil status and discretes inputs are just bits and force/preset actions have
  16. been renamed to write actions.
  17. We hope you'll enjoy the new API to accept the migration burden!
  18. =============================================
  19. Migration notes from the 1.2 series (for 2.0)
  20. =============================================
  21. Init
  22. ====
  23. modbus_init_tcp requires a third new argument, the port number.
  24. modbus_init_tcp(modbus_param_t *mb_param, char *ip_address, int port)
  25. Set the port to MODBUS_TCP_DEFAULT_PORT to use the default one
  26. (502). It's convenient to use a port number greater than or equal to
  27. 1024 because it's not necessary to be root to use this port number.
  28. Pointers of data
  29. ================
  30. The coil and input status are now stored in an array of type uint8_t
  31. (in 1.2.X series, array of type int was used). So now, you need to
  32. pass a pointer of type uint8_t to use read_coil_status(), for example.
  33. The holding and input registers are now stored in an array of type
  34. uint16_t.
  35. These changes reduce the memory consumption.