McbOpenComEx funtion of mcbc12.lib for CAN communication

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

McbOpenComEx funtion of mcbc12.lib for CAN communication

ソリューションへジャンプ
4,058件の閲覧回数
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 件の賞賛
返信
1 解決策
4,003件の閲覧回数
MichalH
NXP Apps Support
NXP Apps Support

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

Regards,
Michal

元の投稿で解決策を見る

0 件の賞賛
返信
7 返答(返信)
4,047件の閲覧回数
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 件の賞賛
返信
4,043件の閲覧回数
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 件の賞賛
返信
4,037件の閲覧回数
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 件の賞賛
返信
4,017件の閲覧回数
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 件の賞賛
返信
4,004件の閲覧回数
MichalH
NXP Apps Support
NXP Apps Support

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

Regards,
Michal

0 件の賞賛
返信
4,046件の閲覧回数
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 件の賞賛
返信
4,042件の閲覧回数
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 件の賞賛
返信