Compare commits

..

No commits in common. '707ab5ac4b341b078bc41be1ac4f2f42e3383b08' and 'a0625f847f1a74ca76c307ec448b29d975ab725c' have entirely different histories.

@ -67,7 +67,7 @@ namespace BatCharging.Model
/// <summary> /// <summary>
/// 用户卡号/用户识别号(内容只能”0~9、A~Z、a~z 字符 ASCII 码,不够长度填’\0) /// 用户卡号/用户识别号(内容只能”0~9、A~Z、a~z 字符 ASCII 码,不够长度填’\0)
/// </summary> /// </summary>
public string value10 { get; set; } public UInt32 value10 { get; set; }
/// <summary> /// <summary>
/// 断网充电标志 /// 断网充电标志
/// <para>0-不允许</para> /// <para>0-不允许</para>

@ -943,6 +943,7 @@ namespace BatCharging.Service
} }
} }
/// <summary> /// <summary>
/// 接收事件 /// 接收事件
/// </summary> /// </summary>

@ -170,12 +170,12 @@ namespace BatCharging.Service
{ {
Array.Copy(byteArray, 0, bytes, 0, byteArray.Length); Array.Copy(byteArray, 0, bytes, 0, byteArray.Length);
} }
//else if (byteArray.Length > leng) else if (byteArray.Length > leng)
//{ {
// // 长度超过32字节可以截断或者抛出异常 // 长度超过32字节可以截断或者抛出异常
// Array.Copy(byteArray, 0, new byte[leng], 0, leng); // 截断数组到32字节 Array.Copy(byteArray, 0, new byte[leng], 0, leng); // 截断数组到32字节
//} }
return bytes; return byteArray;
} }
/// <summary> /// <summary>

@ -50,9 +50,9 @@ namespace BatCharging.Service
lstContent.AddRange(BitConverter.GetBytes(CMD1.value1)); lstContent.AddRange(BitConverter.GetBytes(CMD1.value1));
lstContent.AddRange(BitConverter.GetBytes(CMD1.value2)); lstContent.AddRange(BitConverter.GetBytes(CMD1.value2));
lstContent.Add(CMD1.value3); lstContent.Add(CMD1.value3);
lstContent.AddRange(BitConverter.GetBytes(CMD1.value4));//起始地址 lstContent.AddRange(BitConverter.GetBytes(CMD1.value4));
lstContent.Add(CMD1.value5);//查询个数 lstContent.Add(CMD1.value5);
lstContent.AddRange(BitConverter.GetBytes(CMD1.value6));//参数字节数 lstContent.AddRange(BitConverter.GetBytes(CMD1.value6));
if (CMD1.value3 == 1) if (CMD1.value3 == 1)
{ {
lstContent.AddRange(CMD1.value7); lstContent.AddRange(CMD1.value7);
@ -199,20 +199,19 @@ namespace BatCharging.Service
lstContent.AddRange(BitConverter.GetBytes(CMD.value01)); lstContent.AddRange(BitConverter.GetBytes(CMD.value01));
lstContent.AddRange(BitConverter.GetBytes(CMD.value02)); lstContent.AddRange(BitConverter.GetBytes(CMD.value02));
lstContent.Add(CMD.value03); lstContent.AddRange(BitConverter.GetBytes(CMD.value03));
lstContent.AddRange(BitConverter.GetBytes(CMD.value04)); lstContent.AddRange(BitConverter.GetBytes(CMD.value04));
lstContent.AddRange(BitConverter.GetBytes(CMD.value05)); lstContent.AddRange(BitConverter.GetBytes(CMD.value05));
lstContent.AddRange(BitConverter.GetBytes(CMD.value06));
lstContent.AddRange(BitConverter.GetBytes(CMD.value07)); lstContent.AddRange(BitConverter.GetBytes(CMD.value07));
lstContent.AddRange(BitConverter.GetBytes(CMD.value08)); lstContent.AddRange(BitConverter.GetBytes(CMD.value08));
lstContent.Add(CMD.value09); lstContent.AddRange(BitConverter.GetBytes(CMD.value09));
lstContent.AddRange(ByteUtils.ToByteByHexStr32(CMD.value10, 32)); lstContent.AddRange(BitConverter.GetBytes(CMD.value10));
lstContent.Add(CMD.value11); lstContent.AddRange(BitConverter.GetBytes(CMD.value11));
lstContent.AddRange(BitConverter.GetBytes(CMD.value12)); lstContent.AddRange(BitConverter.GetBytes(CMD.value12));
lstContent.AddRange(ByteUtils.ToByteByHexStr32(CMD.value13, 32)); lstContent.AddRange(ByteUtils.ToByteByHexStr32(CMD.value13, 32));
lstContent.Add(CMD.value14); lstContent.AddRange(BitConverter.GetBytes(CMD.value14));
lstContent.AddRange(BitConverter.GetBytes(CMD.value15)); lstContent.AddRange(BitConverter.GetBytes(CMD.value15));
lstContent.Add(CMD.value16); lstContent.AddRange(BitConverter.GetBytes(CMD.value16));
results = lstContent.ToArray(); results = lstContent.ToArray();
} }
return results; return results;
@ -357,8 +356,8 @@ namespace BatCharging.Service
lstContent.AddRange(BitConverter.GetBytes(CMD.value01)); lstContent.AddRange(BitConverter.GetBytes(CMD.value01));
lstContent.AddRange(BitConverter.GetBytes(CMD.value02)); lstContent.AddRange(BitConverter.GetBytes(CMD.value02));
lstContent.Add(CMD.value03); lstContent.AddRange(BitConverter.GetBytes(CMD.value03));
lstContent.Add(Convert.ToByte(CMD.value04)); lstContent.AddRange(BitConverter.GetBytes(CMD.value04));
results = lstContent.ToArray(); results = lstContent.ToArray();
} }
@ -572,6 +571,8 @@ namespace BatCharging.Service
model.CMD = 113; model.CMD = 113;
model.checksumDomain = 0x01; model.checksumDomain = 0x01;
model.dataDomain = GetRCMD113DataInfo(CMD); //数据域 model.dataDomain = GetRCMD113DataInfo(CMD); //数据域
model.LengthDomain = Convert.ToUInt16(9 + model.dataDomain.Length); //报文长度 model.LengthDomain = Convert.ToUInt16(9 + model.dataDomain.Length); //报文长度
@ -597,8 +598,8 @@ namespace BatCharging.Service
lstContent.AddRange(BitConverter.GetBytes(CMD.value01)); lstContent.AddRange(BitConverter.GetBytes(CMD.value01));
lstContent.AddRange(BitConverter.GetBytes(CMD.value02)); lstContent.AddRange(BitConverter.GetBytes(CMD.value02));
lstContent.Add(CMD.value03); lstContent.AddRange(BitConverter.GetBytes(CMD.value03));
lstContent.Add(Convert.ToByte(CMD.value04)); lstContent.AddRange(BitConverter.GetBytes(CMD.value04));
results = lstContent.ToArray(); results = lstContent.ToArray();
} }

