Hello,
I am trying to communicate with a MPC5744P microcontroller using the function "McbOpenComEx" of the mcbc12.lib library in my Visual C++ project. I want to communicate via the Over CAN plug-in module and I am using the following connect string for the function "McbOpenComEx ":
"{C10A92C3-7D47-4FDC-94B6-64B8E5C85E01};drv=ixxat;port=1;bitrate=250000;cmdid=0x7aa;rspid=0x7aa;tmo=500".
I can not communicate with the microcontroller. Am I using the correct connect string?
Thanks,
Iker
Solved! Go to Solution.
Thanks for the feedback. Please mark the above answer as "correct".
Regards,
Michal
Dear Iker,
yes the connect string seems good to me for the FreeMASTER-over-CAN communication. What is the error code that you get? Does the normal desktop FreeMASTER application work well with your board when using this configuration and the IXXAT interface?
Thanks,
Michal
Hello Michal,
the normal FreeMASTER application (I use FreeMaster 2.0) communicates well with the board via over-CAN using the IXXAT interface. When I try to communicate with my Visual C++ application the McbOpenComEx function returns the 0x800401F0 value.
Thanks,
Iker
Hello Iker,
this is the standard Windows error "CoInitialize has not been called.". As FreeMASTER plug-ins use the Microsoft COM+ technology, the caller thread needs to initialize it before opening the plug-ins.
Also, don't forget to call McbAttachThread() from each thread (other than the thread which has opened the port) before accessing any other Mcb methods.
Regards,
Michal
Hello Michal,
I am still using the mcbc12.lib library and it seems after coinitializing the communication with our microcontroller is OK because the "McbOpenComEx" function returns the 0 value.
Thanks,
Iker
Thanks for the feedback. Please mark the above answer as "correct".
Regards,
Michal
One more point: you should upgrade to FreeMASTER 3.1 and use its mcbc30.dll library to be able to connect to target boards supporting either classic communication or the new "protocol v4" communication.
Visit https://www.nxp.com/freemaster to download the latest version.
Regards,
Michal
Hello again Michal,
I will install FreeMaster 3.1 and I will use the mcbc30.lib library as you recommend me.
Thanks,
Iker