精品国产人成在线_亚洲高清无码在线观看_国产在线视频国产永久2021_国产AV综合第一页一个的一区免费影院黑人_最近中文字幕MV高清在线视频

0
  • 聊天消息
  • 系統消息
  • 評論與回復
登錄后你可以
  • 下載海量資料
  • 學習在線課程
  • 觀看技術視頻
  • 寫文章/發帖/加入社區
會員中心
創作中心

完善資料讓更多小伙伴認識你,還能領取20積分哦,立即完善>

3天內不再提示

米爾基于瑞薩RZ/G2L開發板在工控領域的應用-基于SOEM的EtherCAT主站

米爾MYIR ? 2023-08-24 18:57 ? 次閱讀

本篇測評由優秀測評者“qinyunti”提供。


前言

本文介紹【米爾MYD-YG2LX開發板】在工控領域的應用,實現基于SOEM的EtherCAT主站。開發環境基于WSL2。

下載代碼

git clone

?https://github.com/OpenEtherCATsociety/SOEM?

PC端

編譯

cd SOEM/

export CC=gcc

mkdir build_pc

cd build_pc/

cmake ..

lhj@lhj:~/SOEM/build_pc$ cmake ..
-- The C compiler identification is GNU 9.4.0
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- OS is linux
-- LIB_DIR: lib
-- Configuring done
-- Generating done
-- Build files have been written to: /home/lhj/SOEM/build_pc
lhj@lhj:~/SOEM/build_pc$

make

lhj@lhj:~/SOEM/build_pc$ make
Scanning dependencies of target soem
[4%] Building C object CMakeFiles/soem.dir/soem/ethercatbase.c.o
[9%] Building C object CMakeFiles/soem.dir/soem/ethercatcoe.c.o
[ 14%] Building C object CMakeFiles/soem.dir/soem/ethercatconfig.c.o
[ 19%] Building C object CMakeFiles/soem.dir/soem/ethercatdc.c.o
[ 23%] Building C object CMakeFiles/soem.dir/soem/ethercateoe.c.o
[ 28%] Building C object CMakeFiles/soem.dir/soem/ethercatfoe.c.o
[ 33%] Building C object CMakeFiles/soem.dir/soem/ethercatmain.c.o
[ 38%] Building C object CMakeFiles/soem.dir/soem/ethercatprint.c.o
[ 42%] Building C object CMakeFiles/soem.dir/soem/ethercatsoe.c.o
[ 47%] Building C object CMakeFiles/soem.dir/osal/linux/osal.c.o
[ 52%] Building C object CMakeFiles/soem.dir/oshw/linux/nicdrv.c.o
[ 57%] Building C object CMakeFiles/soem.dir/oshw/linux/oshw.c.o
[ 61%] Linking C static library libsoem.a
[ 61%] Built target soem
Scanning dependencies of target simple_ng
[ 66%] Building C object test/simple_ng/CMakeFiles/simple_ng.dir/simple_ng.c.o
[ 71%] Linking C executable simple_ng
[ 71%] Built target simple_ng
Scanning dependencies of target slaveinfo
[ 76%] Building C object test/linux/slaveinfo/CMakeFiles/slaveinfo.dir/slaveinfo.c.o
[ 80%] Linking C executable slaveinfo
[ 80%] Built target slaveinfo
Scanning dependencies of target eepromtool
[ 85%] Building C object test/linux/eepromtool/CMakeFiles/eepromtool.dir/eepromtool.c.o
[ 90%] Linking C executable eepromtool
[ 90%] Built target eepromtool
Scanning dependencies of target simple_test
[ 95%] Building C object test/linux/simple_test/CMakeFiles/simple_test.dir/simple_test.c.o
[100%] Linking C executable simple_test
[100%] Built target simple_test
lhj@lhj:~/SOEM/build_pc$

部署

生成的文件如下

其中libsoem.a為庫文件

test/linux/下的

simple_test,slaveinfo,eepromtool為測試Demo。