@ -226,7 +226,7 @@ namespace Monitor.ChargeTest
{ {
byte type = 1;//类型 0-查询/1-设置 byte type = 1;//类型 0-查询/1-设置
uint startAddress = 2;//设置/查询参数起始地址 uint startAddress = 2;//设置/查询参数起始地址
byte num = 2;//设置/查询个数 byte num = 3;//设置/查询个数
byte[] setData = new byte[8];//设置数据 byte[] setData = new byte[8];//设置数据
setData[0] = 0; setData[0] = 0;
setData[1] = 1; setData[1] = 1;
@ -265,18 +265,10 @@ namespace Monitor.ChargeTest
/// <param name="e"></param> /// <param name="e"></param>
private void button16_Click(object sender, EventArgs e) private void button16_Click(object sender, EventArgs e)
{ {
byte type = 1;//充电枪口 byte type = 0;
uint startAddress = 1;//启始命令地址 uint startAddress = 9;
byte num = 2;//命令个数 byte num = 10;
byte[] setData = new byte[8];//命令参数 byte[] setData = null;
setData[0] = 0;
setData[1] = 1;
setData[2] = 2;
setData[3] = 3;
setData[4] = 4;
setData[5] = 5;
setData[6] = 6;
setData[7] = 7;
CmnChargerParam._CHR00TCPCLIENT.Send5(type, startAddress, num, setData); CmnChargerParam._CHR00TCPCLIENT.Send5(type, startAddress, num, setData);
} }
#endregion #endregion
@ -643,7 +635,7 @@ namespace Monitor.ChargeTest
CMD.value07 = 5; CMD.value07 = 5;
CMD.value08 = 6; CMD.value08 = 6;
CMD.value09 = 7; CMD.value09 = 7;
CMD.value10 = "123456789"; CMD.value10 = 8;
CMD.value11 = 9; CMD.value11 = 9;
CMD.value12 = 10; CMD.value12 = 10;
CMD.value13 = "12345678"; CMD.value13 = "12345678";

Loading…
Cancel
Save