从 MATLAB 命令 Maxon Motors EPOS2 电机控制器

Commanding Maxon Motors EPOS2 Motor Controller from MATLAB

我想与EPOS2 Maxon Driver交流。这是我在 File Exchange 上找到的方法。

最后,当我使用 Make 命令时,出现了很多以 Error using mex and ...

开头的错误

我开始找出问题所在。所以我 运行 Make.m 一行一行地写代码。我在 eval( char(strcmd) ) 中发现了问题。现在我不知道如何处理它。

如有任何帮助,我们将不胜感激。

Win10、MATLAB R2017b

下面是我在 Win10_LTSC, Matlab_2019a 中解决问题的方法: 为 MatlabMex 安装 MinGW64 Compiler with Windows 10 SDK or later (C++)。 文件中有一些命令需要cpp compiler编译。 mex 将其编译器更改为文件类型,因此将 and .

中类型为 .c 的所有 25 个文件更改为 .cpp

为了避免invalid conversion from 'void*' to 'real_T*的错误,将real_T *y = ssGetOutputPortSignal(S,0);[sfun_maxon.cpp中的第274行]更改为real_T *y = (real_T *)ssGetOutputPortSignal(S,0);

打开test_epos.m并设置NodeId的真实值然后运行代码。