void Btn_CardInit_Click(object sender, EventArgs e) { int status = -1; headcard = new HZC_Head08Card(1, 7); try { if (CAN_flag) { status = headcard.Initial(1, 0); if (status == 0) { SetText("初始化成功!", -1); for (int i = 0; i < 8; i++) { headcard.SetPfParam(i, 35, 0.03, 0); headcard.SetPfParam(i, 70, 0.026, 1); headcard.SetPfParam(i, 100, 0.024, 2); headcard.SetPfParam(i, 130, 0.024, 3); headcard.SetPfParam(i, 170, 0.020, 4); headcard.SetPfParam(i, 200, 0.015, 5); } Card_flag = true; } else { SetText("初始化失败!", -1); Card_flag = false; } } else { SetText("请打开CAN卡!", -1); } } catch { } }