1、LINUXCNC源程序原理说明opLINUXCNC源程序学习源程序的树结构如下:Overview of the emc2 directory (generated by tree -I .git -d) :。 appdefaults bin (user mode binaries)- configs |- 5axis - boss common - dallurthc| - demo_mazak (sample mazak config files) - demo_sim_cl (sample sim with ladder IO) |- demo_step_cl (sample steppe
2、r with ladder IO)| |- etch-servo |- halui_halvcp - hexapodsim| |- lathepluto |- m5i20 (sample servo using Mesa PCI)| |- max| |- motenc (sample servo using Vital PCI)| - nistlathe| | plasmathc - plasma-thcsim| - ppmc puma - scara| - sim (simulated motion and IO)| | stepper (parport stepper driver) |-
3、 stepper-gantry | stepper-xyza| |- stg (sample servo using STG ISA)| - univpwm (sample PICO servo generator)| - univstep (sample PICO stepper generator) vti debian (files needed to build deb packages)| extrasUbuntu-5.10 (extra files for Ubuntu 5.10)| etc |- modprobe.d - udev | | | |- rules。d | - scr
4、ipts| | | xdg| | - menus| applicationsmerged | - usr| | - share| |- applications - desktopdirectories | - pixmaps| - extrasUbuntu6。06 (extra files for building on Ubuntu 6。06 Dapper Drake)| |- etc | | | modprobe。d| | | udev | | rules。d | - scripts - xdg | - menus applicationsmerged | - usr - share |
5、 - applications| desktop-directories - pixmaps |- extrasUbuntu7。10 (extra files for building on Ubuntu 7。10) | | etc | | - modprobe.d| | | - udev | | rules.d | - xdg | - menus| | | - applications-merged - usr | - share| - applications | desktopdirectories| - pixmaps extrasUbuntu8.04 (extra files for
6、 building on Ubuntu 8。04 Hardy Heron)| |- etc | |- modprobe.d| | xdg| - menus| applications-merged| | - usr| | share |- applications| | |- desktop-directories pixmaps| - extras-simUbuntu-5.10 (extra files for sim package for Ubuntu 5.10)| | | etc | - xdg | | - menus| | - applications-merged| | - usr
7、| - share| | - applications | |- desktopdirectories pixmaps| - extrassim-Ubuntu-6。06 (extra files for sim package for Ubuntu 6。06 Dapper Drake)| | etc | - xdg - menus | - applications-merged| - usr| - share |- applications - desktop-directories| - pixmaps- docs (All the important and relevant Docs.)
8、 |- help| |- html (html version of docs - some generated from lyx) - man (man pages) - man1| | |- man3| - man9| - src (API and source notes should be in each src dir.) (source for the handbooks) (top level .lyx files)| - code| common (shared .lyx files and images, such as glossary, GPLD license) |-
9、config| - gcode (.lyx files, images, etc。 for GCode documentation)| - gui (。lyx files, images, etc。 for GUI documentation)| - hal (.lyx files, images, etc. for HAL documentation)| install| - ladder - motion| - quickstart|- include (headers installed here originals in src/xxx/)- lib (user mode object
10、 files) - python | rs274 - yapps|- nc_files (Sample NC files)- rtlib (kernel mode object files, only after a successfull compile)|- scripts(bash scripts like linuxcnc, realtime, rip-environment, etc。)|- share |- axis| images | tcl |- emc - locale - de - LC_MESSAGES| - es| - LC_MESSAGES | fr - LC_MES
11、SAGES - hu| - LC_MESSAGES| |- it | LC_MESSAGES| |- pt_BR - LC_MESSAGES - ro| | LC_MESSAGES| |- ru| | - LC_MESSAGES| |- se| | - LC_MESSAGES |- sr| LC_MESSAGES - zh_CN - LC_MESSAGES|- src (source tree configure script, top level makefile, Makefile.inc, etc)| | |- depends (generated dependency tree)| |
12、 - emc (actual LinuxCNC code)| |- canterp (interpreter for canonical commands)| | |- ini (inifile related operations) - iotask (IO interface, lots of HAL pins)| | |- kinematics (trajectory planner and kinematics) - motion (motion controller, talks through SHM to the rest of EMC) | nml_intf (emc spec
13、ific NML implementation, all messages sent in emc)| | |- rs274ngc (the rs274 g-code interpreter) | sai| - task (core component in emc, dispatches actions to other parts)| | - usr_intf (interfaces for some GUIs, and other interfaces: AXIS, halui, stepconf) | axis| |- etc | | | extensions| scripts| -
14、stepconf| |- hal (the Hardware Abstraction Layer, provides a unified interface across all hardware)| | - classicladder| | | - projects_examples| - components | - drivers - m5i20 | - bit | hostmot5_src | | mesa-hostmot2 | |- doc | | - firmware | | - 5i20 | | | SOURCE | - 7i43 | |- CPLD| | | | | SOURC
15、E| | SOURCE| |- mesa7i43firmware| | | gpio| | | - source | hostmot2| | | - src| | | - source | |- mesa_5i2x| | | | - firmware| | |- pluto_servo_firmware| | pluto_step_firmware| | |- user_comps| | |- devices| - vcp| - utils - halgui | libnml (a clean implementation of RCSLIB) | - buffer | cms | | ini
16、file |- linklist | |- nml - os_intf| | - posemath | - rcs |- module_helper |- objects| - emc | - canterp | - ini | - iotask| | | - motion| |- nml_intf| | |- rs274ngc| | - sai| | - task | | usr_intf | axis | - extensions| | | hal| | - classicladder | - components | |- drivers | - user_comps| | | devi
17、ces | | | - vcp| | - utils | |- libnml |- buffer | - cms| | | inifile | | |- linklist| | | - nml| | |- os_intf| - posemath| | - rcs |- rtapi| |- rtemc| | |- kinematics| | - motion | - rthal| | - classicladder| | - components | | - utils| rtlibnml | | - posemath| - rtobjects - hal| | components - po
18、(Translation files for i18n support) - rtapi (*。c and .h for RTAPI) (unified RT API, wraps over RTLinux, RTAI and sim) - examples (testing examples for the RTAPI)| - extint| | fifo| semaphore | |- shmem| | - timer| - tests|- tcl (tkemc.tcl, mini.tcl the tcl GUIs) |- bin| scripts- tests - abs.0 | and
19、-or-notmux.0 |- basic ccomp | |- lathecomp | mill-g90g91g92 | |- millline-arc-entry | - millzchanges |- counterencoder.0 |- flipflop。0 |- interp - camnisley | - flowsnake |- limit3.0 - limit3。1 |- limit3。2 - modparam.0 | overrun - oword | - sub.0 - save.0 save。1 |- source。0 - stepgen。0 | stepgen.1 |
20、- stepgen。2 - threads。0 - timedelay.0Overview of the emc2 install dirs: / (file system root) |- etc/ | - init。d/ | | - realtime (realtime start/stop script) | - $(prefix) (default: /usr/local) | (all the following xxxxdir are configurable through autoconf | |- bin/ (known as bindir, files from EMC2/
21、bin) | - sbin/ (known as sbindir, ) | - etc/ (known as sysconfdir, config files and subdirs from configs/) | | |- lib/ (known as $libdir, lib files *。so from libs/) | - share/ | - emc/ | | | | |- docs/ | - (All the important and relevant Docs。) | | |- handbooks/ | | | (PDF versions of handbooks) | |
22、 nc_files/ | - (Sample NC files) |- $MAN_DIR/ (default: /usr/local/man) | | |- man1/ | | | | | | - man3/ | - $moduledir/ (based on where 。/configure finds the RTOS modules)根据这个结构树,我们可以清楚的知道每一个文件夹,每一个子文件的作用,包括了接口,硬件抽象层,实时内核等等部分。当然,在这里面我们需要深入研究的是linuxcnc-dev/src/emc文件夹中的各个文件,也是该数控系统的核心所在。我们再次列出linuxcn
23、cdev/src/emc中的子结构树:linuxcnc-dev/src/emc中的子结构树: emc (actual LinuxCNC code) | - canterp (interpreter for canonical commands)| | |- ini (inifile related operations)| - iotask (IO interface, lots of HAL pins)| - kinematics (trajectory planner and kinematics)| | |- motion (motion controller, talks throug
24、h SHM to the rest of EMC)| |- nml_intf (emc specific NML implementation, all messages sent in emc)| - rs274ngc (the rs274 g-code interpreter)| | |- sai| | |- task (core component in emc, dispatches actions to other parts) | usr_intf (interfaces for some GUIs, and other interfaces: AXIS, halui, stepc
25、onf)| |- axis |- etc | | extensions| - scripts| | - stepconf根据该结构树,我们一个一个的再一次进行分析:(1)canterp (interpreter for canonical commands,即规范命令的解释器)#include / strcpy()include / isspace()#include limits。hinclude include config.h”#include emc/nml_intf/interp_return。hh#include emc/nml_intf/canon。hh#include emc/
26、rs274ngc/interp_base.hh其中包括了语法解析,读取,执行等函数,对刀具信息、主轴转速、开始、停止等信息进行判断和执行工作.(2)ini (inifile related operations,初始化相关的文件)同样,列出该文件夹的结构树:| | ini (inifile related operations)| | - emcIniFile。cc/hh | iniaxis.cc/hh | | - inihal。cc/hh - initraj.cc/hh | |- initool.cc /hh (2.1) emcIniFile。cc/hh include math。h / M_PI。#incl
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1