lhj@lhj:~/SOEM/build_pc$ tree .
.
|-- CMakeCache.txt
|-- CMakeFiles
|  |-- 3.16.3
|  |  |-- CMakeCCompiler.cmake
|  |  |-- CMakeDetermineCompilerABI_C.bin
|  |  |-- CMakeSystem.cmake
|  |  `-- CompilerIdC
|  |     |-- CMakeCCompilerId.c
|  |     |-- a.out
|  |     `-- tmp
|  |-- CMakeDirectoryInformation.cmake
|  |-- CMakeOutput.log
|  |-- CMakeTmp
|  |-- Export
|  |  `-- share
|  |     `-- soem
|  |      `-- cmake
|  |          |-- soemConfig-noconfig.cmake
|  |          `-- soemConfig.cmake
|  |-- Makefile.cmake
|  |-- Makefile2
|  |-- TargetDirectories.txt
|  |-- cmake.check_cache
|  |-- progress.marks
|  `-- soem.dir
|     |-- C.includecache
|     |-- DependInfo.cmake
|     |-- build.make
|     |-- cmake_clean.cmake
|     |-- cmake_clean_target.cmake
|     |-- depend.internal
|     |-- depend.make
|     |-- flags.make
|     |-- link.txt
|     |-- osal
|     |  `-- linux
|     |     `-- osal.c.o
|     |-- oshw
|     |  `-- linux
|     |     |-- nicdrv.c.o
|     |     `-- oshw.c.o
|     |-- progress.make
|     `-- soem
|      |-- ethercatbase.c.o
|      |-- ethercatcoe.c.o
|      |-- ethercatconfig.c.o
|      |-- ethercatdc.c.o
|      |-- ethercateoe.c.o
|      |-- ethercatfoe.c.o
|      |-- ethercatmain.c.o
|      |-- ethercatprint.c.o
|      `-- ethercatsoe.c.o
|-- Makefile
|-- cmake_install.cmake
|-- libsoem.a
`-- test
|-- linux
|  |-- eepromtool
|  |  |-- CMakeFiles
|  |  |  |-- CMakeDirectoryInformation.cmake
|  |  |  |-- eepromtool.dir
|  |  |  |  |-- C.includecache
|  |  |  |  |-- DependInfo.cmake
|  |  |  |  |-- build.make
|  |  |  |  |-- cmake_clean.cmake
|  |  |  |  |-- depend.internal
|  |  |  |  |-- depend.make
|  |  |  |  |-- eepromtool.c.o
|  |  |  |  |-- flags.make
|  |  |  |  |-- link.txt
|  |  |  |  `-- progress.make
|  |  |  `-- progress.marks
|  |  |-- Makefile
|  |  |-- cmake_install.cmake
|  |  `-- eepromtool
|  |-- simple_test
|  |  |-- CMakeFiles
|  |  |  |-- CMakeDirectoryInformation.cmake
|  |  |  |-- progress.marks
|  |  |  `-- simple_test.dir
|  |  |     |-- C.includecache
|  |  |     |-- DependInfo.cmake
|  |  |     |-- build.make
|  |  |     |-- cmake_clean.cmake
|  |  |     |-- depend.internal
|  |  |     |-- depend.make
|  |  |     |-- flags.make
|  |  |     |-- link.txt
|  |  |     |-- progress.make
|  |  |     `-- simple_test.c.o
|  |  |-- Makefile
|  |  |-- cmake_install.cmake
|  |  `-- simple_test
|  `-- slaveinfo
|     |-- CMakeFiles
|     |  |-- CMakeDirectoryInformation.cmake
|     |  |-- progress.marks
|     |  `-- slaveinfo.dir
|     |     |-- C.includecache
|     |     |-- DependInfo.cmake
|     |     |-- build.make
|     |     |-- cmake_clean.cmake
|     |     |-- depend.internal
|     |     |-- depend.make
|     |     |-- flags.make
|     |     |-- link.txt
|     |     |-- progress.make
|     |     `-- slaveinfo.c.o
|     |-- Makefile
|     |-- cmake_install.cmake
|     `-- slaveinfo
`-- simple_ng
|-- CMakeFiles
|  |-- CMakeDirectoryInformation.cmake
|  |-- progress.marks
|  `-- simple_ng.dir
|     |-- C.includecache
|     |-- DependInfo.cmake
|     |-- build.make
|     |-- cmake_clean.cmake
|     |-- depend.internal
|     |-- depend.make
|     |-- flags.make
|     |-- link.txt
|     |-- progress.make
|     `-- simple_ng.c.o
|-- Makefile
|-- cmake_install.cmake
`-- simple_ng
29 directories, 100 files
lhj@lhj:~/SOEM/build_pc$

開發板端

編譯

cd SOEM/

export CC=aarch64-linux-gnu-gcc

mkdir build

cd build/

cmake ..

lhj@lhj:~/SOEM/build$ cmake ..
-- The C compiler identification is GNU 9.4.0
-- Check for working C compiler: /usr/bin/aarch64-linux-gnu-gcc
-- Check for working C compiler: /usr/bin/aarch64-linux-gnu-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- OS is linux
-- LIB_DIR: lib
-- Configuring done
-- Generating done
-- Build files have been written to: /home/lhj/SOEM/build
lhj@lhj:~/SOEM/build$

make

