资源简介
USBCANC.7z
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
//1.ZLGCAN系列接口卡信息的数据类型。
public struct VCI_BOARD_INFO
{
public UInt16 hw_Version;
public UInt16 fw_Version;
public UInt16 dr_Version;
public UInt16 in_Version;
public UInt16 irq_Num;
public byte can_Num;
[MarshalAs(UnmanagedType.ByValArray SizeConst=20)] public byte []str_Serial_Num;
[MarshalAs(UnmanagedType.ByValArray SizeConst = 40)]
public byte[] str_hw_Type;
[MarshalAs(UnmanagedType.ByValArray SizeConst = 8)]
public byte[] Reserved;
}
/////////////////////////////////////////////////////
//2.定义CAN信息帧的数据类型。
unsafe public struct VCI_CAN_OBJ //使用不安全代码
{
public uint ID;
public uint TimeStamp;
public byte TimeFlag;
public byte SendType;
public byte RemoteFlag;//是否是远程帧
public byte ExternFlag;//是否是扩展帧
public byte DataLen;
public fixed byte Data[8];
public fixed byte Reserved[3];
}
////2.定义CAN信息帧的数据类型。
//public struct VCI_CAN_OBJ
//{
// public UInt32 ID;
// public UInt32 TimeStamp;
// public byte TimeFlag;
// public byte SendType;
// public byte RemoteFlag;//是否是远程帧
// public byte ExternFlag;//是否是扩展帧
// public byte DataLen;
// [MarshalAs(UnmanagedType.ByValArray SizeConst = 8)]
// public byte[] Data;
// [MarshalAs(UnmanagedType.ByValArray SizeConst = 3)]
// public byte[] Reserved;
// public void Init()
// {
// Data = new byte[8];
// Reserved = new byte[3];
// }
//}
//3.定义CAN控制器状态的数据类型。
public struct VCI_CAN_STATUS
{
public byte ErrInterrupt;
public byte regMode;
public byte regStatus;
public byte regALCapture;
public byte regECCapture;
public byte regEWLimit;
public byte regRECounter;
public byte regTECounter;
[MarshalAs(UnmanagedType.ByValArray SizeConst = 4)]
public byte[] Reserved;
}
//4.定义错误信息的数据类型。
public struct VCI_ERR_INFO
{
public UInt32 ErrCode;
public byte Passive_ErrData1;
public byte Passive_ErrData2;
public byte Passive_ErrData3;
public byte ArLost_ErrData;
}
//5.定义初始化CAN的数据类型
public struct VCI_INIT_CONFIG
{
public UInt32 AccCode;
public UInt32 AccMask;
public UInt32 Reserved;
public byte Filter;
public byte Timing0;
public byte Timing1;
public byte Mode;
}
public struct CHGDESIPANDPORT
{
[MarshalAs(UnmanagedType.ByValArray SizeConst = 10)]
public byte[] szpwd;
[MarshalAs(UnmanagedType.ByValArray SizeConst = 20)]
public byte[] szdesip;
public Int32 desport;
public void Init()
{
szpwd = new byte[10];
szdesip = new byte[20];
}
}
namespace WindowsApplication1
{
public partial class Form1 : Form
{
const int VCI_
- 上一篇:zDialog2.3
- 下一篇:通信学报模板
相关资源
- BAT大厂APP架构演进实践与优化之路.
- 112.zip
- music_source.zip
- BES.rar
- xlicense_2014.lic
- 优酷视频地址解析器.rar
- pictoPDFV4.0cra.rar
- NetRouteView_v1.25.rar
- 小型贷款业务系统功能模块.zip
- 最新永久免费抖音、快手、火山、皮
- Lorenz系统最大Lyapunov指数程序程序通用
- LMCOMSOL_Multiphysics_SSQ.7z
- cad200864位缩图文件.rar
- 阿里云蓝色管理控制台+登录界面.7z
- 百度文库工具.rar
- 品优购完整项目(包含源码-视频-笔记
- SpringBoot-从零开发校园商铺平台带源码
- chrome密码获取工具.7z
- zxing.zip
- aa.txt
- Reg1024抢码工具_20141216.rar
- 跑马灯.rar
- Brother操作说明书(数据)_通信节选
- dw2xls和谐补丁.rar
- VMware11.x注册机10.x注册机11.x永久不过
- 微信授权登录.rar
- 20161209163650812.rar
- my-three-MiniProgram.zip
- ESO.rar
- 4.doc
评论
共有 条评论