V1.0.2.0
* Added RS232/RS485 Packet Analyzer (Tools -> Packet Analyzer) * Updated BMS History register request/response length by model * Fixed decimal truncation issue in Brazil locale for DB/CSV Log and Excel Export
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using DevExpress.Utils;
|
||||
using DevExpress.Utils;
|
||||
using DevExpress.XtraEditors.Repository;
|
||||
using DevExpress.XtraGrid;
|
||||
using DevExpress.XtraGrid.Columns;
|
||||
@@ -24,6 +24,7 @@ namespace LFP_Manager.Forms
|
||||
private byte[] rData = null;
|
||||
private ushort curr_addr = 0;
|
||||
private int recv_data_len = 0;
|
||||
private ushort req_reg_qty = 0x1C;
|
||||
|
||||
private int hist_no = 0;
|
||||
private bool stopReq = true;
|
||||
@@ -52,12 +53,14 @@ namespace LFP_Manager.Forms
|
||||
switch (Config.UartModelIndex)
|
||||
{
|
||||
case csConstData.MODEL_INDEX.LFPM_124050D:
|
||||
recv_data_len = 112;
|
||||
req_reg_qty = 0x35; // 53 registers
|
||||
recv_data_len = 112; // 1 (ID) + 1 (0x03) + 1 (0x6A/106 bytes) + 106 + 2 (CRC) = 111~112 bytes
|
||||
cell_qty = 39;
|
||||
temp_qty = 8;
|
||||
break;
|
||||
default:
|
||||
recv_data_len = 58;
|
||||
req_reg_qty = 0x1C; // 28 registers (0x1C)
|
||||
recv_data_len = 61; // 1 (ID) + 1 (0x03) + 1 (0x38/56 bytes) + 56 + 2 (CRC) = 61 bytes
|
||||
cell_qty = 16;
|
||||
temp_qty = 4;
|
||||
break;
|
||||
@@ -314,7 +317,7 @@ namespace LFP_Manager.Forms
|
||||
|
||||
LcGrResult.Text = $"Result ({rData.Length})";
|
||||
|
||||
if ((rData != null) && (rData.Length == recv_data_len))
|
||||
if ((rData != null) && (rData.Length == recv_data_len || (rData.Length >= 5 && rData[1] == 0x03 && rData.Length == (3 + rData[2] + 2))))
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -434,8 +437,8 @@ namespace LFP_Manager.Forms
|
||||
sdata[1] = 0x03; // Function Code
|
||||
sdata[2] = (byte)(addr >> 8); // Address H
|
||||
sdata[3] = (byte)(addr >> 0); // Address L
|
||||
sdata[4] = 0x00; // Number of Register H
|
||||
sdata[5] = 0x35; // Number of Register L
|
||||
sdata[4] = (byte)(req_reg_qty >> 8); // Number of Register H
|
||||
sdata[5] = (byte)(req_reg_qty >> 0); // Number of Register L
|
||||
|
||||
crc = csSerialCommFunction.GetCRC(sdata, 6);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user