McbOpenComEx funtion of mcbc12.lib for CAN communication

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

McbOpenComEx funtion of mcbc12.lib for CAN communication

Jump to solution
2,269 Views
IkerL
Contributor I

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

0 Kudos
1 Solution
2,214 Views
MichalH
NXP Apps Support
NXP Apps Support

Thanks for the feedback. Please mark the above answer as "correct".

Regards,
Michal

View solution in original post

0 Kudos
7 Replies
2,258 Views
MichalH
NXP Apps Support
NXP Apps Support

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

 

0 Kudos
2,254 Views
IkerL
Contributor I

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

0 Kudos
2,248 Views
MichalH
NXP Apps Support
NXP Apps Support

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

0 Kudos
2,228 Views
IkerL
Contributor I

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

0 Kudos
2,215 Views
MichalH
NXP Apps Support
NXP Apps Support

Thanks for the feedback. Please mark the above answer as "correct".

Regards,
Michal

0 Kudos
2,257 Views
MichalH
NXP Apps Support
NXP Apps Support

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

0 Kudos
2,253 Views
IkerL
Contributor I

Hello again Michal,

I will install FreeMaster 3.1 and I will use the mcbc30.lib library as you recommend me.

Thanks,

Iker

0 Kudos