{
ZCAN_Transmit_Data[] inData = new ZCAN_Transmit_Data[1];
inData[0] = new ZCAN_Transmit_Data();
inData[0].write();
inData[0].transmit_type = 1;
ZCAN_CAN_FRAME frame = new ZCAN_CAN_FRAME();
frame.can_id = canid;
frame.can_dlc = 8;
byte[] bytedata = hexStrtoByte(data);
frame.data = bytedata;
frame.write();
inData[0].frame = frame;
int value = zlgcan.ZCAN_Transmit(initID, inData, 1);
if (value != 1) {
throw new Exception("发送CAN数据异常!");
} else {
return value;
}
}