LINUXCNC源程序原理说明Word下载.docx
《LINUXCNC源程序原理说明Word下载.docx》由会员分享,可在线阅读,更多相关《LINUXCNC源程序原理说明Word下载.docx(46页珍藏版)》请在冰豆网上搜索。
|--stepper-gantry
|--stepper-xyza
|--stg
(sampleservousingSTGISA)
|--univpwm
(samplePICOservogenerator)
|--univstep
(samplePICOsteppergenerator)
、--vti
debian
(filesneededtobuilddebpackages)
||--extras-Ubuntu-5.10(extrafilesforUbuntu5.10)
|||--etc
||||--modprobe.d
||||--udev
|||||--rules.d
||||、--scripts
III'
--xdg
|||、--menus
|||'
--applications-merged
||、--usr
||、--share
III--applications
III--desktop-directories
||、--pixmaps
II--extras-Ubuntu-6.06(extrafilesforbuildingonUbuntu6.06DapperDrake)
III--etc
IIII--modprobe.d
IIII--udev
IIIII--rules.d
|||、--menus
II、--usr
II、--share
II、--pixmaps
II--extras-Ubuntu-7.10(extrafilesforbuildingonUbuntu7.10)
I
I--etc
II--modprobe.d
II--udev
II'
--rules.d
I'
I、--menus
'
--usr
、--share
I--applications
I--desktop-directories
、--pixmaps
I--extras-Ubuntu-8.04(extrafilesforbuildingonUbuntu8.04HardyHeron)
III、--menus
||--extras-sim-Ubuntu-5.10(extrafilesforsimpackageforUbuntu5.10)
|'
--extras-sim-Ubuntu-6.06(extrafilesforsimpackageforUbuntu6.06DapperDrake)
II--etc
|I、--menus
--usr
I、--share
II--applications
II--desktop-directories
I、--pixmaps
I--docs(AlltheimportantandrelevantDocs.)
II--help
II--html(htmlversionofdocs-somegeneratedfromlyx)
II--man(manpages)
III--man1
III--man3
II、--man9
--src(APIandsourcenotesshouldbeineachsrcdir.)(sourceforthehandbooks)(toplevel」yxfiles)
II--code
II--common(shared.lyxfilesandimages,suchasglossary,GPLDlicense)
II--config
II--gcode(.lyxfiles,images,etc.forG-Codedocumentation)
II--gui(.lyxfiles,images,etc.forGUIdocumentation)
II--hal(.lyxfiles,images,etc.forHALdocumentation)
II--install
II--ladder
II--motion
--quickstart
I--include(headersinstalledhere-originalsinsrc/xxx/)
I--lib(usermodeobjectfiles)
I、--python
II--rs274
--yapps
|--nc_files(SampleNCfiles)
|--rtlib(kernelmodeobjectfiles,onlyafterasuccessfullcompile)
|--scripts(bashscriptslikelinuxcnc,realtime,rip-environment,etc.)|--share
|
|--axis
||--images
--tel
|--emc
--locale
|--de
--LC_MESSAGES
|--es
|--fr
|--hu
|--it
|--pt_BR
|--ro
|--ru
|--se
|--sr
--zh_CN
--LC_MESSAGES
|--src(sourcetree-configurescript,toplevelmakefile,Makefile.inc,etc)
|--depends(generateddependencytree)
|--emc(actualLinuxCNCcode)
||--canterp
||--ini
||--iotask
||--kinematics
||--motion
||--nml_intf
||--rs274ngc
||--sai
||--task
(interpreterforcanonicalcommands)
(inifilerelatedoperations)(IOinterface,lotsofHALpins)(trajectoryplannerandkinematics)
(motioncontroller,talksthroughSHMtotherestofEMC)
(emcspecificNMLimplementation,allmessagessentinemc)(thers274g-codeinterpreter)
(corecomponentinemc,dispatchesactionstootherparts)
||、--usr_intf
(interfacesforsomeGUIs,andotherinterfaces:
AXIS,halui,stepconf)
|||--axis
||||--etc
||--extensions
|、--scripts
--stepconf
||--hal
(theHardwareAbstractionLayer,providesaunifiedinterfaceacrossall
hardware)
|--classicladder
--projects_examples
|--components
|--drivers
||--bit
--hostmot5_src
|--mesa-hostmot2
|--doc
--firmware
|--5i20
--SOURCE
--7i43
|--CPLD
--SOURCE
|--mesa7i43-firmware
|--
|--gpio
--source
|--hostmot2
|、--src
--source
mesa_5i2x
|--pluto_servo_firmware
--pluto_step_firmware
|--user_comps
||--devices
|、--vcp
--utils
--halgui
|--libnml(acleanimplementationofRCSLIB)
|||--buffer
|||--cms
|||--inifile
|||--linklist
|||--nml
|||--os_intf
|||--posemath
--res
||--module_helper
II--objeets
III--eme
IIII--eanterp
IIII--ini
IIII--iotask
IIII--motion
IIII--nml_intf
IIII--rs274nge
IIII--sai
IIII--task
--usr_intf
|||、--axis
--extensions
III--hal
IIII--elassieladder
IIII--eomponents
IIII--drivers
IIII--user_eomps
IIIII--deviees
||||'
--vepIII'
--utils
III--libnml
IIII--buffer
IIII--ems
IIII--inifile
IIII--linklist
IIII--nml
IIII--os_intf
IIII--posemath
III--rtapi
III--rteme
IIII--kinematies
--motion
III--rthal
III--rtlibnml
--posemath
--rtobjeets
||'
--hal
--components
||--po(Translationfilesfori18nsupport)
||--rtapi(*.cand*.hforRTAPI)(unifiedRTAPI,wrapsoverRTLinux,RTAIandsim)
--examples(testingexamplesfortheRTAPI)
|||--extint
|||--fifo
|||--semaphore
|||--shmem
||、--timer
--tests
|--tcl(tkemc.tcl,mini.tcl-thetclGUI'
s)
||--bin
--tests
|--abs.0
|--and-or-not-mux.0
|--basic
|--ccomp
||--lathe-comp
||--mill-g90g91g92
||--mill-line-arc-entry
--mill-zchanges
|--counter-encoder.0
|--flipflop.0
|--interp
||--cam-nisley
--flowsnake
|--limit3.0
|--limit3.1
|--limit3.2
|--modparam.0
|--overrun
|--oword
--sub.O
|--save.0
|--save.1
|--source.0
|--stepgen.0
|--stepgen.1
|--stepgen.2
|--threads.0
--timedelay.0
Overviewoftheemc2installdirs:
/(filesystemroot)
|---etc/
||
|\---init.d/
|\---realtime(realtimestart/stopscript)
|---$(prefix)(default:
/usr/local)
||(allthefollowing$xxxxdirareconfigurablethroughautoconf
||---bin/(knownas$bindir,filesfromEMC2/bin)
||---sbin/(knownas$sbindir,)
||---etc/(knownas$sysconfdir,configfilesandsubdirsfromconfigs/)
||---lib/(knownas$libdir,libfiles*.sofromlibs/)
|\---share/
|\---emc/
||---docs/
|||
||\---(AlltheimportantandrelevantDocs.)
||---handbooks/
|\---(PDFversionsofhandbooks)\---nc_files/
\---(SampleNCfiles)
|---$MAN_DIR/(default:
/usr/local/man)
||---man1/
|\---man3/
|--canterp
|--ini
|--iotask
|--kinematics
|--motion
|--nml_intf
|--rs274ngc
|--sai
|--task
--usr_intf
(interpreterforcanonicalcommands)(inifilerelatedoperations)(IOinterface,lotsofHALpins)(trajectoryplannerandkinematics)
(motioncontroller,talksthroughSHMtotherestofEMC)(emcspecificNMLimplementation,allmessagessentinemc)(thers274g-codeinterpreter)
(corecomponentinemc,dispatchesactionstootherparts)(interfacesforsomeGUIs,andotherinterfaces:
|--etc
|--extensions
--scripts
\---$moduledir/(basedonwhere./configurefindstheRTOSmodules)根据这个结构树,我们可以清楚的知道每一个文件夹,每一个子文件的作用,包括了接口,硬件抽象层,实时内核等等部分。
当然,在这里面我们需要深入研究的是linuxcnc-dev/src/emc文件夹中的各个文件,也是该数控系统的核心所在。
我们再次列出linuxcnc-dev/src/emc中的子结构树:
linuxcnc-dev/src/emc中的子结构树:
根据该结构树,我们一个一个的再一次进行分析:
(1)canterp(interpreterforcanonicalcommands,即规范命令的解释器)
//FILE,fopen(),fclose()
//strcpy()
//isspace()
#include<
stdio.h>
string.h>
ctype.h>
limits.h>
#include<
algorithm>
#include"
config.h"
emc/nml_intf/interp_return.hh"
emc/nml_intf/canon.hh"
emc/rs274ngc/interp_base.hh"
其中包括了语法解析,读取,执行等函数,对刀具信息、主轴转速、开始、停止等信息进行判断和执行工作。
(2)ini(inifilerelatedoperations,初始化相关的文件)
同样,列出该文件夹的结构树:
||--ini(inifilerelatedoperations)
|||--emcIniFile.cc/hh
|||--iniaxis.cc/hh
|||--inihal.cc/hh
|||--initraj.cc/hh
||