Question about using certain RTW blocks

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Question about using certain RTW blocks

跳至解决方案
1,221 次查看
markusransberge
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 项奖励
1 解答
995 次查看
dumitru-daniel_
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

在原帖中查看解决方案

0 项奖励
6 回复数
996 次查看
dumitru-daniel_
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

0 项奖励
995 次查看
markusransberge
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 项奖励
995 次查看
jfrey
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 项奖励
995 次查看
markusransberge
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 项奖励
995 次查看
jfrey
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 项奖励
995 次查看
dumitru-daniel_
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 项奖励