Question about using certain RTW blocks

cancel
Showing results for 
Search instead for 
Did you mean: 

Question about using certain RTW blocks

Jump to solution
256 Views
Contributor III

Hello again,

just a quick question if there is a problem on my end or with the toolbox or rather Simulink.

I'm trying to use a Simulink Real-Time block called ASCII Encoder to transmit register values over UART to a PC.

The thing is: the build stops with errors and I don't know what to do from here. I tried to include some additional paths manually but to no avail. So any help is much appreciated.

I added a picture of the easiest subroutine and also another one of the failed build log. (Btw it does not work even with a constant value instead of a MemRead, so that is not the problem.)

SimulinkUART.png

SimulinkBuildLog.png

Thank you.

Kind regards,

Markus R.

0 Kudos
1 Solution
30 Views
NXP Employee
NXP Employee

Hi markusransberger‌,

I do not have a license for the Simulink® Real-Time™ toolbox, but i presume, based on the error you got that there is something related with the XPC drivers. Can you build a simple model with ASCII encode block if the NXP's toolbox is not used ? Perhaps you need to configure that toolbox and/or add some drivers for it.

Nonetheless, i think you can avoid that ASCII encode by a simple state-flow chart to do the conversion.

Hope this helps!

Daniel

View solution in original post

0 Kudos
6 Replies
31 Views
NXP Employee
NXP Employee

Hi markusransberger‌,

I do not have a license for the Simulink® Real-Time™ toolbox, but i presume, based on the error you got that there is something related with the XPC drivers. Can you build a simple model with ASCII encode block if the NXP's toolbox is not used ? Perhaps you need to configure that toolbox and/or add some drivers for it.

Nonetheless, i think you can avoid that ASCII encode by a simple state-flow chart to do the conversion.

Hope this helps!

Daniel

View solution in original post

0 Kudos
30 Views
Contributor III

Hi again,

just letting you know that the problem is on my end. Your suggestion to build a fresh model was the right idea. (I always ran it instead of building, my bad, and this worked as expected.)

The XPC Target "toolbox" license which is actually integrated in Real-Time Workshop nowadays is still somehow separated from the RTW license, where I'm working at. I really don't know why, but I ordered the license today. Thanks for helping me again.

Kind regards,

Markus R.

0 Kudos
30 Views
Contributor IV

It's more likely that you just didn't install the xpc toolboxes, even if you have licenses for them. 

The ASCII blocks look like they're in xpcseriallib. The cheap route would be to just make your own ASCII library to encode and decode messages.

0 Kudos
30 Views
Contributor III

The thing is: the "missing" .c file actually exists in the Real Time Workshop directory and I got the license for that toolbox (and now the additional XPC toolbox license). I even tried it with a student version at home which got the whole package (at least it should have) and the same thing is happening. So I'd guess that's probably an error on Mathworks' behalf.

For now I won't use this block, so I implemented an inefficient sprintf function I found on stackoverflow and that's good enough right now. (Dynamic memory allocation and Matlab don't like each other very much I found out.)

0 Kudos
30 Views
Contributor IV

Unless you need human readable text sent it may be easier to ASCII printing on the computer.

You should be able to make a short Python or Matlab script to read a byte at a time and then print it.

0 Kudos
30 Views
NXP Employee
NXP Employee

The thing is: the "missing" .c file actually exists in the Real Time Workshop directory and I got the license for that toolbox (and now the additional XPC toolbox license). I even tried it with a student version at home which got the whole package (at least it should have) and the same thing is happening. So I'd guess that's probably an error on Mathworks' behalf.

You can use this trick to copy any file into the generated folder prior of building the project. It should fix the issue.

0 Kudos