필터 지우기
필터 지우기

C2000 Simulink using TI DCL library functions

조회 수: 20 (최근 30일)
Maximilian Weigelt
Maximilian Weigelt 2023년 1월 27일
답변: Rishav 2023년 4월 6일
Hello, how to use Digital Control Library in Simulink for C2000 F28388D microcontroller? In particular, I would like to use the PID controller and the Refgen functions. The functions require pointer variables and structs as arguments. I tried so far to integrate the functions with the coder.opaque/coder.ceval command and with the C-function caller block. But there were always errors that the variable rgen does not exist.
  댓글 수: 1
Mark McBroom
Mark McBroom 2023년 2월 5일
It should be possible to call a function in the DCL library using either approach you mentioned. You will need to provide the ML Function code or C Caller block settings are are using.

댓글을 달려면 로그인하십시오.

답변 (1개)

Rishav
Rishav 2023년 4월 6일
To use the Refgen block, you can define the struct "rgen" in MATLAB workspace and use the "From Workspace" block to pass the struct to the Refgen block. To define the struct "rgen", you can use the following code:
rgen = struct('Type', 'Sinusoidal', 'Amplitude', 1, 'Frequency', 0.1);
Then, you can use the "From Workspace" block to pass the struct to the Refgen block.
Similarly, you can use the "From Workspace" block to pass pointer variables to the PID controller block.

카테고리

Help CenterFile Exchange에서 Simulink Functions에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by