lhj@lhj:~/SOEM/build$ make
Scanning dependencies of target soem
[4%] Building C object CMakeFiles/soem.dir/soem/ethercatbase.c.o
[9%] Building C object CMakeFiles/soem.dir/soem/ethercatcoe.c.o
[ 14%] Building C object CMakeFiles/soem.dir/soem/ethercatconfig.c.o
[ 19%] Building C object CMakeFiles/soem.dir/soem/ethercatdc.c.o
[ 23%] Building C object CMakeFiles/soem.dir/soem/ethercateoe.c.o
[ 28%] Building C object CMakeFiles/soem.dir/soem/ethercatfoe.c.o
[ 33%] Building C object CMakeFiles/soem.dir/soem/ethercatmain.c.o
[ 38%] Building C object CMakeFiles/soem.dir/soem/ethercatprint.c.o
[ 42%] Building C object CMakeFiles/soem.dir/soem/ethercatsoe.c.o
[ 47%] Building C object CMakeFiles/soem.dir/osal/linux/osal.c.o
[ 52%] Building C object CMakeFiles/soem.dir/oshw/linux/nicdrv.c.o
[ 57%] Building C object CMakeFiles/soem.dir/oshw/linux/oshw.c.o
[ 61%] Linking C static library libsoem.a
[ 61%] Built target soem
Scanning dependencies of target simple_ng
[ 66%] Building C object test/simple_ng/CMakeFiles/simple_ng.dir/simple_ng.c.o
[ 71%] Linking C executable simple_ng
[ 71%] Built target simple_ng
Scanning dependencies of target slaveinfo
[ 76%] Building C object test/linux/slaveinfo/CMakeFiles/slaveinfo.dir/slaveinfo.c.o
[ 80%] Linking C executable slaveinfo
[ 80%] Built target slaveinfo
Scanning dependencies of target eepromtool
[ 85%] Building C object test/linux/eepromtool/CMakeFiles/eepromtool.dir/eepromtool.c.o
[ 90%] Linking C executable eepromtool
[ 90%] Built target eepromtool
Scanning dependencies of target simple_test
[ 95%] Building C object test/linux/simple_test/CMakeFiles/simple_test.dir/simple_test.c.o
[100%] Linking C executable simple_test
[100%] Built target simple_test
lhj@lhj:~/SOEM/build$

部署

cp libsoem.a /mnt/d

cp test/linux/simple_test/simple_test /mnt/d

cp test/linux/slaveinfo/slaveinfo/mnt/d

將上述文件rz導入開發板

chmod +x simple_test slaveinfo

運行

root@myir-yg2lx:~# ./slaveinfo eth0
SOEM (Simple Open EtherCAT Master)
Slaveinfo
Starting slaveinfo
ec_init on eth0 succeeded.
No slaves found!
End slaveinfo, close socket
End program
root@myir-yg2lx:~# ./simple_test eth0
SOEM (Simple Open EtherCAT Master)
Simple test
Starting simple test
ec_init on eth0 succeeded.
No slaves found!
End simple test, close socket
End program
root@myir-yg2lx:~#

總結

本開發板接口資源豐富,性能強,特別適合工控領域的應用,比如作為EtherCAT主站。由于沒有從站,所以暫時未能演示和從站通訊的功能。

聲明:本文內容及配圖由入駐作者撰寫或者入駐合作網站授權轉載。文章觀點僅代表作者本人,不代表電子發燒友網立場。文章及其配圖僅供工程師學習之用,如有內容侵權或者其他違規問題,請聯系本站處理。 舉報投訴
  • 嵌入式
    +關注

    關注

    5072

    文章

    19026

    瀏覽量

    303518
  • 瑞薩
    +關注

    關注

    35

    文章

    22294

    瀏覽量

    86098
  • 開發板
    +關注

    關注

    25

    文章

    4959

    瀏覽量

    97214
  • ethercat
    +關注

    關注

    18

    文章

    657

    瀏覽量

    38611
  • 核心板
    +關注

    關注

    5

    文章

    992

    瀏覽量

    29718
  • soem
    +關注

    關注

    0

    文章

    3

    瀏覽量

    15
