📄 basic_hal.lyx
字号:
#LyX 1.3 created this file. For more info see http://www.lyx.org/\lyxformat 221\textclass book\language english\inputencoding auto\fontscheme default\graphics default\paperfontsize default\spacing single \papersize Default\paperpackage a4\use_geometry 0\use_amsmath 0\use_natbib 0\use_numerical_citations 0\paperorientation portrait\secnumdepth 3\tocdepth 3\paragraph_separation skip\defskip smallskip\quotes_language english\quotes_times 2\papercolumns 1\papersides 1\paperpagestyle default\layout ChapterGetting Started\layout SectionHal Commands\layout Subsectionloadrt\layout StandardThe command "loadrt" loads a real time HAL component. Real time components need to be added to threads to do anything. You can not load a user space component into the real time space.\layout StandardThe syntax and an example:\layout Quoteloadrt <component> <options>\layout Quoteloadrt mux4 count=1\layout Subsectionaddf\layout StandardThe command "addf" adds a function to a real time thread. If you used the Stepper Config Wizard to generate your config you will have two threads.\layout Itemizebase-thread (the high speed thread) this thread handles items that need a fast response like making pulses, reading and writing to the parallel port.\layout Itemizeservo-thread (the slow speed thread) this thread handles items that don't quite need as fast of a thread like motion controller, ClassicLadder, motion command handler.\layout StandardThe syntax and an example:\layout Quoteaddf <component> <thread>\layout Quoteaddf mux4 servo-thread\layout Subsectionloadusr\layout StandardThe command "loadusr" loads a user space HAL component. User space programs are their own separate processes, which optionally talk to other HAL components via pins and parameters. You can not load real time components into user space.\layout StandardThe syntax and an example:\layout Quoteloadusr <component> <options>\layout Quoteloadusr or2 count=2\layout Subsectionnet\layout StandardThe command "net" creates a "connection" between a signal and and one or more pins. The direction indicator "<= and =>" is only to make it easier to read for humans and is not used by net. \layout StandardThe syntax and an example:\layout Quotenet <signal-name> <pin-name> <opt-direction> <opt-pin-name>\layout Quotenet my-new-signal function.0.pin-00-in <= paraport.0.pin-11-in\layout Subsectionsetp\layout StandardThe command "setp" sets the value pin or parameter. Some components have parameters that need to be set before use. Parameters can be set before use or while running as needed. You can not use setp on a pin that is connected to a signal.\layout StandardThe syntax and an example:\layout Quotesetp <pin/parameter-name> <value>\layout Quotesetp function.0.parameter 1\layout SectionHal Files\layout StandardIf you used the Stepper Config Wizard to generate your config you will have up to three HAL files in your config directory.\layout Itemizemy-mill.hal (if your config is named "my-mill") This file is loaded first and should not be changed if you used the Stepper Config Wizard.\layout Itemizecustom.hal This file is loaded next and before the GUI loads. This is where you put your custom HAL commands that you want loaded before the GUI is loaded. \layout Itemizecustom_postgui.hal This file is loaded after the GUI loads. This is where you put your custom HAL commands that you want loaded after the GUI is loaded. Any HAL commands that use pyVCP widgets need to be placed here. \layout SectionLogic Components\layout StandardHal contains several real time logic components. Logic components follow a "Truth Table" that states what the output is for any given input. Typically these are bit manipulators and follow electrical logic gate truth tables.\layout Subsectionand2\layout StandardThe "and2" component is a two input "and" gate. The truth table below shows the ouput based on each combination of input.\layout StandardSyntax\layout Quoteand2 [count=N|names=name1[,name2...]]\layout StandardFunctions\layout Quoteand2.n\layout StandardPins\layout Quoteand2.N.in0 (bit, in)\newline and2.N.in1 (bit, in)\newline and2.N.out (bit, out)\layout Standard\align center Truth Table\layout Standard\align center \begin_inset Tabular<lyxtabular version="3" rows="5" columns="3"><features><column alignment="center" valignment="top" leftline="true" rightline="true" width="0"><column alignment="center" valignment="top" rightline="true" width="0"><column alignment="center" valignment="top" leftline="true" rightline="true" width="0"><row topline="true" bottomline="true"><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout Standardin0\end_inset </cell><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout Standardin1\end_inset </cell><cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">\begin_inset Text\layout Standardout\end_inset </cell></row><row topline="true"><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout StandardFalse\end_inset </cell><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout StandardFalse\end_inset </cell><cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">\begin_inset Text\layout StandardFalse\end_inset </cell></row><row topline="true"><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout StandardTrue\end_inset </cell><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout StandardFalse\end_inset </cell><cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">\begin_inset Text\layout StandardFalse\end_inset </cell></row><row topline="true"><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout StandardFalse\end_inset </cell><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout StandardTrue\end_inset </cell><cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">\begin_inset Text\layout StandardFalse\end_inset </cell></row><row topline="true" bottomline="true"><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout StandardTrue\end_inset </cell><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout StandardTrue\end_inset </cell><cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">\begin_inset Text\layout StandardTrue\end_inset </cell></row></lyxtabular>\end_inset \layout Subsectionnot\layout StandardThe "not" component is a bit inverter. \layout StandardSyntax\layout Quotenot [count=n|names=name1[,name2...]]\layout StandardFunctions\layout Quotenot.n\layout StandardPins\layout Quotenot.n.in (bit, in)\newline not.n.out (bit, out)\layout Standard\align center Truth Table\layout Standard\align center \begin_inset Tabular<lyxtabular version="3" rows="3" columns="2"><features><column alignment="center" valignment="top" leftline="true" rightline="true" width="0"><column alignment="center" valignment="top" leftline="true" rightline="true" width="0"><row topline="true" bottomline="true"><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout Standardin\end_inset </cell><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout Standardout\end_inset </cell></row><row topline="true"><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout StandardTrue\end_inset </cell><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout Standard
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -