How to read Simulink signals with FreeMASTER ?

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

How to read Simulink signals with FreeMASTER ?

2,444 Views
lethuer
Contributor V

After building this model in FreeMASTER the variable "Poti ADC Wert" is in the variable list.

But the variable "Poti ADC Wert umgerechnet" isn't.

Obviously the gain block changes something...

How can I diplay the variable after the gain ?

Poti mit Umrechnung.PNG

7 Replies

509 Views
kadanik
Contributor II

Hello,
how does it work with the latest Matlab version (R2023a)?

I guess the interface for a signal property has changed.

Could you please summarize all options we have for seeing any model signal in FreeMaster (for R2023a version)?

Thanks

Petr

1,383 Views
swmurray
Contributor II

I have the same issue, but can't see an option to define the storage class in the data store block parameter:

swmurray_0-1650988651134.png

I am using R2021b, so suppose this may be different... Is there another way to prevent the code generation from optimising away all my data stores? - it's very frustrating.

 

Thanks,

Sean.

0 Kudos

1,994 Views
dumitru-daniel_
NXP Employee
NXP Employee

Hi lethuer‌,

Matlab code generation will optimize out some of the signal.

You can force a signal to be kept in the final elf by using a few tricks like:

- connect the signal to a Data Store & Data Memory Write  Blocks and then display it in FreeMASTER;

pastedImage_2.png

-  use a generic Out Block to connect the signal instead of Terminator;

pastedImage_3.png

Hope this helps!

Daniel

0 Kudos

1,994 Views
lethuer
Contributor V

Hi dumitru-daniel.popa‌,

now I've created this model:

ADC mit FreeMASTER - Trick.png

In FreeMASTER the variable "Poti ADC Wert" is still visible.

But I can still not see the signals "Variante A - Poti ADC Wert umgerechnet" and "Variante B - Poti ADC Wert umgerechnet" in the variable list of FreeMASTER.

A variable <Modelname>.Out1 is now in the variable list and can be displayed.

A variable <Modelname>.Datastore or something like that I can not find. How the Data Store variable will be called ?

0 Kudos

1,994 Views
dumitru-daniel_
NXP Employee
NXP Employee

Hi lethuer‌,

Sorry for delayed answer - i had issues with log in.

Can you send me your Simulink model, generated code and FreeMASTER project ?

I want to check the issue with your original files.

Thank you!

Daniel

0 Kudos

1,994 Views
lethuer
Contributor V

Hi dumitru-daniel.popa‌,

sorry for delayed answer.

Here you have the model, the generated code and the FreeMASTER Project as an Attachement.

0 Kudos

1,994 Views
dumitru-daniel_
NXP Employee
NXP Employee

Hi lethuer‌,

It looks like the Simulink is optimizing out that variable.

You can keep that that variable by forcing the Simulink to consider it as a volatile variable. Open the Data Store Memory block properties and select the appropriate storage class. 

pastedImage_1.png

Recompile the application and you should see the variable now in the *.map file and also available in the FreeMASTER

CLOCK_SYS_GetGateCmd 0x00001273 0xc Code Gb fsl_clock_manager.o [1]
CLOCK_SYS_GetSystemClock
0x00001205 0x5a Code Gb fsl_clock_manager.o [1]
CSTACK$$Base 0x1fffc818 -- Gb - Linker created -
CSTACK$$Limit 0x1fffcc18 -- Gb - Linker created -
Datenspeicher_A 0x1fffc054 0x2 Data Gb NXP_Poti_mit_ADC_und_FreeMASTER_20171005.o [1]
FMSTR_AddressFromBuffer
0x00000717 0xe Code Gb freemaster_Kxx.o [1]
FMSTR_AddressToBuffer 0x00000701 0xe Code Gb freemaster_Kxx.o [1]

pastedImage_7.png

pastedImage_8.png

Hope this helps!

Daniel