I'm run a program to communicate with an external device by a serial communication in Matlab. When i test it, it is working instantly.
Then i created a Windows standalone application and it takes more than 13 seconds to run.
Normally having created the windows standalone application is not expected to accelerate the program? Any idea to speed up or fix it ?
Below is my code with the serial communication i run in matlab :
function [VOR_freq,Distance]= remote_programv2 (filename, com_port)
while 1 %% Open serial port ser=serial(com_port); fopen(ser); if true % code end %% Open abd read file (1st line: Frequency, 2nd line: Distance, 3rd line:Distance) fid=fopen(filename); A = fscanf(fid, '%f'); fclose(fid);
%% Calculate Channel VOR_freq= A(1); Distance= A(2); % Mode=A(3);
%% Configure IF6000 %launching the test fprintf(ser,':DME:MEAS:START') fprintf(ser,['DME:FREQ:VOR ' num2str(VOR_freq)]) fprintf(ser,['DME:RANG ' num2str(Distance)]) pause(3) %% clear Objects fclose(ser) clear obj end
Thanks you for your answers
Compiled programs will need to load the MCR library. I called Mathworks technical support and asked about this already. Apparently there is no way to "pre-load" this library (say, on computer boot up) to speed up launching of your program.