diff --git a/Makefile b/Makefile index fb4cabc..b1a9064 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ .SILENT: help -VERSION = 0.1.9 +VERSION = 0.1.10 -include Makefile.rules @@ -90,7 +90,7 @@ buildwindows: clean ./copydlls.sh ./copydlls.sh ./copyshare.sh - cp /usr/lib/gcc/x86_64-w64-mingw32/13-win32/*.dll TestModbus-Client-$(VERSION)/ + cp /usr/lib/gcc/x86_64-w64-mingw32/14-win32/*.dll TestModbus-Client-$(VERSION)/ for i in `ldd TestModbus-Client.exe |grep -vi "/c/windows" | cut -d" " -f3`; do cp $$i TestModbus-Client-$(VERSION)/; done mv *.dll TestModbus-Client-$(VERSION)/ mv share TestModbus-Client-$(VERSION)/ diff --git a/client.cc b/client.cc index bcc6ef0..5ce291b 100644 --- a/client.cc +++ b/client.cc @@ -189,7 +189,7 @@ gboolean mbcli_thread_cb_modbusdata(gpointer data) { // integer values (16bit words) // gtk_text_buffer_get_end_iter(textbuffer, &end); - gtk_text_buffer_insert_with_tags_by_name(textbuffer, &end, " Addr RawData Integer Float Float(SW)\n", -1, "Head", NULL); + gtk_text_buffer_insert_with_tags_by_name(textbuffer, &end, " Addr RawData UInt16 SInt16 Float Float(SW)\n", -1, "Head", NULL); for (int i = 0; i < res->cnt; i++) { // add addr to textbuffer @@ -199,18 +199,18 @@ gboolean mbcli_thread_cb_modbusdata(gpointer data) { // add data to textbuffer text = to_hex16((int) res->data[i]); - if ((res->reg + i)%2 == 0 && i < res->cnt-1) { + if (i < res->cnt-1) { memcpy (((char*)&f1) + 0, &res->data[i], 2); memcpy (((char*)&f1) + 2, &res->data[i+1], 2); memcpy (((char*)&f2) + 2, &res->data[i], 2); memcpy (((char*)&f2) + 0, &res->data[i+1], 2); - snprintf (tmp, 255, " | %6d | %9.3g | %9.3g", res->data[i], f1, f2); + snprintf (tmp, 255, " | %6d | %6d | %11.5g | %11.5g", res->data[i], (int16_t) res->data[i], f1, f2); text = text + tmp; } else { - snprintf (tmp, 255, " | %6d | | ", res->data[i]); + snprintf (tmp, 255, " | %6d | %6d | | ", res->data[i]); text = text + tmp; }