LINUXCNC源程序原理说明文档格式.docx
《LINUXCNC源程序原理说明文档格式.docx》由会员分享,可在线阅读,更多相关《LINUXCNC源程序原理说明文档格式.docx(48页珍藏版)》请在冰点文库上搜索。
||--stepper-xyza
||--stg(sampleservousingSTGISA)
||--univpwm(samplePICOservogenerator)
||--univstep(samplePICOsteppergenerator)
|`--vti
|--debian(filesneededtobuilddebpackages)
||--extras-Ubuntu-5.10(extrafilesforUbuntu5.10)
|||--etc
||||--modprobe.d
||||--udev
|||||--rules.d
||||`--scripts
|||`--xdg
|||`--menus
|||`--applications-merged
||`--usr
||`--share
|||--applications
|||--desktop-directories
||`--pixmaps
||--extras-Ubuntu-6.06(extrafilesforbuildingonUbuntu6.06DapperDrake)
||--extras-Ubuntu-7.10(extrafilesforbuildingonUbuntu7.10)
||||`--rules.d
||--extras-Ubuntu-8.04(extrafilesforbuildingonUbuntu8.04HardyHeron)
||--extras-sim-Ubuntu-5.10(extrafilesforsimpackageforUbuntu5.10)
|`--extras-sim-Ubuntu-6.06(extrafilesforsimpackageforUbuntu6.06DapperDrake)
||--etc
||`--xdg
||`--menus
||`--applications-merged
|`--usr
|`--share
||--applications
||--desktop-directories
|`--pixmaps
|--docs(AlltheimportantandrelevantDocs.)
||--help
||--html(htmlversionofdocs-somegeneratedfromlyx)
||--man(manpages)
|||--man1
|||--man3
||`--man9
|`--src(APIandsourcenotesshouldbeineachsrcdir.)(sourceforthehandbooks)(toplevel.lyxfiles)
||--code
||--common(shared.lyxfilesandimages,suchasglossary,GPLDlicense)
||--config
||--gcode(.lyxfiles,images,etc.forG-Codedocumentation)
||--gui(.lyxfiles,images,etc.forGUIdocumentation)
||--hal(.lyxfiles,images,etc.forHALdocumentation)
||--install
||--ladder
||--motion
|`--quickstart
|--include(headersinstalledhere-originalsinsrc/xxx/)
|--lib(usermodeobjectfiles)
|`--python
||--rs274
|`--yapps
|--nc_files(SampleNCfiles)
|--rtlib(kernelmodeobjectfiles,onlyafterasuccessfullcompile)
|--scripts(bashscriptslikelinuxcnc,realtime,rip-environment,etc.)
|--share
||--axis
|||--images
||`--tcl
||--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(interpreterforcanonicalcommands)
|||--ini(inifilerelatedoperations)
|||--iotask(IOinterface,lotsofHALpins)
|||--kinematics(trajectoryplannerandkinematics)
|||--motion(motioncontroller,talksthroughSHMtotherestofEMC)
|||--nml_intf(emcspecificNMLimplementation,allmessagessentinemc)
|||--rs274ngc(thers274g-codeinterpreter)
|||--sai
|||--task(corecomponentinemc,dispatchesactionstootherparts)
||`--usr_intf(interfacesforsomeGUIs,andotherinterfaces:
AXIS,halui,stepconf)
|||--axis
||||--etc
||||--extensions
|||`--scripts
||`--stepconf
||--hal(theHardwareAbstractionLayer,providesaunifiedinterfaceacrossallhardware)
|||--classicladder
|||`--projects_examples
|||--components
|||--drivers
||||--m5i20
|||||--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
||`--rcs
||--module_helper
||--objects
|||--emc
||||--canterp
||||--ini
||||--iotask
||||--motion
||||--nml_intf
||||--rs274ngc
||||--sai
||||--task
|||`--usr_intf
|||`--axis
|||`--extensions
|||--hal
||||--classicladder
||||--components
||||--drivers
||||--user_comps
|||||--devices
||||`--vcp
|||`--utils
|||--libnml
||||--buffer
||||--cms
||||--inifile
||||--linklist
||||--nml
||||--os_intf
||||--posemath
|||`--rcs
|||--rtapi
|||--rtemc
||||--kinematics
|||`--motion
|||--rthal
|||--rtlibnml
|||`--posemath
||`--rtobjects
||`--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
|`--scripts
`--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.0
|--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/
|
\---$moduledir/(basedonwhere./configurefindstheRTOSmodules)
根据这个结构树,我们可以清楚的知道每一个文件夹,每一个子文件的作用,包括了接口,硬件抽象层,实时内核等等部分。
当然,在这里面我们需要深入研究的是linuxcnc-dev/src/emc文件夹中的各个文件,也是该数控系统的核心所在。
我们再次列出linuxcnc-dev/src/emc中的子结构树:
linuxcnc-dev/src/emc中的子结构树:
根据该结构树,我们一个一个的再一次进行分析:
(1)canterp(interpreterforcanonicalcommands,即规范命令的解释器)
#include<
stdio.h>
//FILE,fopen(),fclose()
string.h>
//strcpy()
ctype.h>
//isspace()
limits.h>
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
|||--initool.cc/hh
(2.1)emcIniFile.cc/hh
math.h>
//M_PI.
e