Controlling two FreeMaster instances from one MATLAB script

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

Controlling two FreeMaster instances from one MATLAB script

Jump to solution
4,411 Views
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 Solution
3,087 Views
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

 

View solution in original post

0 Kudos
Reply
24 Replies
523 Views
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 Kudos
Reply
514 Views
Ahmed_Abd_El-Hafez
Contributor III

Hello Michal,

Have you checked the script? the problem still exists.

Ahmed

0 Kudos
Reply
3,088 Views
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 Kudos
Reply
463 Views
Ahmed_Abd_El-Hafez
Contributor III

I tried it on another PC and it works.

Thank you very much ,Michal.

0 Kudos
Reply