Skip to content

Commit

Permalink
Publish 0.01.8
Browse files Browse the repository at this point in the history
  • Loading branch information
sdurnev committed Apr 5, 2020
1 parent f48ab3c commit 4fbd984
Show file tree
Hide file tree
Showing 12 changed files with 96 additions and 77 deletions.
4 changes: 4 additions & 0 deletions .idea/deployment.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/runConfigurations/generix_bacs_modbus_tcp_linux.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/runConfigurations/generix_bacs_modbus_tcp_macos.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/runConfigurations/generix_bacs_modbus_tcp_rpi.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions .idea/webServers.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

129 changes: 64 additions & 65 deletions add/tmp.json
Original file line number Diff line number Diff line change
@@ -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"
}
Binary file removed bin/0.01.7/linux/generix_bacs_modbus_tcp
Binary file not shown.
Binary file removed bin/0.01.7/macos/generix_bacs_modbus_tcp
Binary file not shown.
Binary file removed bin/0.01.7/rpi/generix_bacs_modbus_tcp
Binary file not shown.
Binary file removed bin/0.01.7/win/generix_bacs_modbus_tcp.exe
Binary file not shown.
17 changes: 9 additions & 8 deletions generix_bacs_modbus_tcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
!!!!!!!!!!!! VERSION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
*/
const version = "0.01.7"
const version = "0.01.8"

/*
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
}
Expand All @@ -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)
}
}
Expand Down

0 comments on commit 4fbd984

Please sign in to comment.