MicroPeckerX CAN FD Application Development Library for Windows
Frequently Asked Questions for MicroPeckerX CAN FD Application Development Library for Windows.
Product Specifications
My PC does not recognize the MicroPeckerX device. What should I do?
- Check whether the USB cable is connected correctly, and try another cable/port.
- Check whether
- If the driver is not installed correctly, install the latest USB driver from the download folder or website.
If it is still not recognized, try restarting the PC or disconnecting other USB devices.
- Check whether
MicroPeckerX appears in Device Manager.- If the driver is not installed correctly, install the latest USB driver from the download folder or website.
If it is still not recognized, try restarting the PC or disconnecting other USB devices.
MPXOpen : error appears when running a sample program.- This error occurs if the MicroPeckerX device is not connected correctly or is already in use by another application.
- Check that the USB driver is installed correctly.
- Check that firmware/library versions match the sample program version.
- Check that the USB driver is installed correctly.
- Check that firmware/library versions match the sample program version.
How can I obtain serial numbers when multiple devices are connected at the same time?
The return value of
You can select and control the target device from that array.
MPXOpen stores serial-number information of all connected devices in the StMPXDeviceInfo array.You can select and control the target device from that array.
// Example
StMPXDeviceInfo devices[4];
unsigned char count;
ER ret = MPXOpen(devices, &count);
if (ret == E_OK && count > 0) {
for (int i = 0; i < count; i++) {
printf("Serial No: %u\n", devices[i].Serial);
// You can distinguish each device by devices[i].Serial
}
}
CAN communication does not work. What settings/initialization steps should I check?
- Set communication parameters correctly with
- Start monitoring with
- Confirm communication conditions (baud rate, etc.) match the peer CAN device.
- Also verify termination settings.
MPXSetCANParam (baud rate, sample point, CAN FD mode, termination, etc.).- Start monitoring with
MPXMonitorStart after parameter setup.- Confirm communication conditions (baud rate, etc.) match the peer CAN device.
- Also verify termination settings.
// Example: set CAN parameters and start communication
StMPXCANParam param;
param.Mode = MPX_MODE_CAN_SIM; // or MPX_MODE_MONITOR
param.ArbitrationBaudrate = MPX_CAN_PARAM_ABR_500K;
param.ArbitrationSamplepoint = MPX_CAN_PARAM_SP_80P;
param.DataBaudrate = MPX_CAN_PARAM_DBR_2M;
param.DataSamplepoint = MPX_CAN_PARAM_SP_80P;
param.EnableTerminate = MPX_CAN_TERMINATE_ENABLE;
ER ret = MPXSetCANParam(serial, 1, ¶m); // CH1
if (ret != E_OK) {
printf("MPXSetCANParam : error\n");
}
ret = MPXMonitorStart(serial, MPX_SYNC_MASTER); // start monitor
if (ret != E_OK) {
printf("MonitorStart : error\n");
}
I don't understand how to set sample-program transmit data and slots.
- For slot transmission samples, use
- For direct transmission, use
See bundled sample code for details.
MPXSetSlot to set data/cycle in StMPXCANSlot, then perform transmission.- For direct transmission, use
MPXDirectSend and specify transmit data directly.See bundled sample code for details.
// Slot transmission (periodic) example:
StMPXCANSlot slot;
memset(&slot, 0, sizeof(slot));
slot.SlotNo = 0;
slot.FrameType.Enabled = MPX_CAN_SLOT_ENABLE;
slot.FrameType.FrameType = MPX_CAN_FRAME_TYPE_PERIODIC;
slot.FrameType.Option.Protocol = MPX_CAN_PROTOCOL_CANFD;
slot.FrameType.Option.BRS = MPX_CAN_BRS_ENABLE;
slot.Frame.ID.IDE = MPX_CAN_IDE_STD;
slot.Frame.ID.RTR = MPX_CAN_RTR_DATA;
slot.Frame.ID.ID = 0x300;
slot.msSendCycle = 10; // send every 10 ms
slot.SendCounter = 0; // unlimited
slot.Frame.DL = 8;
for (int i = 0; i < 8; i++) slot.Frame.Data[i] = i;
ER ret = MPXSetSlot(serial, 1, &slot, 1); // set slot on CH1
// Direct transmission (one-shot) example:
StMPXCANDirect frame;
memset(&frame, 0, sizeof(frame));
frame.FrameType.Option.Protocol = MPX_CAN_PROTOCOL_CANFD;
frame.FrameType.Option.BRS = MPX_CAN_BRS_ENABLE;
frame.Frame.ID.IDE = MPX_CAN_IDE_STD;
frame.Frame.ID.RTR = MPX_CAN_RTR_DATA;
frame.Frame.ID.ID = 0x350;
frame.Frame.DL = 8;
for (int i = 0; i < 8; i++) frame.Frame.Data[i] = i + 0x10;
ret = MPXDirectSend(serial, 1, &frame); // send to CH1
Can it operate with Classic CAN?
- Yes. This library supports both CAN FD and Classic CAN. For Classic CAN, set "FD disabled" and "data baud rate = arbitration baud rate" in communication parameters.
// Classic CAN setting example:
param.Mode = MPX_MODE_MONITOR; // Classic CAN
param.ArbitrationBaudrate = MPX_CAN_PARAM_ABR_500K;
param.DataBaudrate = MPX_CAN_PARAM_DBR_500K; // same value
param.FrameType.Option.Protocol = MPX_CAN_PROTOCOL_CAN; // disable CAN FD
Send/slot settings use the same interfaces as CAN FD.
After unplugging/replugging USB, communication may stop.
After unplugging USB once, restart the application or re-detect by
MPXClose -> MPXOpen. OS-side device re-recognition may take a few seconds, so wait briefly before operation.I don't know how to build the sample program.
Open the bundled Visual Studio project (
.sln), select platform/configuration as needed (Release/Debug, x86/x64), and build. Also confirm required DLL/library files exist in the execution folder.// C++ (Visual Studio) build example:
1. Open the .sln (solution) file in Visual Studio
2. Click [Build] -> [Build Solution]
3. Switch configuration to x86 or x64 as needed
4. Executable is generated in Release or Debug folder
What OS/development environments are verified?
Operation has been verified on Windows 10/11 (64-bit) and Visual Studio 2017/2019/2022. Other environments may work but are outside support scope.