Controlling two FreeMaster instances from one MATLAB script

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

Controlling two FreeMaster instances from one MATLAB script

ソリューションへジャンプ
5,456件の閲覧回数
Ahmed_Abd_El-Hafez
Contributor III

Hello NXP team,

I want to make a MATLAB script file that can access, monitor and control two FreeMaster instances. I read the section talking about this in the user guide but still have problems and the example attached was for one FreeMaster and didn't work with me for the two FreeMaster instances. The .m file that I am trying to build , is till now only opens the two files but can't write or read from them. It gives this error:

Dot indexing is not supported for variables of this type.

Error in SingleScriptControlling2FM (line 15)
bSucc = pcm1.ReadVariable('SpeedActRpm');

Does any one have a script for this purpose or can help with this error?

Thank you in advance.

Ahmed

1 解決策
4,132件の閲覧回数
MichalH
NXP Apps Support
NXP Apps Support

Hello Ahmed, 

I confirm your script (the mmult_test() function) works as expected on my side. I tried on two Windows 11 systems. On a corporate PC with strict security rules, the Excel will not let the script to launch the FreeMASTER processes, so I had to run them manually first:

pcmaster /sharex TRQ
pcmaster /sharex SPD

Then the script was able to get access to running instances. Followed by a message:

MichalH_0-1718367771180.png

...which is obvious as I have an empty project in the TRQ instance.

 

In the 2nd experiment using my home PC, the Excel was able to launch and control the instances. I'm really not sure what can be blocking the access on your side. Can you try the same on a different PC?

Regards,
Michal

 

元の投稿で解決策を見る

0 件の賞賛
返信
24 返答(返信)
660件の閲覧回数
Ahmed_Abd_El-Hafez
Contributor III

Thank you Michal. I attached the excel file.

I tried opening the two instances manually and then run the VBA code to locate them but it also couldn't.

 

0 件の賞賛
返信
651件の閲覧回数
Ahmed_Abd_El-Hafez
Contributor III

Hello Michal,

Have you checked the script? the problem still exists.

Ahmed

0 件の賞賛
返信
4,133件の閲覧回数
MichalH
NXP Apps Support
NXP Apps Support

Hello Ahmed, 

I confirm your script (the mmult_test() function) works as expected on my side. I tried on two Windows 11 systems. On a corporate PC with strict security rules, the Excel will not let the script to launch the FreeMASTER processes, so I had to run them manually first:

pcmaster /sharex TRQ
pcmaster /sharex SPD

Then the script was able to get access to running instances. Followed by a message:

MichalH_0-1718367771180.png

...which is obvious as I have an empty project in the TRQ instance.

 

In the 2nd experiment using my home PC, the Excel was able to launch and control the instances. I'm really not sure what can be blocking the access on your side. Can you try the same on a different PC?

Regards,
Michal

 

0 件の賞賛
返信
600件の閲覧回数
Ahmed_Abd_El-Hafez
Contributor III

I tried it on another PC and it works.

Thank you very much ,Michal.

0 件の賞賛
返信