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
10,330 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
9,006 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
1,635 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
1,626 Views
Ahmed_Abd_El-Hafez
Contributor III

Hello Michal,

Have you checked the script? the problem still exists.

Ahmed

0 Kudos
Reply
9,007 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
1,575 Views
Ahmed_Abd_El-Hafez
Contributor III

I tried it on another PC and it works.

Thank you very much ,Michal.

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-1856051%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EControlling%20two%20FreeMaster%20instances%20from%20one%20MATLAB%20script%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1856051%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%20NXP%20team%2C%3C%2FP%3E%3CP%3EI%20want%20to%20make%20a%20MATLAB%20script%20file%20that%20can%20access%2C%26nbsp%3B%3CU%3E%3CSTRONG%3Emonitor%20and%20control%3C%2FSTRONG%3E%3C%2FU%3E%20two%20FreeMaster%20instances.%20I%20read%20the%20section%20talking%20about%20this%20in%20the%20user%20guide%20but%20still%20have%20problems%20and%20the%20example%20attached%20was%20for%20one%20FreeMaster%20and%20didn't%20work%20with%20me%20for%20the%20two%20FreeMaster%20instances.%20The%20.m%20file%20that%20I%20am%20trying%20to%20build%20%2C%20is%20till%20now%20only%20opens%20the%20two%20files%20but%20can't%20write%20or%20read%20from%20them.%20It%20gives%20this%20error%3A%3C%2FP%3E%3CP%3E%3CFONT%20color%3D%22%23FF0000%22%3EDot%20indexing%20is%20not%20supported%20for%20variables%20of%20this%20type.%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20color%3D%22%23FF0000%22%3EError%20in%20SingleScriptControlling2FM%20(line%2015)%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20color%3D%22%23FF0000%22%3EbSucc%20%3D%20pcm1.ReadVariable('SpeedActRpm')%3B%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20color%3D%22%23000000%22%3EDoes%20any%20one%20have%20a%20script%20for%20this%20purpose%20or%20can%20help%20with%20this%20error%3F%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20color%3D%22%23000000%22%3EThank%20you%20in%20advance.%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20color%3D%22%23000000%22%3EAhmed%3C%2FFONT%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1895777%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Controlling%20two%20FreeMaster%20instances%20from%20one%20MATLAB%20script%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1895777%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EI%20tried%20it%20on%20another%20PC%20and%20it%20works.%3C%2FP%3E%3CP%3EThank%20you%20very%20much%20%2CMichal.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1887896%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Controlling%20two%20FreeMaster%20instances%20from%20one%20MATLAB%20script%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1887896%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%20Ahmed%2C%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20confirm%20your%20script%20(the%26nbsp%3Bmmult_test()%20function)%20works%20as%20expected%20on%20my%20side.%20I%20tried%20on%20two%20Windows%2011%20systems.%20On%20a%20corporate%20PC%20with%20strict%20security%20rules%2C%20the%20Excel%20will%20not%20let%20the%20script%20to%20launch%20the%20FreeMASTER%20processes%2C%20so%20I%20had%20to%20run%20them%20manually%20first%3A%3C%2FP%3E%0A%3CPRE%3Epcmaster%20%2Fsharex%20TRQ%3CBR%20%2F%3Epcmaster%20%2Fsharex%20SPD%3C%2FPRE%3E%0A%3CP%3EThen%20the%20script%20was%20able%20to%20get%20access%20to%20running%20instances.%20Followed%20by%20a%20message%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22MichalH_0-1718367771180.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22MichalH_0-1718367771180.png%22%20style%3D%22width%3A%20374px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F284241iEB8BD27676F78FF2%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22MichalH_0-1718367771180.png%22%20alt%3D%22MichalH_0-1718367771180.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E...which%20is%20obvious%20as%20I%20have%20an%20empty%20project%20in%20the%20TRQ%20instance.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EIn%20the%202nd%20experiment%20using%20my%20home%20PC%2C%20the%20Excel%20was%20able%20to%20launch%20and%20control%20the%20instances.%20I'm%20really%20not%20sure%20what%20can%20be%20blocking%20the%20access%20on%20your%20side.%20Can%20you%20try%20the%20same%20on%20a%20different%20PC%3F%3C%2FP%3E%0A%3CP%3ERegards%2C%3CBR%20%2F%3EMichal%3C%2FP%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1886015%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Controlling%20two%20FreeMaster%20instances%20from%20one%20MATLAB%20script%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1886015%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%20Michal%2C%3C%2FP%3E%3CP%3EHave%20you%20checked%20the%20script%3F%20the%20problem%20still%20exists.%3C%2FP%3E%3CP%3EAhmed%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1871048%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Controlling%20two%20FreeMaster%20instances%20from%20one%20MATLAB%20script%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1871048%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EThank%20you%20Michal.%20I%20attached%20the%20excel%20file.%3C%2FP%3E%3CP%3EI%20tried%20opening%20the%20two%20instances%20manually%20and%20then%20run%20the%20VBA%20code%20to%20locate%20them%20but%20it%20also%20couldn't.%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1868984%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Controlling%20two%20FreeMaster%20instances%20from%20one%20MATLAB%20script%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1868984%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHmm%2C%20this%20seems%20the%20%22mult%22%20object%20living%20in%20Excel%20VBA%20has%20a%20problem%20to%20launch%20FreeMASTER%20with%20correct%20instance%20name%20as%20argument.%20I%20think%20you%20have%20a%20problem%20in%20the%20way%20you%20pass%20the%20instance%20name%20(%22A%22%20or%20%22B%22)%20when%20you%20call%20%22GetAppObject%22.%20You%20can%20upload%20the%20Excel%20file%20as%20an%20attachment%20so%20I%20could%20take%20a%20look%20at%20the%20script.%3C%2FP%3E%0A%3CP%3EAnyway%2C%20if%20you%20run%20the%20instances%20manually%20from%20command-line%20with%20the%20name%20%22A%22%20(pcmaster.exe%20%2Fsharex%20A)%20or%20with%20the%20name%20%22B%22%20(pcmaster.exe%20%2Fsharex%20B).%20Then%20the%20Excel%20VBA%20should%20be%20able%20to%20locate%20it.%3C%2FP%3E%0A%3CP%3ERegards%2C%3CBR%20%2F%3EMichal%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1868946%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Controlling%20two%20FreeMaster%20instances%20from%20one%20MATLAB%20script%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1868946%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EIt%20just%20runs%20the%20two%20instances%20and%20cannot%20access%20them%20and%20gives%20the%20error%20in%20the%20figure%20below.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22pic1.PNG%22%20style%3D%22width%3A%20334px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22pic1.PNG%22%20style%3D%22width%3A%20334px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F279648iDB1FC949C5AAEAE2%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22pic1.PNG%22%20alt%3D%22pic1.PNG%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EThe%20examples%20you%20mentioned%20tries%20to%20access%20one%20FreeMaster%20only%20not%20two.%20Accessing%20one%20FreeMaster%20had%20worked%20with%20me%20before.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1868611%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Controlling%20two%20FreeMaster%20instances%20from%20one%20MATLAB%20script%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1868611%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%20Ahmed%2C%26nbsp%3B%3C%2FP%3E%0A%3CP%3Egood%20that%20you%20got%20it%20working%20from%20Matlab.%20Let's%20focus%20the%20Excel%20issue%20now.%20When%20it%20starts%20two%20new%20instances%20-%20does%20the%20VBA%20script%20access%20the%20instances%20then%3F%20I%20mean%20can%20the%20Excel%20VBA%20use%20the%20FreeMASTER%20objects%20to%20read%26amp%3Bwrite%20variables%20etc%3F%3C%2FP%3E%0A%3CP%3EIf%20yes%2C%20then%20there%20will%20some%20simple%20issue%20with%20instance%20names.%20If%20it%20just%20runs%20the%20instances%2C%20but%20still%20cannot%20access%20them%2C%20then%20there%20might%20be%20some%20issue%20with%20access%20rights.%3C%2FP%3E%0A%3CP%3EExperiments%20to%20try%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3ERun%20the%20pcmaster.exe%20manually%20and%20give%20it%20some%20trivial%20name%20such%20as%20A%20or%20B.%20Do%20not%20use%20any%20special%20characters%20etc.%20Then%20use%20the%20same%20name%20in%20the%20VBA%20script.%3C%2FLI%3E%0A%3CLI%3ERun%20the%20Excel%20as%20administrator.%3C%2FLI%3E%0A%3CLI%3ETry%20the%20simple%20Excel%20examples%20in%20located%20in%20%22c%3A%5CNXP%5CFreeMASTER%203.2%5CFreeMASTER%5Cexamples%5Cscripting%5CVisual%20Basic%20Application%20-%20Excel%22.%20Do%20they%20work%3F%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EThanks%2C%3CBR%20%2F%3EMichal%3C%2FP%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1868165%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Controlling%20two%20FreeMaster%20instances%20from%20one%20MATLAB%20script%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1868165%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CBR%20%2F%3E%3CP%3EThank%20you%20very%20much%20for%20your%20effort%2C%20Michal.%3C%2FP%3E%3CP%3E1-I%20installed%20the%20version%203.2.3.2%20and%20the%20problem%20of%20getting%20away%20from%20the%20FreeMaster%20window%20was%20solved.%3C%2FP%3E%3CP%3E2-I%20applied%20the%20way%20of%20giving%20sharex%20name%20for%20a%20specific%20instance%20in%20a%20specific%20path%20like%20your%20example%20above%20and%20then%20pass%20this%20sharex%20name%20to%20the%20GetAppObject%20()%20method%20and%20this%20way%20works%20properly%20with%20MATLAB%20script.%20So%20the%20problem%20of%20MATLAB%20is%20solved%20now.%3C%2FP%3E%3CP%3EBut%20when%20doing%20the%20same%20with%20Excell%20it%20can't%20locate%20the%20two%20running%20FreeMaster%20instances%20instead%20of%20this%20it%20opens%20two%20new%20instances%20why%3F%3C%2FP%3E%3CP%3ERegards%26nbsp%3B%3C%2FP%3E%3CP%3EAhmed%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1866878%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Controlling%20two%20FreeMaster%20instances%20from%20one%20MATLAB%20script%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1866878%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%20Ahmed%2C%3C%2FP%3E%0A%3CP%3Ethe%20first%20parameter%20after%20%2Fsharex%20option%20is%20NOT%20the%20name%20of%20the%20pmp%20project%20file%2C%20it%20is%20a%20name%20under%20which%20the%20running%20instance%20will%20be%20identified%20for%20mult.GetAppObject.%20If%20you%20want%20to%20open%20a%20project%20too%2C%20you%20need%20to%20specify%20it%20after%20the%20name.%3C%2FP%3E%0A%3CP%3EExamples%3A%3C%2FP%3E%0A%3CPRE%3Epcmaster.exe%20C%3A%5Cpath%5CSpdControl.pmp%26nbsp%3B%20%26nbsp%3B%20%2F%2F%20will%20just%20open%20the%20project%20file%3CBR%20%2F%3Epcmaster.exe%20%2Fsharex%20SPD%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%2F%2F%20will%20run%20the%20FreeMASTER%20named%20SPD%2C%20%3CBR%20%2F%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%26nbsp%3Bso%20you%20can%20attach%20to%20it%20using%26nbsp%3BGetAppObject(%22SPD%22)%3CBR%20%2F%3Epcmaster.exe%20%2Fsharex%20SPD%20C%3A%5Cpath%5CSpdControl.pmp%20%20%2F%2F%20will%20do%20both%3C%2FPRE%3E%0A%3CP%3ESo%2C%20in%20all%20your%20examples%20you%20passed%20just%20one%20argument%20after%20%2Fsharex%20option%2C%20which%20means%20it%20should%20have%20started%20the%20FreeMASTER%20without%20opening%20any%20project.%26nbsp%3BYou%20say%20that%20the%20application%20closes%20immediately%20after%20started...%20this%20may%20be%20an%20indication%20of%20a%20problem%20with%20installation.%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3ECan%20you%20make%20sure%20you%20are%20running%20version%203.2.3.2%3F%20(see%20in%20the%20Help%2FAbout%20dialog).%3C%2FLI%3E%0A%3CLI%3ECan%20you%20try%20the%20same%20on%20a%20different%20PC%3F%3C%2FLI%3E%0A%3CLI%3ECan%20you%20try%20to%20start%20just%20%22pcmaster.exe%22%20without%20any%20argument%20to%20see%20if%20it%20will%20run%20properly%3F%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EThanks%2C%3CBR%20%2F%3EMichal%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1866393%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Controlling%20two%20FreeMaster%20instances%20from%20one%20MATLAB%20script%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1866393%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EWhen%20I%20write%20this%20command%20as%20shown%2C%20it%20opens%20a%20new%20FreeMaster%20project%20for%20moments%20and%20close%20it%20away.%20It%20doesn't%20open%20the%20already%20created%20project%20%22SpdControl.pmp%22%20why%3F%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Ahmed_Abd_ElHafez_0-1715783886736.png%22%20style%3D%22width%3A%20661px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Ahmed_Abd_ElHafez_0-1715783886736.png%22%20style%3D%22width%3A%20661px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F278928i18A8778EC38BEE32%2Fimage-dimensions%2F661x98%3Fv%3Dv2%22%20width%3D%22661%22%20height%3D%2298%22%20role%3D%22button%22%20title%3D%22Ahmed_Abd_ElHafez_0-1715783886736.png%22%20alt%3D%22Ahmed_Abd_ElHafez_0-1715783886736.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1864364%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Controlling%20two%20FreeMaster%20instances%20from%20one%20MATLAB%20script%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1864364%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EThe%20%2Fsharex%20is%20a%20command-line%20option%20which%20you%20can%20use%20as%20a%20parameter%20when%20running%20the%20FreeMASTER%20process%20(pcmaster.exe).%20You%20need%20to%20run%20it%20manually%20from%20command%20line%20prompt%2C%20or%20you%20can%20create%20a%20launcher%20icon%20with%20the%20parameter.%3C%2FP%3E%0A%3CP%3ESteps%20to%20run%20it%20manually.%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3EOpen%20Windows%20Explorer%20and%20browse%20to%26nbsp%3B%22c%3A%5CNXP%5CFreeMASTER%203.2%22%26nbsp%3B%3C%2FLI%3E%0A%3CLI%3ERight%20click%20the%20FreeMASTER%20folder%20and%20select%20%22Open%20in%20Terminal%22%3C%2FLI%3E%0A%3CLI%3EType%26nbsp%3B%3CSTRONG%3E.%5Cpcmaster.exe%20%2Fsharex%20%3CEM%3ENAME%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3CLI%3EThe%20%3CEM%3ENAME%3C%2FEM%3E%20is%20your%20name%20which%20later%20use%20in%20the%20GetAppObject()%20call%26nbsp%3B%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22MichalH_2-1715596200192.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22MichalH_2-1715596200192.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F278452iAA101D9B45DA8696%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22MichalH_2-1715596200192.png%22%20alt%3D%22MichalH_2-1715596200192.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22MichalH_1-1715595731028.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22MichalH_1-1715595731028.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F278451i1B31FB612F6D4DDC%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22MichalH_1-1715595731028.png%22%20alt%3D%22MichalH_1-1715595731028.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3ERegards%2C%3CBR%20%2F%3EMichal%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1863867%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Controlling%20two%20FreeMaster%20instances%20from%20one%20MATLAB%20script%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1863867%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EOk%20I%20will%20try%20on%20another%20PC.%3C%2FP%3E%3CP%3EI%20didn't%20understand%20this%20sentence%3A%20%22%3CSPAN%3EAnyway%2C%20if%20FreeMASTER%20is%20started%20manually%20with%20the%20proper%20%22%2Fsharex%22%20option%2C%20then%20the%20VBA%20scripts%20runs%20normally%20-%20so%20this%20is%20must%20be%20a%20different%20issue%20from%20yours.%22%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3Eand%20in%20this%20%3A%26nbsp%3BPlease%20try%20to%20do%20one%20more%20experiment%20and%20start%20the%20applications%20manually.%20Locate%20the%20pcmaster.exe%20file%20in%20the%20installation%20and%20run%20it%20from%20command%20line%20with%20an%20argument%26nbsp%3B%3CSTRONG%3E%2Fsharex%20%22A%22%26nbsp%3B%26nbsp%3B%3C%2FSTRONG%3Eand%20the%20other%20with%26nbsp%3B%3CSTRONG%3E%2Fsharex%20%22B%22.%26nbsp%3B%3C%2FSTRONG%3EThen%20try%20the%20script%20with%20%22A%22%20and%20%22B%22%20names.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EDo%20you%20mean%20to%20simply%20rename%20the%20instances%20by%20A%26amp%3B%20B%20or%20what%20%3F%20I%20feel%20that%20I%20misunderstand%20something.%20How%20to%20use%20this%26nbsp%3B%20%2Fsharex%20%3F%3C%2FP%3E%3CP%3E%3CSPAN%3EThank%20you%20for%20your%20cooperation.%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1862515%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Controlling%20two%20FreeMaster%20instances%20from%20one%20MATLAB%20script%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1862515%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20have%20tested%20the%20Excel%20script%20on%20a%20PC%20with%20fresh%20Windows%2011%20and%20the%20latest%20Excel%2032bit.%20All%20seem%20to%20work%20properly.%26nbsp%3BIs%20it%20possible%20for%20you%20to%20test%20on%20another%20PC%3F%3C%2FP%3E%0A%3CP%3EIn%20the%20meanwhile%2C%20I%20have%20noticed%20that%20on%20some%20of%20our%20corporate%20PCs%2C%20the%20GetAppObject%20fails%20to%20start%20the%20FreeMASTER%20process%20due%20to%20a%20security%20policy.%20The%20failed%20start%20can%20be%20seen%20in%20the%20%22Protection%20History%22%20log%20in%20Windows%20Security%20panel%20(picture%20attached).%3C%2FP%3E%0A%3CP%3EAnyway%2C%20if%20FreeMASTER%20is%20started%20manually%20with%20the%20proper%20%22%2Fsharex%22%20option%2C%20then%20the%20VBA%20scripts%20runs%20normally%20-%20so%20this%20is%20must%20be%20a%20different%20issue%20from%20yours.%26nbsp%3B%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3ESo%20far%2C%20no%20answer%20to%20your%20issue.%20Let's%20continue%20investigating.%20Please%20finish%20your%20experiment%20with%20manual%20start%20of%20the%20shared%20instances%20and%20also%20please%20try%20on%20a%20different%20PC.%3C%2FP%3E%0A%3CP%3EThank%20you%2C%3CBR%20%2F%3EMichal%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22MichalH_0-1715256758369.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22MichalH_0-1715256758369.png%22%20style%3D%22width%3A%20899px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F277970i551578553491A998%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22MichalH_0-1715256758369.png%22%20alt%3D%22MichalH_0-1715256758369.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1861595%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Controlling%20two%20FreeMaster%20instances%20from%20one%20MATLAB%20script%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1861595%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3Eok%20I%20will%20try%20this%20and%20wait%20for%20your%20try%20also.Thank%20you%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1860491%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Controlling%20two%20FreeMaster%20instances%20from%20one%20MATLAB%20script%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1860491%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%20Ahmed%2C%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20will%20retry%20with%2032bit%20Excel%2C%20this%20will%20need%20some%20time.%26nbsp%3B%3C%2FP%3E%0A%3CP%3EPlease%20try%20to%20do%20one%20more%20experiment%20and%20start%20the%20applications%20manually.%20Locate%20the%20pcmaster.exe%20file%20in%20the%20installation%20and%20run%20it%20from%20command%20line%20with%20an%20argument%20%3CSTRONG%3E%2Fsharex%20%22A%22%26nbsp%3B%26nbsp%3B%3C%2FSTRONG%3Eand%20the%20other%20with%20%3CSTRONG%3E%2Fsharex%20%22B%22.%20%3C%2FSTRONG%3EThen%20try%20the%20script%20with%20%22A%22%20and%20%22B%22%20names.%3CSTRONG%3E%3CBR%20%2F%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EThe%20question%20is%20if%20your%20Excel%20would%20locate%20the%20two%20running%20instances%20or%20if%20it%20will%20start%20another%20two%20new%20instances.%3C%2FP%3E%0A%3CP%3EThank%20you%20for%20you%20cooperation%2C%3CBR%20%2F%3EMichal%3C%2FP%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1859931%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Controlling%20two%20FreeMaster%20instances%20from%20one%20MATLAB%20script%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1859931%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3ESame%20error%20in%20the%20same%20line%20when%20I%20used%20exactly%20your%20code%20without%20any%20change.%3C%2FP%3E%3CP%3EYes%20a%20%26amp%3B%20b%20are%20set%20to%20nothing.%3C%2FP%3E%3CP%3EWhen%20I%20run%20register.bat%20it%20gives%20black%20window%20momentarily%20and%20then%20disappears.%20I%20don't%20know%20what%20this%20means.%3C%2FP%3E%3CP%3EThe%20Excel%20I%20use%20is%2032%20bit.%20It%20seems%20that%20this%20causes%20the%20difference.%26nbsp%3B%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1859673%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Controlling%20two%20FreeMaster%20instances%20from%20one%20MATLAB%20script%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1859673%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3ECan%20you%20try%20exactly%20my%20code%3F%20Just%20to%20compare%20the%20behaviors.%20Note%20that%20there%20may%20be%20difference%20in%2032bit%20and%2064bit%20version%20of%20Excel.%20I'm%20testing%2064bit%20version.%3C%2FP%3E%0A%3CP%3EYou%20can%20also%20put%20breakpoint%20to%20examine%20a%20and%20b%20variables%20if%20they%20are%20indeed%20set%20to%20%22Nothing%22.%26nbsp%3B%3C%2FP%3E%0A%3CP%3EJust%20to%20be%20fully%20sure%20the%20installation%20is%20correct%2C%20please%20run%20%22register.bat%22%20as%20administrator%20in%20the%20FreeMASTER%20installation%20folder%20(c%3A%5CNXP%5CFreeMASTER%203.2%5CFreeMASTER%5Cregister.bat)%3C%2FP%3E%0A%3CP%3EThanks%2C%3CBR%20%2F%3EMichal%3C%2FP%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1859624%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Controlling%20two%20FreeMaster%20instances%20from%20one%20MATLAB%20script%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1859624%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%20Michal%2C%3C%2FP%3E%3CP%3EThank%20you%20for%20your%20help.%20It%20opens%20two%20new%20FreeMaster%20files%20momentarily%20and%20then%20gives%20this%20error.%3C%2FP%3E%3CDIV%20class%3D%22%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22err1.PNG%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22err1.PNG%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F277217i9C2FBD1CA5E54757%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22err1.PNG%22%20alt%3D%22err1.PNG%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FDIV%3E%3CP%3Eon%20this%20line%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-left%22%20image-alt%3D%22errr1.PNG%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22errr1.PNG%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F277215iE7BC00FF577558DD%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22errr1.PNG%22%20alt%3D%22errr1.PNG%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CP%3EI%20replaced%20%22A%22%20%26amp%3B%20%22B%22%20by%20the%20names%20of%20my%20files%20written%20like%20%22SpdControl.pmp%22%20and%20tried%20also%20to%20write%20the%20total%20pathes%20of%20files%20since%20I%20want%20to%20open%20these%20two%20files%20not%20to%20open%20two%20new%20instances.%20I%20had%20the%20objects%20referenced%20in%20VBA.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22errrr1.PNG%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22errrr1.PNG%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F277216i955981EBC9CABB5F%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22errrr1.PNG%22%20alt%3D%22errrr1.PNG%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1859458%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Controlling%20two%20FreeMaster%20instances%20from%20one%20MATLAB%20script%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1859458%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%20Ahmed%2C%3C%2FP%3E%0A%3CP%3Ethe%20script%20below%20works%20in%20my%20test%20Excel%20file.%20Make%20sure%20you%20have%20the%20objects%20referenced%20in%20VBA.%20Go%20to%20Tools%2FReferences%20menu%20and%20check%20both%20FreeMASTER%20and%20also%20mmaster%20object%20(you%20may%20need%20to%20browse%20for%20mmaster.dll%20in%20the%20FreeMASTER%20installation).%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22MichalH_2-1714978633536.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22MichalH_2-1714978633536.png%22%20style%3D%22width%3A%20445px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F277172iEA814D8092779AE8%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22MichalH_2-1714978633536.png%22%20alt%3D%22MichalH_2-1714978633536.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CBR%20%2F%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-php%22%3E%3CCODE%3EDim%20mult%20As%20McbMult%0A%0ASub%20start_A()%0A%20%20%20%20If%20mult%20Is%20Nothing%20Then%0A%20%20%20%20%20%20%20%20Set%20mult%20%3D%20New%20McbMult%0A%20%20%20%20End%20If%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20Set%20a%20%3D%20mult.GetAppObject(%22A%22%2C%201)%0AEnd%20Sub%0A%0ASub%20start_B()%0A%20%20%20%20If%20mult%20Is%20Nothing%20Then%0A%20%20%20%20%20%20%20%20Set%20mult%20%3D%20New%20McbMult%0A%20%20%20%20End%20If%0A%20%20%20%20%0A%20%20%20%20Set%20b%20%3D%20mult.GetAppObject(%22B%22%2C%201)%0AEnd%20Sub%0A%0ASub%20mmult_test()%0A%0A%20%20%20%20If%20mult%20Is%20Nothing%20Then%0A%20%20%20%20%20%20%20%20Set%20mult%20%3D%20New%20McbMult%0A%20%20%20%20End%20If%0A%20%20%20%20%0A%20%20%20%20Dim%20a%20As%20McbPcm%0A%20%20%20%20Dim%20b%20As%20McbPcm%0A%20%20%20%20%0A%20%20%20%20Set%20a%20%3D%20mult.GetAppObject(%22A%22%2C%201)%0A%20%20%20%20Set%20b%20%3D%20mult.GetAppObject(%22B%22%2C%201)%0A%20%20%20%20%0A%20%20%20%20If%20a.ReadVariable(%22var16%22%2C%20v1%2C%20t1%2C%20m1)%20Then%0A%20%20%20%20%20%20%20%20MsgBox%20(%22Variable%20from%20instance%20A%20%22%20%2B%20t1)%0A%20%20%20%20Else%0A%20%20%20%20%20%20%20%20MsgBox%20(%22Error%20reading%20from%20instance%20A%3A%20%22%20%2B%20m1)%0A%20%20%20%20End%20If%0A%20%20%20%20%0A%20%20%20%20If%20b.ReadVariable(%22var16%22%2C%20v2%2C%20t2%2C%20m2)%20Then%0A%20%20%20%20%20%20%20%20MsgBox%20(%22Variable%20from%20instance%20B%20%22%20%2B%20t2)%0A%20%20%20%20Else%0A%20%20%20%20%20%20%20%20MsgBox%20(%22Error%20reading%20from%20instance%20B%3A%20%22%20%2B%20m2)%0A%20%20%20%20End%20If%0A%0AEnd%20Sub%0A%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1859059%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Controlling%20two%20FreeMaster%20instances%20from%20one%20MATLAB%20script%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1859059%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EOk%2C%20I%20am%20waiting%20for%20you%20to%20investigate%20this%20more.%20Thanks%20a%20lot%20for%20your%20effort.%3C%2FP%3E%3CP%3EI%20am%20trying%20to%20make%20it%20by%20Excel%20using%20Visual%20Basic%20and%20I%20started%20by%20this%20code%20%3A%3C%2FP%3E%3CP%3ESub%20mmult_test()%3CBR%20%2F%3EDim%20a%20As%20McbPcm%3CBR%20%2F%3EDim%20b%20As%20McbPcm%3CBR%20%2F%3EDim%20mult%20As%20McbMult%3C%2FP%3E%3CP%3ESet%20mult%20%3D%20New%20McbMult%3CBR%20%2F%3ESet%20a%20%3D%20mult.GetAppObject(%22A%22)%3CBR%20%2F%3ESet%20b%20%3D%20mult.GetAppObject(%22B%22)%3C%2FP%3E%3CP%3EDim%20bSucc%20As%20Boolean%3C%2FP%3E%3CP%3E'ReadVariable%20uses%20FreeMASTER%20variable%20object%20from%20current%20project.%20Use%3CBR%20%2F%3E'ReadUIntVariable%20to%20access%20the%20memory%20directly%20using%20a%20symbol%20name.%3CBR%20%2F%3ESet%20bSucc%20%3D%20a.ReadVariable(%22SPEED_CMD%22%2C%20vValue%2C%20tValue%2C%20bsRetMsg)%3CBR%20%2F%3EIf%20bSucc%20Then%3CBR%20%2F%3Esht.Range(%22B1%22).Value%20%3D%20vValue%3CBR%20%2F%3EEnd%20If%3C%2FP%3E%3CP%3EIf%20b.ReadVariable(%22TrqCtrlSwitch%22%2C%20%22B3%22)%20Then%3CBR%20%2F%3EMsgBox%20(%22Variable%20from%20instance%20B%20%22%20%2B%20t2)%3CBR%20%2F%3EElse%3CBR%20%2F%3EMsgBox%20(%22Error%20reading%20from%20instance%20B%3A%20%22%20%2B%20m2)%3CBR%20%2F%3EEnd%20If%3CBR%20%2F%3EEnd%20Sub%3C%2FP%3E%3CP%3EThat%20I%20saw%20in%20the%20question%20here%3A%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FFreeMASTER%2FMultiple-instances-using-ActiveX-in-VB%2Ftd-p%2F1340033%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fcommunity.nxp.com%2Ft5%2FFreeMASTER%2FMultiple-instances-using-ActiveX-in-VB%2Ftd-p%2F1340033%3C%2FA%3E%3C%2FP%3E%3CP%3Ebut%20I%20got%20a%20compiler%20error%20at%20this%20line%3A%26nbsp%3BSet%20bSucc%20%3D%20a.ReadVariable(%22SPEED_CMD%22%2C%20vValue%2C%20tValue%2C%20bsRetMsg)%20the%20error%20says%3A%20%22Object%20Required%22%26nbsp%3B%20and%20when%20I%20removed%20%22Set%22%20it%20gives%20me%20%3A%20%22Object%20variable%20or%20with%20block%20variable%20not%20set%22%20I%20think%20it%20can't%20see%20the%20object%20returned%20by%20GetAppObject%20also.%20If%20you%20have%20tested%20it%20before%20to%20control%20two%20FreeMaster%20instances%20using%20Excell%20please%20help%20me%20in%20this.%3C%2FP%3E%3CP%3ERegards%2C%3C%2FP%3E%3CP%3EAhmed%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1858841%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Controlling%20two%20FreeMaster%20instances%20from%20one%20MATLAB%20script%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1858841%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%3C%2FP%3E%0A%3CP%3Ethis%20must%20be%20some%20shortcoming%20of%20Matlab.%20It%20does%20not%20recognize%20the%20VARIANT%20value%20returned%20by%20GetAppObject%20is%20actually%20an%20IDispatch%20ActiveX%20interface.%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20other%20scripting%20languages%20(e.g.%20VBA%2C%20VBScript%2C%20JScript)%20this%20approach%20works%20fine.%3C%2FP%3E%0A%3CP%3ELet%20me%20investigate%20more.%20According%20to%20%3CA%20href%3D%22https%3A%2F%2Fwww.mathworks.com%2Fhelp%2Fmatlab%2Fmatlab_external%2Fhandling-com-data-in-matlab-software.html%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ethis%3C%2FA%3E%20page%2C%20Matlab%20shall%20handle%20it%20correctly.%26nbsp%3B%20I%20do%20not%20have%20a%20solution%20right%20now.%3C%2FP%3E%0A%3CP%3ERegards%2C%3CBR%20%2F%3EMichal%3C%2FP%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1858820%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Controlling%20two%20FreeMaster%20instances%20from%20one%20MATLAB%20script%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1858820%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EThank%20you%20Michal%20for%20your%20response.%20I%20wrote%20these%20lines%20%3A%3C%2FP%3E%3CDIV%20class%3D%22%22%3E%3CDIV%20class%3D%22%22%3E%3CSPAN%3Emult%20%3D%20actxserver('MCB.MULT')%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%3CSPAN%3Epcm1%3Dmult.GetAppObject('SpdControl')%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%3CSPAN%3Epcm2%3Dmult.GetAppObject('TrqControl')%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%3CSPAN%3Epcm1.WriteVariable('SPEED_CMD'%2C700)%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%3CSPAN%3Ebut%20it%20gives%20me%20this%20error%3A%26nbsp%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%3CP%3E%5B%5D%3C%2FP%3E%3CP%3EDot%20indexing%20is%20not%20supported%20for%20variables%20of%20this%20type.%3C%2FP%3E%3CP%3EError%20in%20SingleScriptControlling2FM%20(line%209)%3CBR%20%2F%3Epcm1.WriteVariable('SPEED_CMD'%2C700)%3B%3C%2FP%3E%3CP%3Eis%20there%20anything%20that%20I%20have%20missed%3F%3C%2FP%3E%3CP%3EAhmed%3C%2FP%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1858813%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Controlling%20two%20FreeMaster%20instances%20from%20one%20MATLAB%20script%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1858813%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%20Ahmed%2C%3C%2FP%3E%0A%3CP%3E%3CSPAN%3Ethe%20MCB.MULT%20is%20an%20identifier%20of%20an%20object%20which%20helps%20you%20to%20manage%20multiple%20running%20instances%20of%20FreeMASTER.%20It%20only%20has%20one%20method%26nbsp%3BGetAppObject%2C%20but%20this%20is%20quite%20versatile.%20Read%20User%20Manual%20section%206.9%20for%20more%20information.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EWith%20the%20GetAppObject%20you%20can%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CSPAN%3EGet%20an%20interface%20object%20as%20an%20ActiveX%20interface%20to%20a%20%22named%22%20running%20instance%20of%20FreeMASTER%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3ERun%20a%20named%20instance%20if%20not%20yet%20running.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3ERun%20a%20named%20instance%20and%20load%20a%20project.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CSPAN%3ESteps%20to%20control%20two%20or%20more%20FreeMASTER%20instances%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3E%3CSPAN%3ERun%20instance%20A%20manually%20by%20starting%20pcmaster.exe%20process.%26nbsp%3BGive%20it%20a%20name%20using%20command-line%20parameter%26nbsp%3B%22%2Fsharex%20A%22.%20When%20FreeMASTER%20starts%2C%26nbsp%3Bconfigure%20board%20connection%2C%20open%20project%20etc.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3ESimilarly%2C%20run%20the%20instance%20named%20%22B%22%20and%20connect%20to%20a%20second%20board.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EIn%20matlab%2C%20call%20%3C%2FSPAN%3E%0A%3CUL%3E%0A%3CLI%3E%3CSPAN%3EpcmA%20%3D%20mult.GetAppObject(%22A%22)%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EpcmB%20%3D%20mult.GetAppObject(%22B%22)%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3ENow%20you%20can%20use%20each%20object%20to%20read%20variables%20and%20do%20other%20control%20specific%20to%20each%20board.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%3CSPAN%3EAlternatively%2C%20you%20can%20save%20the%20projects%20to%20projectA.pcmx%20and%20projectB.pcmx.%20Make%20sure%20to%20check%20the%20%22Save%20settings%20to%20project%20file%22%20so%20the%20communication%20settings%20is%20saved.%20Then%20you%20can%20pass%20the%20name%20of%20each%20project%20as%20a%203rd%20argument%20of%20GetAppObject%20and%20it%20will%20take%20care%20about%20running%20the%20FreeMASTER%20and%20loading%20the%20project%20automatically%20along%20with%20communication%20settings.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EYet%20another%20alternative%20is%20to%20start%20instances%20A%20and%20B%20from%20Matlab%20as%20indicated%20above%20(without%20opening%20a%20project)%20and%20then%20orchestrate%20everything%20from%20script%20using%20StartComm%20and%20OpenProject%20methods%20executed%20on%20pcmA%20and%20pcmB%20objects.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3ERegards%2C%3CBR%20%2F%3EMichal%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1857944%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Controlling%20two%20FreeMaster%20instances%20from%20one%20MATLAB%20script%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1857944%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CP%3EThis%20Problem%20highlighted%20in%20red%20color%20was%20solved%20by%20initializing%20pcm%20as%20an%20object%20sothat%20I%20can%20use%20dot%20indexing%20with%20it.%20%3CSTRONG%3EBut%20now%2C%3C%2FSTRONG%3E%20the%20script%20can%20read%20and%20write%20in%20one%20FreeMaster%20not%20two.%20How%20can%20I%20use%20%3CFONT%20color%3D%22%230000FF%22%3E%3CSPAN%3Emult%20%3D%20actxserver(%3C%2FSPAN%3E%3CSPAN%3E'MCB.MULT'%3C%2FSPAN%3E%3C%2FFONT%3E%3CSPAN%3E%3CFONT%20color%3D%22%230000FF%22%3E)%3B%20%3C%2FFONT%3E%26nbsp%3B%3CFONT%20color%3D%22%23000000%22%3Eto%20make%20it%20listen%20to%20two%20different%20FreeMaster%20instances%20with%20two%20boards%20on%20two%20COMs%3F%20does%20it%20need%20the%20ProgID%20as%20I%20read%3F%20if%20so%2C%20how%20can%20I%20obtain%20the%20ProgID%20of%20each%20board%3F%20Please%2C%20can%20any%20one%20help%20with%20this%3F%3C%2FFONT%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CFONT%20color%3D%22%23000000%22%3EAhmed%26nbsp%3B%3C%2FFONT%3E%3C%2FSPAN%3E%3C%2FP%3E%3CDIV%20class%3D%22%22%3E%3CDIV%20class%3D%22%22%3E%26nbsp%3B%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E