Can PLC Coder generate ST from "MATLAB Function"-Block that uses Classes?

1 visualización (últimos 30 días)
Clemens Betzold
Clemens Betzold el 28 de Jun. de 2017
Editada: Sri Kapali el 22 de Feb. de 2021
Hello everybody,
i am trying to generate structured text from a "MATLAB Function"-Block using PLC Coder.
Within the "MATLAB Function"-Block, i create an instance of a very simple MATLAB Class:
function y = fcn(u)
%#codegen
test = PLCtest();
y = test.a + u;
The used class "PLCtest" is defined as follows:
classdef PLCtest
properties
a = 5;
end
methods
end
end
When i try to generate ST from the "MATLAB Function"-Block with PLC Coder, i get the error:
Is there a way to include Classes for PLC code generation? I have MATLAB 2016a and Simulink PLC Coder 2.1.

Respuestas (1)

Sri Kapali
Sri Kapali el 22 de Feb. de 2021
Editada: Sri Kapali el 22 de Feb. de 2021
Hello,
My understanding is that you would like to generate code for MATLAB class definitions using Simulink PLC Coder. Simulink PLC Coder currently does not support MATLAB classes for code generation. You could try converting you class definition to a Simulink.Parameter or Simulink.Enum type object to generate structured text code for the same.

Categorías

Más información sobre Simulink PLC Coder en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by