0
votes

I'm using Matlab and need to get an ASAP2 (a2l) file exported from a Simulink model, using the Real-Time Workshop toolkit, from the command-line so it can be run as part of a batch operation.

I know that the process is possible by following the standard procedure for generating an ASAP2 file from a model, via the GUI, but this is no use to me in this instance as it requires user interaction with the GUI.

I've scoured Google and the Mathworks forums for an answer to this one but have come back with nothing; so does anyone know the command to generate an a2l file from the Windows CLI?

Thanks for any help you can offer.

1
Real-Time Workshop is a MathWorks product, you paid for it, so you can get support directly from MathWorks.Mikhail
Good point Mikhail! I'm so used to trawling the internet for an answer these days I didn't consider that...MattMatt

1 Answers

2
votes

Is the a2l file being generated when you press Build or Generate Code on the GUI? If so, the command-line equivalent is

rtwbuild(model);

Re-reading your question, I think you might be asking how to generate the file from a Windows command prompt. You can startup MATLAB and have it run any command using the -r option,

% matlab -r "load_system('model'); rtwbuild('model'); quit;"

Or you can write a a script to do all this, and call that script.