📄 classic_ladder.lyx
字号:
section display, and section manager.\layout SubsectionThe Variables window\layout StandardIt displays some of the variable data and variable names. Notice all variable start with the % sign.\layout StandardThe three edit areas at the top allow you to select what 15 variable will be displayed in each column. For instance if there were 30 %I variable and you entered 10 at the top of the column, variable %I10 to %I25 would be displayed.\layout StandardThe check boxes allow you to set and un set variables but when classicladder is running hal will update the pins and change them.\layout StandardNear the bottom are the %W variables. These are called word variable and represent positive and negative (signed) numbers and are used with compare and operate. By clicking on the variable, you can edit the number to display which ever you want.The edit box beside it is the number stored in the variable -you can change it- and the drop-down box beside that allow you to choose whether the number to be displayed is in hex, decimal or binary.\layout StandardThe %I variable represents HAL input bit pins. The %Q represents the relay coil and HAL output bit pins. The %B represents an internal relay coil or internal contact.\layout Standard\layout Standard\begin_inset Float figureplacement Hwide falsecollapsed false\layout CaptionClassicLadder Var window\layout Standard\align center \begin_inset Graphics filename images/Bit_Vars.png scale 75\end_inset \begin_inset Graphics filename images/Word_Vars.png\end_inset \end_inset \layout SubsectionThe Section Display window\layout StandardMost of the buttons are self explanitory: \layout StandardThe config button is not used in EMC. \layout StandardThe symbols button will display an editable list of symbols for the variables (eg you can name the inputs, outputs, coils etc). \layout StandardThe symbols window will display the HAL signal names if present for %I, %Q and %W variables.\layout StandardThe quit button will only shut down the display-the ladder program will still run in the back ground. \layout StandardThe check box at the top right allows you to select whether variable names or symbol names are displayed\layout Standard\begin_inset Float figureplacement Hwide falsecollapsed false\layout CaptionClassicLadder Section Display window\layout Standard\align center \begin_inset Graphics filename section_display.png scale 75\end_inset \end_inset \layout SubsectionThe Section Manager window\layout StandardThis window allows you to name, create or delete sections. This is also how you name a subroutine for call coils.\layout Standard\begin_inset Float figureplacement Hwide falsecollapsed false\layout CaptionClassicLadder Section Manager window\layout Standard\align center \begin_inset Graphics filename sections_manager.png scale 75\end_inset \end_inset \layout SubsectionThe Editor window\layout StandardStarting from the top left image:\layout EnumerateSELECTOR ARROW, ERASER\layout EnumerateN.O., N.C. , RISING-EDGE ,FALLING-EDGE CONTACTS.\layout EnumerateHORIZONTAL, VERTICAL , HORIZONTAL RUNNING-CONNECTIONS\layout EnumerateTIMER, MONOSTABLE, COUNTER, COMPARE\layout EnumerateN.O. COIL, N.C. COIL, SET COIL, RESET COIL\layout EnumerateJUMP COIL, CALL COIL, OPERATE\layout Standard\begin_inset Float figureplacement Hwide falsecollapsed false\layout CaptionClassicLadder Editor window\layout Standard\align center \begin_inset Graphics filename editor.png scale 75\end_inset \end_inset \layout StandardA short description of each of the buttons:\layout ItemizeThe SELECTOR ARROW button allows you to select existing objects and modify the information.\layout ItemizeThe ERASER erases an object.\layout ItemizeThe N.O. CONTACT is a normally open contact. It can be an extenal HAL-pin (%I) input contact, an internal-bit coil (%B) contact or a external coil (%Q) contact. The Hal-pin input contact is closed when the HAL-pin is true. The coil contacts are closed when the coresponding coil is active (%Q2 contact closes when %Q2 coil is active).\layout ItemizeThe N.C. CONTACT is a normally closed contact. It is the same as the n.o. contact except that the contact is open when the hal-pin is true or the coil is active.\layout ItemizeThe RISING-EDGE CONTACT is a contact that is closed when the HAL-pin goes from False to true, or the coil from not-active to active.\layout ItemizeThe FALLING-EDGE CONTACT is a contact that is closed when the HAL-pin goes from true to false or the coil from active to not.\layout ItemizeThe HORIZONTAL CONNECTION connects the 'signal' to objects horizontally. \layout ItemizeThe VERTICAL CONNECTION connects the 'signal' to objects vertically. \layout ItemizeThe HORIZONTAL-RUNNING CONNECTION is a quick way to connect a long run of 'signal wire' horizontally.\layout ItemizeThe TIMER is a Timer Module. \layout ItemizeThe MONOSTABLE is monostable module (one-shot) \layout ItemizeThe COUNTER is a counter module. \layout ItemizeThe COMPARE button allows you to compare variable to values or other variables. (eg %W1<=5 or %W1=%W2)\newline The variable you can use are: W-words,T-timers,M-monostables,C-counters,X-sequential and their attributes D-done, E-empty, F-full, P-preset, R-running, and V-value (not all atributes are available to all variables) eg %T2.D.\newline The math symbols are +,-,*,/,=,<,>,<=,>=,(,),^ (exponent),% (modulas),& (and),| (or),! (not). \newline Math function are ABS (absolute), MOY (average). eg ABS(%W2)=1, MOY(%W1,%W2)<3 .\newline Compare cannot be placed in the right most side of the section display. \layout ItemizeThe OPERATE button allows you to assign values to variables. (eg %W2=7 or %W1=%W2) there are two math funtions MINI and MAXI that check a variable for maximum (0x80000000) and minimum values (0x05FFFFFFF) (think signed values) and keeps them from going beyond. \newline You may use all the math symbols and functions from above. OPERATE funtions can only be placed at the right most side of the section display.\layout SectionClassicLadder Variables\begin_inset LatexCommand \index{ClassicLadder Variables}\end_inset \layout StandardList of known variables :\layout DescriptionBxxx : Bit memory xxx (boolean)\layout DescriptionWxxx : Word memory xxx (32 bits integer) w32in and w32out also use the word memory. See the s32\begin_inset LatexCommand \ref{sec:w32-Pins}\end_inset section for details.\layout DescriptionTxx,R : Timer xx running (boolean, user read only)\layout DescriptionTxx,D : Timer xx done (boolean, user read only)\layout DescriptionTxx,V : Timer xx current value (integer, user read only)\layout DescriptionTxx,P : Timer xx preset (integer)\layout DescriptionMxx,R : Monostable xx running (boolean)\layout DescriptionMxx,V : Monostable xx current value (integer, user read only)\layout DescriptionMxx,P : Monostable xx preset (integer)\layout DescriptionCxx,D : Counter xx done (boolean, user read only)\layout DescriptionCxx,E : Counter xx empty overflow (boolean, user read only)\layout DescriptionCxx,F : Counter xx full overflow (boolean, user read only)\layout DescriptionCxx,V : Counter xx current value (integer, user read only)\layout DescriptionCxx,P : Counter xx preset (integer)\layout DescriptionIxxx : Physical input xxx (boolean) - HAL input bit -\layout DescriptionQxxx : Physical output xxx (boolean) - HAL output bit -\layout DescriptionXxxx : Activity of step xxx (sequential language)\layout DescriptionXxxx,V : Time of activity in seconds of step xxx (sequential language)\layout SectionUsing JUMP COILs\begin_inset LatexCommand \index{JUMP COILs}\end_inset \layout StandardJUMP COILs are used to 'JUMP' to another section-like a goto in BASIC programming language.\layout StandardIf you look at the top left of the sections display window you will see a small lable box and a longer comment box beside it. Now go to Editor->Modify then go back to the little box, type in a name.\layout StandardGo ahead and add a comment in the comment section. This lable name is the name of this rung only and is used by the JUMP COIL to identify where to go.\layout StandardWhen placing a JUMP COIL add it in the right most position and change the lable to the rung you want to JUMP to.\layout StandardJUMP COILs should be placed as the last coil of a rung because of a bug. If there are coils after the JUMP COIL (in the same rung) they will be updated even if the JUMP COIL is true.\begin_inset Footcollapsed false\layout StandardIf the JUMP COIL is true it should JUMP to the new rung right away and not update the rest of the coils of the current rung\end_inset \layout SectionUsing CALL COILs\begin_inset LatexCommand \index{CALL COILs}\end_inset \layout StandardCALL COILs are used to go to a subroutine section then return-like a gosub in BASIC programming language.\layout StandardIf you go to the sections manager window hit the add section button. You can name this section, select what language it will use (ladder or sequential), and select what type (main or subroutine).\layout StandardSelect a subroutine number (SR0 for exampe). An empty section will be displayed and you can build your subroutine.\layout StandardWhen your done that, go back to the section manager and click on the your 'main' section (default name prog1).\layout StandardNow you can add a CALL COIL to your program. CALL COILs are to be placed at the right most position in the rung.\layout StandardRemember to change the lable to the subroutine number you choose before. \layout StandardThere can only be one CALL COIL per rung-the rest wil not be called.\layout Sectionw32 Pins\begin_inset LatexCommand \index{w32 Pins}\end_inset \begin_inset LatexCommand \label{sec:w32-Pins}\end_inset \layout StandardAs of EMC 2.2.0 The realtime module can export HAL s32 unsigned integer in/out pins.\layout StandardYou must specify how many s32 in/out pins you want when loading the realtime module (default is 0 of each).\layout StandardFor example to load 5 s32in and 5 s32out pins:\layout Quoteloadrt classicladder_rt numS32in=5 numS32out=5\layout StandardThis loads the realtime module with the default number of each ladder objects except for it also specifies 5 s32 in pins and 5 s32 out pins.\layout StandardValues of this type can range from -2,147,483,648 to 2,147,483,647. They would correspond to some of the %W variables. For instance if you requested 5 s32in pins and 5 s32out pins %W0-%W4 would correspond to HAL pin name classicladder.0.s32in.00 -04 %W5-%W9 would be HAL pin name classicladder.0.s32out-00 -04 and %W10-99 would be regular (memory) variables.\layout StandardIf you request only s32out pins they would start at %W0 and regular words would start after them. so it maps %W variables like this. Number of s32in pins first (if any), then number of s32out pins second (if any) then regular memory variables.\layout StandardFor example if you add 2 s32in pins and 3 s32out pins the word relationship would be as shown in the following table.\layout Standard\begin_inset Float tableplacement Hwide falsecollapsed false\layout CaptionUsing w32's\layout Standard\align center \begin_inset Tabular<lyxtabular version="3" rows="7" columns="2"><features><column alignment="center" valignment="top" leftline="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 StandardWord\end_inset </cell><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout StandardHal Pin\end_inset </cell></row><row topline="true"><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout Standard%W0\end_inset </cell><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout Standardclassicladder.0.s32in.00\end_inset </cell></row><row topline="true"><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout Standard%W1\end_inset </cell><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout Standardclassicladder.0.s32in.01\end_inset </cell></row><row topline="true"><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout Standard%W2\end_inset </cell><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout Standardclassicladder.0.s32out.00\end_inset </cell></row><row topline="true"><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout Standard%W3\end_inset </cell><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout Standardclassicladder.0.s32out.01\end_inset </cell></row><row topline="true"><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout Standard%W4\end_inset </cell><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout Standardclassicladder.0.s32out.02\end_inset </cell></row><row topline="true" bottomline="true"><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout Standard%W5\end_inset </cell><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout Standardstart of regular words\end_inset </cell></row></lyxtabular>\end_inset \end_inset \the_end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -