Closed MartinMohan closed 10 years ago
It makes sense and I think I can change it in libmodbus 3.1.1 (for next stable v3.2)
libmodbus checks the OFF and ON aren't already defined so why there is a conflict?
#ifndef FALSE
#define FALSE 0
#endif
#ifndef TRUE
#define TRUE 1
#endif
#ifndef OFF
#define OFF 0
#endif
#ifndef ON
#define ON 1
#endif
Which version do you use?
@MartinMohan ping
Unfortunately tango does not seem to use preprocessor directives for defining their constants. From tango code tango-8.1.2c.tar.gz (http://sourceforge.net/projects/tango-cs/files) The file defining constants is...... tango-8.1.2/lib/cpp/server/tango_const.h
const char * const DevStateName[] = { "ON", "OFF", "CLOSE", "OPEN", "INSERT", "EXTRACT", "MOVING", "STANDBY", "FAULT", "INIT", "RUNNING", "ALARM", "DISABLE", "UNKNOWN" };
So Tango needs to be fixed!
Hi, I wanted to use libmodbus on debian wheezy with the tango control system but there is a conflict in modbus.h with
define OFF 0
define ON 1
To get both packages working together I modify ON/OFF to MODBUS_OFF/ MODBUS_ON in modbus.h ( When you recompile the compiler tells you which c programs must be updated with these new values). I also reported this to other package... http://www.esrf.eu/mail_archives/tango/archive/msg05002.html