From d0726dfb75459f99ad946fcdc8cc657c19af7431 Mon Sep 17 00:00:00 2001 From: Jonathan McCrohan Date: Sat, 15 Oct 2011 16:21:02 +0100 Subject: working towards logging. --- modbuslog.c | 3 +-- modbuslog.cfg | 7 ++++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/modbuslog.c b/modbuslog.c index a73dd94..0649215 100644 --- a/modbuslog.c +++ b/modbuslog.c @@ -84,12 +84,11 @@ modbus_set_slave(ctx, SLAVE_ID); modbus_set_debug(ctx, DEBUG); if (ctx == NULL) { - fprintf(stderr, "Unable to create the libmodbus context\n"); + fprintf(stderr, "Unable to create libmodbus object.\n"); return -1; } - if (modbus_connect(ctx) == -1) { fprintf(stderr, "Connection failed: %s\n", modbus_strerror(errno)); modbus_free(ctx); diff --git a/modbuslog.cfg b/modbuslog.cfg index ac325dc..e80a610 100644 --- a/modbuslog.cfg +++ b/modbuslog.cfg @@ -3,9 +3,14 @@ cfg_version = 0.99; modbus = { - device = "/dev/ttyUSB1"; + device = "/dev/ttyUSB4"; baud = 19200; data_bits = 8; parity = "E" stop_bits = 1; }; + +device = ( + { address = 1; + interval = 15; + -- cgit v1.2.3