changed condition for legacy libmodbus and function parameter