从 MATLAB 命令 Maxon Motors EPOS2 电机控制器
Commanding Maxon Motors EPOS2 Motor Controller from MATLAB
我想与EPOS2 Maxon Driver
交流。这是我在 File Exchange 上找到的方法。
- 下载 the link 并在存在
Make.m
的 \Version2
中创建 Epos2Windows
作为空文件夹。
- 将 MinGW-w64 添加到
Matlab
。
- 安装 EPOS2 USB driver .
- 下载EPOS-Windows-DLL-En.
- 将
Definitions.h
、EposCmd.lib
、EposCmd64.lib
、vxlapi.dll
、vxlapi64.dll
从 \EPOS-Windows-DLL-En\Microsoft Visual C++\Definition Files
复制到 Epos2Windows
文件夹。
最后,当我使用 Make
命令时,出现了很多以 Error using mex and ...
开头的错误
我开始找出问题所在。所以我 运行 Make.m
一行一行地写代码。我在 eval( char(strcmd) )
中发现了问题。现在我不知道如何处理它。
如有任何帮助,我们将不胜感激。
Win10、MATLAB R2017b
下面是我在 Win10_LTSC, Matlab_2019a
中解决问题的方法:
为 Matlab
的 Mex
安装 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的真实值然后运行代码。
我想与EPOS2 Maxon Driver
交流。这是我在 File Exchange 上找到的方法。
- 下载 the link 并在存在
Make.m
的\Version2
中创建Epos2Windows
作为空文件夹。 - 将 MinGW-w64 添加到
Matlab
。 - 安装 EPOS2 USB driver .
- 下载EPOS-Windows-DLL-En.
- 将
Definitions.h
、EposCmd.lib
、EposCmd64.lib
、vxlapi.dll
、vxlapi64.dll
从\EPOS-Windows-DLL-En\Microsoft Visual C++\Definition Files
复制到Epos2Windows
文件夹。
最后,当我使用 Make
命令时,出现了很多以 Error using mex and ...
我开始找出问题所在。所以我 运行 Make.m
一行一行地写代码。我在 eval( char(strcmd) )
中发现了问题。现在我不知道如何处理它。
如有任何帮助,我们将不胜感激。
Win10、MATLAB R2017b
下面是我在 Win10_LTSC, Matlab_2019a
中解决问题的方法:
为 Matlab
的 Mex
安装 MinGW64 Compiler with Windows 10 SDK or later (C++)
。
文件中有一些命令需要cpp compiler
编译。 mex
将其编译器更改为文件类型,因此将
.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的真实值然后运行代码。