aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--append.c20
-rw-r--r--modbuslog.cfg23
2 files changed, 40 insertions, 3 deletions
diff --git a/append.c b/append.c
new file mode 100644
index 0000000..0b2bbbb
--- /dev/null
+++ b/append.c
@@ -0,0 +1,20 @@
+#include <stdio.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <time.h>
+
+int main(int argc, char *argv[]) {
+
+ time_t t = time(NULL);
+ struct tm tm = *localtime(&t);
+ FILE *fp;
+ fp=fopen("append.txt", "a+");
+
+ fprintf(fp,"%d-%d-%d %d:%d:%d\n", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec);
+ fprintf(fp,"%d\n", ((int) t)/60*60);
+ fclose(fp);
+
+ return 0;
+}
diff --git a/modbuslog.cfg b/modbuslog.cfg
index e80a610..d9e41df 100644
--- a/modbuslog.cfg
+++ b/modbuslog.cfg
@@ -11,6 +11,23 @@ modbus = {
};
device = (
- { address = 1;
- interval = 15;
-
+ {
+ slaveid = 1;
+ registertype = 4;
+ startaddress = 2;
+ numregisters = 6;
+ datatype = "byte";
+ intervalvalue = 15;
+ intervalunit = "M";
+ },
+ {
+ slaveid = 1;
+ registertype = 4;
+ startaddress = 1;
+ numregisters = 1;
+ datatype = "byte";
+ intervalvalue = 1;
+ intervalunit = "H";
+ }
+);
+