193 lines
5.2 KiB
C#
193 lines
5.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace LFP_Manager.DataStructure
|
|
{
|
|
class csCanConstData
|
|
{
|
|
public class CanDeviceInfo
|
|
{
|
|
public const int VCI_PCI5121 = 1;
|
|
public const int VCI_PCI9810 = 2;
|
|
public const int VCI_USBCAN1 = 3;
|
|
public const int VCI_USBCAN2 = 4;
|
|
public const int VCI_USBCAN2A = 4;
|
|
public const int VCI_PCI9820 = 5;
|
|
public const int VCI_CAN232 = 6;
|
|
public const int VCI_PCI5110 = 7;
|
|
public const int VCI_CANLITE = 8;
|
|
public const int VCI_ISA9620 = 9;
|
|
public const int VCI_ISA5420 = 10;
|
|
public const int VCI_PC104CAN = 11;
|
|
public const int VCI_CANETUDP = 12;
|
|
public const int VCI_CANETE = 12;
|
|
public const int VCI_DNP9810 = 13;
|
|
public const int VCI_PCI9840 = 14;
|
|
public const int VCI_PC104CAN2 = 15;
|
|
public const int VCI_PCI9820I = 16;
|
|
public const int VCI_CANETTCP = 17;
|
|
public const int VCI_PEC9920 = 18;
|
|
public const int VCI_PCI5010U = 19;
|
|
public const int VCI_USBCAN_E_U = 20;
|
|
public const int VCI_USBCAN_2E_U = 21;
|
|
public const int VCI_PCI5020U = 22;
|
|
public const int VCI_EG20T_CAN = 23;
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="DeviceType"></param>
|
|
/// <param name="DeviceInd"></param>
|
|
/// <param name="Reserved"></param>
|
|
/// <returns></returns>
|
|
}
|
|
|
|
public static readonly string[] DEVICE_NAME =
|
|
{
|
|
"PCI5121",
|
|
"PCI9810",
|
|
"USBCAN1",
|
|
"USBCAN2",
|
|
"USBCAN2A",
|
|
"PCI9820",
|
|
"CAN232",
|
|
"PCI5110",
|
|
"CANLITE",
|
|
"ISA9620",
|
|
"ISA5420",
|
|
"PC104CAN",
|
|
"CANETUDP",
|
|
"CANETE",
|
|
"DNP9810",
|
|
"PCI9840",
|
|
"PC104CAN2",
|
|
"PCI9820I",
|
|
"CANETTCP",
|
|
"PEC9920",
|
|
"PCI5010U",
|
|
"USBCAN_E_U",
|
|
"USBCAN_2E_U",
|
|
"PCI5020U",
|
|
"EG20T_CAN",
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="DeviceType"></param>
|
|
/// <param name="DeviceInd"></param>
|
|
/// <param name="Reserved"></param>
|
|
/// <returns></returns>
|
|
};
|
|
|
|
public static readonly int[] DEVICE_ID =
|
|
{
|
|
1,
|
|
2,
|
|
3,
|
|
4,
|
|
4,
|
|
5,
|
|
6,
|
|
7,
|
|
8,
|
|
9,
|
|
10,
|
|
11,
|
|
12,
|
|
12,
|
|
13,
|
|
14,
|
|
15,
|
|
16,
|
|
17,
|
|
18,
|
|
19,
|
|
20,
|
|
21,
|
|
22,
|
|
23,
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="DeviceType"></param>
|
|
/// <param name="DeviceInd"></param>
|
|
/// <param name="Reserved"></param>
|
|
/// <returns></returns>
|
|
};
|
|
|
|
//0x060003--1000Kbps
|
|
//0x060004--800Kbps
|
|
//0x060007--500Kbps
|
|
//0x1C0008--250Kbps
|
|
//0x1C0011--125Kbps
|
|
//0x160023--100Kbps
|
|
//0x1C002C--50Kbps
|
|
//0x1600B3--20Kbps
|
|
//0x1C00E0--10Kbps
|
|
//0x1C01C1--5Kbps
|
|
|
|
public static readonly int[] CAN_BAUDRATE =
|
|
{
|
|
0x060003,
|
|
0x060004,
|
|
0x060007,
|
|
0x1C0008,
|
|
0x1C0011,
|
|
0x160023,
|
|
0x1C002C,
|
|
0x1600B3,
|
|
0x1C00E0,
|
|
0x1C01C1
|
|
};
|
|
|
|
//USBCAN II Baudrate
|
|
public static readonly int[] CAN_BAUDRATE_OTHER = // Timer 0 + Timer 1
|
|
{
|
|
0x0014, // 1000Kbps
|
|
0x0016, // 800Kbps
|
|
0x001C, // 500Kbps
|
|
0x011C, // 250Kbps
|
|
0x031C, // 125Kbps
|
|
0x041C, // 100Kbps
|
|
0x091C, // 50Kbps
|
|
0x181C, // 20Kbps
|
|
0x311C, // 10Kbps
|
|
0xBFFF // 5Kbps
|
|
};
|
|
|
|
public static readonly string[] CAN_BAUDRATE_STR =
|
|
{
|
|
"1000Kbps",
|
|
"800Kbps",
|
|
"500Kbps",
|
|
"250Kbps",
|
|
"125Kbps",
|
|
"100Kbps",
|
|
"50Kbps",
|
|
"20Kbps",
|
|
"10Kbps",
|
|
"5Kbps"
|
|
};
|
|
|
|
public class SendType
|
|
{
|
|
public const int Normal = 0;
|
|
public const int Single_Normal = 1;
|
|
public const int Loop_Back = 2;
|
|
public const int Single_Loop_Back = 3;
|
|
}
|
|
|
|
public class FrameType
|
|
{
|
|
public const int Standard = 0;
|
|
public const int Extended = 1;
|
|
}
|
|
|
|
public class FrameFormat
|
|
{
|
|
public const int Data_Frame = 0;
|
|
public const int Remote_Frame = 1;
|
|
}
|
|
}
|
|
}
|