diff --git a/.idea/deployment.xml b/.idea/deployment.xml
new file mode 100644
index 0000000..ed5d93a
--- /dev/null
+++ b/.idea/deployment.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/generix_bacs_modbus_tcp_linux.xml b/.idea/runConfigurations/generix_bacs_modbus_tcp_linux.xml
index 4e96a6f..0fbfe68 100644
--- a/.idea/runConfigurations/generix_bacs_modbus_tcp_linux.xml
+++ b/.idea/runConfigurations/generix_bacs_modbus_tcp_linux.xml
@@ -10,7 +10,7 @@
-
+
diff --git a/.idea/runConfigurations/generix_bacs_modbus_tcp_macos.xml b/.idea/runConfigurations/generix_bacs_modbus_tcp_macos.xml
index 448da04..f871891 100644
--- a/.idea/runConfigurations/generix_bacs_modbus_tcp_macos.xml
+++ b/.idea/runConfigurations/generix_bacs_modbus_tcp_macos.xml
@@ -10,7 +10,7 @@
-
+
diff --git a/.idea/runConfigurations/generix_bacs_modbus_tcp_rpi.xml b/.idea/runConfigurations/generix_bacs_modbus_tcp_rpi.xml
index 7792d20..7c85f07 100644
--- a/.idea/runConfigurations/generix_bacs_modbus_tcp_rpi.xml
+++ b/.idea/runConfigurations/generix_bacs_modbus_tcp_rpi.xml
@@ -11,7 +11,7 @@
-
+
diff --git a/.idea/runConfigurations/generix_bacs_modbus_tcp_windows.xml b/.idea/runConfigurations/generix_bacs_modbus_tcp_windows.xml
index dcb3961..3c97faf 100644
--- a/.idea/runConfigurations/generix_bacs_modbus_tcp_windows.xml
+++ b/.idea/runConfigurations/generix_bacs_modbus_tcp_windows.xml
@@ -10,7 +10,7 @@
-
+
diff --git a/.idea/webServers.xml b/.idea/webServers.xml
new file mode 100644
index 0000000..af9faea
--- /dev/null
+++ b/.idea/webServers.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/add/tmp.json b/add/tmp.json
index 89557c8..239a680 100644
--- a/add/tmp.json
+++ b/add/tmp.json
@@ -1,112 +1,111 @@
{
"1000_BACS_ALARM": [
"BACS_ALARM_NONE",
- "BACS_ALARM_DISCHARGING",
- "BACS_ALARM_FLOAT_CHARGING"
+ "BACS_ALARM_DISCHARGING_STOPPED"
],
"1001_BACS_ALARM": [
- "BACS_STATE_THERMAL_RUNAWAY"
+ "BACS_STATE_NONE"
],
"1002_BACS_ALARM": [
- "ВACS_ALARM_TEMPERATURE_WARN_HIGH"
+ "ВACS_ALARM_NONE"
],
"1003_BACS_NUMSTRINGS": 3,
"1004_BACS_NUMMODULES": 12,
- "1010_STRING_01_CUR": -9999.00,
- "1011_ВACS_StrSummVolt": 54.00,
- "1012_ВACS_StrAvgVolt": 13.00,
- "1013_ВACS_StrCurrAC": -99.00,
- "1015_STRING_02_CUR": -9999.00,
- "1016_ВACS_StrSummVolt": 54.00,
- "1017_ВACS_StrAvgVolt": 13.00,
- "1018_ВACS_StrCurrAC": -99.00,
- "1020_STRING_03_CUR": -9999.00,
- "1021_ВACS_StrSummVolt": 54.00,
- "1022_ВACS_StrAvgVolt": 13.00,
- "1023_ВACS_StrCurrAC": -99.00,
- "1060_MODULE_001_TEMP": 32.00,
- "1061_MODULE_001_VOLT": 13.00,
- "1062_MODULE_001_IMPC": 4.00,
+ "1010_STRING_01_CUR": 0.00,
+ "1011_ВACS_StrSummVolt": 54.60,
+ "1012_ВACS_StrAvgVolt": 13.66,
+ "1013_ВACS_StrCurrAC": -99.99,
+ "1015_STRING_02_CUR": 0.00,
+ "1016_ВACS_StrSummVolt": 54.60,
+ "1017_ВACS_StrAvgVolt": 13.66,
+ "1018_ВACS_StrCurrAC": -99.99,
+ "1020_STRING_03_CUR": 0.00,
+ "1021_ВACS_StrSummVolt": 54.60,
+ "1022_ВACS_StrAvgVolt": 13.66,
+ "1023_ВACS_StrCurrAC": -99.99,
+ "1060_MODULE_001_TEMP": 19.50,
+ "1061_MODULE_001_VOLT": 13.66,
+ "1062_MODULE_001_IMPC": 4.99,
"1063_MODULE_001_ALARM": [
- "ВACS_ALARM_TEMPERATURE_WARN_HIGH"
+ "ВACS_ALARM_NONE"
],
- "1064_MODULE_001_EQ": 0.00,
- "1065_MODULE_002_TEMP": 30.00,
- "1066_MODULE_002_VOLT": 13.00,
- "1067_MODULE_002_IMPC": 3.00,
+ "1064_MODULE_001_EQ": 0.13,
+ "1065_MODULE_002_TEMP": 21.50,
+ "1066_MODULE_002_VOLT": 13.66,
+ "1067_MODULE_002_IMPC": 4.73,
"1068_MODULE_002_ALARM": [
- "ВACS_ALARM_TEMPERATURE_WARN_HIGH"
+ "ВACS_ALARM_NONE"
],
- "1069_MODULE_002_EQ": 0.00,
- "1070_MODULE_003_TEMP": 30.00,
- "1071_MODULE_003_VOLT": 13.00,
- "1072_MODULE_003_IMPC": 4.00,
+ "1069_MODULE_002_EQ": 0.21,
+ "1070_MODULE_003_TEMP": 22.00,
+ "1071_MODULE_003_VOLT": 13.66,
+ "1072_MODULE_003_IMPC": 4.33,
"1073_MODULE_003 ALARM": [
"ВACS_ALARM_NONE"
],
- "1074_MODULE_003_EQ": 0.00,
- "1075_MODULE_004_TEMP": 27.00,
- "1076_MODULE_004_VOLT": 13.00,
- "1077_MODULE_004_IMPC": 4.00,
+ "1074_MODULE_003_EQ": 0.08,
+ "1075_MODULE_004_TEMP": 22.50,
+ "1076_MODULE_004_VOLT": 13.66,
+ "1077_MODULE_004_IMPC": 5.09,
"1078_MODULE_004_ALARM": [
"ВACS_ALARM_NONE"
],
- "1079_MODULE_004_EQ": 0.00,
- "1080_MODULE_005_TEMP": 29.00,
- "1081_MODULE_005_VOLT": 13.00,
- "1082_MODULE_005_IMPC": 3.00,
+ "1079_MODULE_004_EQ": 0.08,
+ "1080_MODULE_005_TEMP": 22.50,
+ "1081_MODULE_005_VOLT": 13.63,
+ "1082_MODULE_005_IMPC": 4.81,
"1083_MODULE_005_ALARM": [
"ВACS_ALARM_NONE"
],
"1084_MODULE_005_EQ": 0.00,
- "1085_MODULE_006_TEMP": 31.00,
- "1086_MODULE_006_VOLT": 13.00,
- "1087_MODULE_006_IMPC": 3.00,
+ "1085_MODULE_006_TEMP": 22.50,
+ "1086_MODULE_006_VOLT": 13.61,
+ "1087_MODULE_006_IMPC": 4.38,
"1088_MODULE_006_ALARM": [
- "ВACS_ALARM_TEMPERATURE_WARN_HIGH"
+ "ВACS_ALARM_NONE"
],
"1089_MODULE_006_EQ": 0.00,
- "1090_MODULE_007_TEMP": 32.00,
- "1091_MODULE_007_VOLT": 13.00,
- "1092_MODULE_007_IMPC": 4.00,
+ "1090_MODULE_007_TEMP": 22.00,
+ "1091_MODULE_007_VOLT": 13.57,
+ "1092_MODULE_007_IMPC": 4.40,
"1093_MODULE_007_ALARM": [
- "ВACS_ALARM_TEMPERATURE_WARN_HIGH"
+ "ВACS_ALARM_NONE"
],
"1094_MODULE_007_EQ": 0.00,
- "1095_MODULE_008_TEMP": 32.00,
- "1096_MODULE_008_VOLT": 13.00,
- "1097_MODULE_008_IMPC": 3.00,
+ "1095_MODULE_008_TEMP": 20.00,
+ "1096_MODULE_008_VOLT": 13.82,
+ "1097_MODULE_008_IMPC": 4.33,
"1098_MODULE_008_ALARM": [
- "ВACS_ALARM_TEMPERATURE_WARN_HIGH"
+ "ВACS_ALARM_NONE"
],
"1099_MODULE_008_EQ": 0.00,
- "1100_MODULE_009_TEMP": 33.00,
- "1101_MODULE_009_VOLT": 13.00,
- "1102_MODULE_009_IMPC": 4.00,
+ "1100_MODULE_009_TEMP": 20.00,
+ "1101_MODULE_009_VOLT": 13.81,
+ "1102_MODULE_009_IMPC": 5.10,
"1103_MODULE_009_ALARM": [
- "ВACS_ALARM_TEMPERATURE_WARN_HIGH"
+ "ВACS_ALARM_NONE"
],
"1104_MODULE_009_EQ": 0.00,
- "1105_MODULE_010_TEMP": 31.00,
- "1106_MODULE_010_VOLT": 13.00,
- "1107_MODULE_010_IMPC": 5.00,
+ "1105_MODULE_010_TEMP": 21.50,
+ "1106_MODULE_010_VOLT": 13.65,
+ "1107_MODULE_010_IMPC": 4.07,
"1108_MODULE_010_ALARM": [
- "ВACS_ALARM_TEMPERATURE_WARN_HIGH"
+ "ВACS_ALARM_NONE"
],
"1109_MODULE_010_EQ": 0.00,
- "1110_MODULE_011_TEMP": 30.00,
- "1111_MODULE_011_VOLT": 13.00,
- "1112_MODULE_011_IMPC": 5.00,
+ "1110_MODULE_011_TEMP": 22.00,
+ "1111_MODULE_011_VOLT": 13.60,
+ "1112_MODULE_011_IMPC": 5.50,
"1113_MODULE_011_ALARM": [
- "ВACS_ALARM_TEMPERATURE_WARN_HIGH"
+ "ВACS_ALARM_NONE"
],
"1114_MODULE_011_EQ": 0.00,
- "1115_MODULE_012_TEMP": 28.00,
- "1116_MODULE_012_VOLT": 13.00,
- "1117_MODULE_012_IMPC": 3.00,
+ "1115_MODULE_012_TEMP": 23.50,
+ "1116_MODULE_012_VOLT": 13.58,
+ "1117_MODULE_012_IMPC": 4.36,
"1118_MODULE_012_ALARM": [
"ВACS_ALARM_NONE"
],
"1119_MODULE_012_EQ": 0.00,
- "version": "0.01.7"
+ "version": "0.01.8"
}
diff --git a/bin/0.01.7/linux/generix_bacs_modbus_tcp b/bin/0.01.7/linux/generix_bacs_modbus_tcp
deleted file mode 100755
index 69e24a3..0000000
Binary files a/bin/0.01.7/linux/generix_bacs_modbus_tcp and /dev/null differ
diff --git a/bin/0.01.7/macos/generix_bacs_modbus_tcp b/bin/0.01.7/macos/generix_bacs_modbus_tcp
deleted file mode 100755
index 233f6ff..0000000
Binary files a/bin/0.01.7/macos/generix_bacs_modbus_tcp and /dev/null differ
diff --git a/bin/0.01.7/rpi/generix_bacs_modbus_tcp b/bin/0.01.7/rpi/generix_bacs_modbus_tcp
deleted file mode 100755
index 4bd38af..0000000
Binary files a/bin/0.01.7/rpi/generix_bacs_modbus_tcp and /dev/null differ
diff --git a/bin/0.01.7/win/generix_bacs_modbus_tcp.exe b/bin/0.01.7/win/generix_bacs_modbus_tcp.exe
deleted file mode 100755
index 19b633e..0000000
Binary files a/bin/0.01.7/win/generix_bacs_modbus_tcp.exe and /dev/null differ
diff --git a/generix_bacs_modbus_tcp.go b/generix_bacs_modbus_tcp.go
index feda4ce..e62acb2 100644
--- a/generix_bacs_modbus_tcp.go
+++ b/generix_bacs_modbus_tcp.go
@@ -13,7 +13,7 @@ import (
!!!!!!!!!!!! VERSION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
*/
-const version = "0.01.7"
+const version = "0.01.8"
/*
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -82,6 +82,7 @@ func main() {
MainUnits.bacssens = tmpSens
} else { // модули с 1060 по 1159 еслих менее 20
t3 := readModbus(serverParam, s, uint16(1060), 5*systemStatus.nummodules)
+ //fmt.Println(t3)
MainUnits.bacssens = parceSensors(t3)
}
printAnsver(MainUnits)
@@ -121,9 +122,9 @@ func parceBacsStrings(data []byte) []bacsString {
for i := 0; i < len(data); i += 10 {
var s bacsString
s.current = float64(int16(binary.BigEndian.Uint16(data[i : i+2])))
- s.summvolt = float64(int16(binary.BigEndian.Uint16(data[i+2:i+4])) / 10)
- s.avgvolt = float64(int16(binary.BigEndian.Uint16(data[i+4:i+6])) / 1000)
- s.currac = float64(int16(binary.BigEndian.Uint16(data[i+8:i+10])) / 100)
+ s.summvolt = float64(int16(binary.BigEndian.Uint16(data[i+2:i+4]))) / 10
+ s.avgvolt = float64(int16(binary.BigEndian.Uint16(data[i+4:i+6]))) / 1000
+ s.currac = float64(int16(binary.BigEndian.Uint16(data[i+8:i+10]))) / 100
s.reserv = float64(int16(binary.BigEndian.Uint16(data[i+10 : i+12])))
ansver = append(ansver, s)
}
@@ -138,11 +139,11 @@ func parceSensors(data []byte) []sensor {
//fmt.Println(i)
if binary.BigEndian.Uint16(data[i:i+2]) != 55537 {
var s sensor
- s.temp = float64((int16(binary.BigEndian.Uint16(data[i:i+2])) - 78) / 2)
- s.volt = float64(int16(binary.BigEndian.Uint16(data[i+2:i+4])) / 1000)
- s.impc = float64(int16(binary.BigEndian.Uint16(data[i+4:i+6])) / 100)
+ s.temp = (float64(int16(binary.BigEndian.Uint16(data[i:i+2]))) - 78) / 2
+ s.volt = (float64(int16(binary.BigEndian.Uint16(data[i+2 : i+4])))) / 1000
+ s.impc = (float64(int16(binary.BigEndian.Uint16(data[i+4 : i+6])))) / 100
s.alarm = SensorAlarmDecode(data[i+6 : i+8])
- s.eq = float64(int16(binary.BigEndian.Uint16(data[i+8:i+10])) / 100)
+ s.eq = (float64(int16(binary.BigEndian.Uint16(data[i+8 : i+10])))) / 100
ansver = append(ansver, s)
}
}