收藏 人收藏

    評論

    相關推薦

    基于電子RZ/G2L的FET-G2LD-C核心和OK-G2LD-C開發板評測

    基于電子RZ/G2L處理器開發的FET-G2LD-C核心
    發表于 05-30 17:24 ?1158次閱讀
    基于<b class='flag-5'>瑞</b><b class='flag-5'>薩</b>電子<b class='flag-5'>RZ</b>/<b class='flag-5'>G2L</b>的FET-<b class='flag-5'>G2</b>LD-C核心<b class='flag-5'>板</b>和OK-<b class='flag-5'>G2</b>LD-C<b class='flag-5'>開發板</b>評測

    米爾-RZ/G2UL開發板】6.基于SOEMEtherCat

    使用標準的以太網控制器,具有良好的兼容性,任何具有網絡接口卡的計算機和具有以太網控制的嵌入式設備都可以作為EtherCAT。對于PC計算機而言,
    發表于 03-31 16:22

    米爾RZ/G2L開發板-試用體驗】開箱

    感謝 感謝電子發燒友論壇、感謝米爾電子,把米爾RZ/G2L
    發表于 05-14 19:41

    米爾RZ/G2L開發板-試用體驗】開箱 + 開機

    感謝 感謝電子發燒友論壇、感謝米爾電子,把米爾RZ/G2L
    發表于 05-18 19:33

    米爾RZ/G2L開發板-試用體驗】LCD 顯示測試

    實驗器材 1、米爾RZ/G2L開發板 2、MY-
    發表于 05-22 19:26

    米爾RZ/G2L開發板-試用體驗】米爾-RZG2L - 64位雙核MPU開發板開箱測評

    剛收到米爾RZ/G2L開發板打開包裝后看到的很大的一塊黑色PCB,做工精美的
    發表于 05-22 21:53

    米爾RZ/G2L開發板-試用體驗】米爾RZ/G2L開發板開箱視頻

    今天剛剛收到米爾RZ/G2L開發板,拆開包裹后給人的感覺是驚艷,板卡設計真的很棒,來看看視頻
    發表于 05-22 21:58

    150套開發板免費送!還有5G手機拿?米爾RZ/G2L開發板創意秀

    /12 05 送的是哪款開發板米爾MYD-YG2LX開發板,該款產品采用
    發表于 05-24 16:36

    米爾RZ/G2L開發板-試用體驗】米爾RZ/G2L開發板使用SSH登錄

    收到的米爾RZ/G2L開發板上電測試一下SSH登錄方式和其它測試! SSH登錄
    發表于 06-11 21:47

    米爾RZ/G2L開發板-試用體驗】認識一下米爾RZ/G2L開發板的核心

    解一下米爾RZ/G2L開發板的核心: MYC-
    發表于 07-29 00:21

    米爾RZ/G2L開發板-初體驗

    介紹米爾RZ/G2L開發板
    的頭像 發表于 05-15 09:10 ?978次閱讀
    <b class='flag-5'>米爾</b><b class='flag-5'>瑞</b><b class='flag-5'>薩</b><b class='flag-5'>RZ</b>/<b class='flag-5'>G2L</b><b class='flag-5'>開發板</b>-初體驗

    米爾RZ/G2L開發板 TF卡讀寫速度測試

    米爾RZ/G2L開發板TF卡讀寫測試
    的頭像 發表于 05-22 09:07 ?1375次閱讀
    <b class='flag-5'>米爾</b><b class='flag-5'>瑞</b><b class='flag-5'>薩</b><b class='flag-5'>RZ</b>/<b class='flag-5'>G2L</b><b class='flag-5'>開發板</b> TF卡讀寫速度測試

    米爾RZ/G2L開發板 安裝交叉編譯器

    米爾RZ/G2L開發板安裝交叉編譯器
    的頭像 發表于 05-26 22:05 ?2066次閱讀
    <b class='flag-5'>米爾</b><b class='flag-5'>瑞</b><b class='flag-5'>薩</b><b class='flag-5'>RZ</b>/<b class='flag-5'>G2L</b><b class='flag-5'>開發板</b> 安裝交叉編譯器

    米爾RZ/G2L開發板-試用體驗】創建TCP服務器

    米爾RZ/G2L開發板上用C 創建TCP服務器
    的頭像 發表于 05-27 08:59 ?7785次閱讀
    【<b class='flag-5'>米爾</b><b class='flag-5'>瑞</b><b class='flag-5'>薩</b><b class='flag-5'>RZ</b>/<b class='flag-5'>G2L</b><b class='flag-5'>開發板</b>-試用體驗】創建TCP服務器

    RZ/G2L開發板工控領域的應用-基于SOEMEtherCAT

    本篇測評由優秀測評者“qinyunti”提供。前言本文介紹【米爾MYD-YG2LX開發板工控領域
    的頭像 發表于 07-31 22:09 ?613次閱讀
    <b class='flag-5'>瑞</b><b class='flag-5'>薩</b><b class='flag-5'>RZ</b>/<b class='flag-5'>G2L</b><b class='flag-5'>開發板</b><b class='flag-5'>在</b><b class='flag-5'>工控</b><b class='flag-5'>領域</b>的應用-基于<b class='flag-5'>SOEM</b>的<b class='flag-5'>EtherCAT</b><b class='flag-5'>主</b><b class='flag-5'>站</b>