TRiLOGI's ladder logic editor window lies between the main menu bar along the top of the screen and the help message line along the bottom of the screen. The cursor will appear in the window whenever you are in the logic editor. The ladder logic editor comprises two modes: the browse mode and the circuit editing mode. We shall explain the operation of both modes
You are normally in the browser mode when you start up the program. The browse mode allows you to manipulate the whole ladder logic circuit as a single entity: you can view any circuit, make copies of it, move it to another location or delete it entirely. Each complete ladder logic "circuit" is given a circuit number. You should see a small red color marker showing you the currently selected circuit. The circuit number of the selected circuit is shown on the upper status line as "Circuit # xxx ".
Mouse ActionsSince TRiLOGI Version 5.0 runs under windowing environment, all usual mouse action applies. You can grab the vertical scroll bar to scroll to your desired circuit and click on it to select it. Double click on a circuit enters the Circuit-Editing Mode which will be described later.
Keyboard ActionsThe functions of various keys in the browse mode are explained below:
- Allows you to enter circuit editing mode for the currently selected circuit. If the selected circuit is a comment circuit, the comment editor will be opened automatically.
<Spacebar>
<F1> - Activates the help function to display on-line help.
<F2> - Opens the I/O Table to create the I/O Label Names
<F3> - Turns ON/OFF display of the I/O type for ladder logic contacts on the screen. All ladder logic contact symbols are normally identified by their label names. However, you can also display an optional small literal to indicate the I/O types. e.g. i=input, o=output, r= relay, t= timer and c=counter.
<F5> - Refreshes the display. If for some reason the screen is garbled by incomplete circuit display, you can just press the <F5> key to redraw the screen.
<F7> - Opens any custom function. If the currently selected circuit contains a custom function, then it will be opened for editing. Otherwise TRiLOGI will ask you to select a custom function # from a menu.
<F8> - Compiles the TRiLOGI program to show the compilation statistics.
<F9> - Runs the simulator without resetting any I/O.
<Ctrl-F9> - Resets all I/Os and then runs the simulator.
<Ctrl-F8> - Resets all I/Os except inputs and then runs the simulator.
<Up>/<Dn><PgUp> and <PgDn> keys - Use the up/down cursor keys to move the marker to other circuits and the "Circuit #" display at the upper status line will simultaneously reflect the change. If you attempt to venture beyond the screen, the logic editor screen will scroll. The <PgUp> and <PgDn> keys can be used to scroll one page at a time.
II. The Circuit Menu |
Insert Comments
Comments are specific remarks used by a programmer to explain various characteristics of a program segment and are ignored by the compiler. TRiLOGI Version 5.0 allows comments to be freely inserted between circuits. Execute this command and the Comment Editor will be opened. The comment editor allows you to enter any text you like that best describe the working of the circuit. All standard text editing keys, including cut and paste are applicable to the Comment Editor. When you have finished editing the comments, press <ESC> key to close it.
Once a comment has been created, it is assigned a circuit number and is treated like any other circuits. You can edit it by pressing the <spacebar> when you are in Browse mode, alternatively, you can move it around, copy it to another destination or delete it entirely using commands in the "Circuit" menu.
Insert Circuit
This command enables you to insert a new circuit just before the currently selected circuit. The current circuit number will be increased by one while the new circuit will assume the current circuit number. You will be placed in the circuit editing mode for immediate circuit creation.
Move Circuit
You can rearrange the order of the circuits by using this command. Select the circuit you wish to move and execute the "Move Circuit" command, then select a destination circuit location and press <Enter>. The selected circuit will be moved to the new location before the destination circuit.
Note that if you wish to move a block of circuits to a new location, you may find it more productive to use the "Cut Circuit" and "Paste Circuit" commands in the "Edit" menu.
Append Circuit
Execute this to add a new circuit to the ladder logic program. This new addition will be positioned immediately after the last circuit in the entire program.
Delete Circuit
This command allows you to delete the one or more circuits. You will be prompted to enter the range of circuits that you wish to delete. Please note that you can't UNDO a delete circuit operation.
III. The Edit Menu |
Cut CircuitYou can remove a number of circuits from the current ladder program and store them temporarily in the clipboard for pasting into another part of the present ladder program or into another file altogther. In other words, it lets you move a block of circuits from one part of the ladder program to another part or into another file. Please note that you can't UNDO a Cut Circuit operation. However, if you do make a mistake you can always paste it back
in its original position. Copy Circuit (Ctrl-C)You can copy a block of circuits from the current ladder program and store them into the clipboard for pasting into another part of the present ladder program or into another ladder program file altogther.
Paste Circuit (Ctrl-V)When you execute this command, the block of ladder circuit which you "Cut" or "Copy" into the clipboard will be pasted just before the currently selected circuit. The current circuit number will be adjusted to reflect the change.
Find (Ctrl-F)The Find command allows you to quickly locate a ladder logic circuit that contains a particular label name. The Find command can also be used to search for a keyword in a TBASIC program. When this command is executed, you will be further prompted to select the option of searching for a ladder logic label or a text in a Custom Function.
Goto (Ctrl-G)Use this command to move towards a specific circuit number. The "Goto" command is particularly useful if your program contains many circuits, and it is inconvenient to search for a particular circuit using the mouse or the cursor keys.
IV. The Circuit Editing Mode |
TRiLOGI comes with a smart editor which allows you to insert or delete a single element within a circuit easily. The editor interprets your circuit immediately upon entry and prevents you from creating illegal circuit connections. The functions of various keys in the circuit editing mode are detailed below. You know that you are in the circuit editing mode when a row of ladder logic icons appears along the upper status line next to the circuit number and a yellow color highlight bar appears and you can move it to select an element in the ladder circuit, as shown below:
Mouse Actions
Left Click - When you click on an element using a the left mouse button, the element is selected and highlighted by the yellow color highlight bar.
Right Click - When you click on an element using the right mouse button, you are allowed to directly edit the label name of the element. This can be a convenient feature if you need to change one or two characters in the name only. However, if the element is a custom function [dCusFn], or [CusFn], then the custom function editor will be opened for you to edit the function directly.
Insert Ladder Element - You create the ladder circuit element simply by moving the mouse pointer to the icon and pressing either the left or the right mouse button to insert a ladder logic element to the currently highted element. The following is a description of the functions of each icon. A yellow color highlight bar will appear which you can move to select an element in the ladder circuit.
<1> - Left click to insert a normally-open series contact.
<2> - Right click to insert a normally-closed series contact.<3> - Left click to insert a N.O. parallel contact to highlighted element
<4> - Right click to insert a N.C. parallel contact to highlighted element<5> - Left click to insert a N.O. parallel contact to enclose one or more elements.
<6> - Right click to insert a N.C. parallel contact to enclose one or more elements.<7> - Insert a normal coil which may be an output, relay, timer or counter. <8> - Insert a parallel output coil (not an entire branch) to the current coil. <9> - Insert a special function coil which includes execution of CusFn <0> - Insert a parallel special function coil to the current coil. </> - Invert the element from N.O. to N.C. or from N.C. to N.O. Click to move the highlight bar to the right (same effect as pressing the right arrow key).
This can be used to move the cursor to a junction which cannot be selected by mouse click.Double-click to delete a highlighted element. This acts as a safety against mistake. When you click on an icon, for example, the . The icon will change to bright yellow color to show you the element type that you are creating. At the same time, an I/O table should appear on the screen with a light beige-color background. The I/O table acts like a pop-up menu for you to pick any of the pre-defined label name for this contact. This saves you a lot of typing and at the same time eliminates typo errors that could result in a compilation failure. You should spend a few minutes to follow the "Ladder Logic Programming Tutorial" on the steps needed to create a ladder program.
As mentioned previously, the ladder editor is intelligent and will only accept an action that can result in the creation of a correct ladder element. Otherwise it will simply beep and ignore the command.
UNDO Circuit EditingIf you have wrongly inserted or deleted an element and wish to undo the mistake, you can either select "Undo" from the "Edit" menu or press <Ctrl-Z> key to undo the last step. The undo buffer stores the last 10 editing steps. You can also choose to abort all the operations on the current circuit by selecting "Abort Edit Circuit" to abort all changes made to the current circuit.
Create Ladder Circuit Using The Keyboard
Users of existing TRiLOGI version 3.x or 4.x who are familiar with creating ladder programs using the keyboard will be delighted to know that they can still create their ladder programs using the keyboard. The keyboard actions are described below:
Left/Right/Up/Down cursor keys<ESC>The cursor keys are for moving the highlight bar from one element to another in their four respective directions. You can only move in a direction which will end up with an element.
<Enter>Press <ESC> key to end the circuit editing mode and return to the browse mode of the logic editor.
<Tab>When you are done with editing the current circuit, hit <Enter> to proceed to the next circuit.
<0> to <9> , </> & <E> keysIf you observe the highlight bar carefully, you will notice a dark green color square at the right end of the highlight. This indicates the insertion location where a series contact will be attached. You can change the insertion location to the left or the right of the highlight bar by pressing the <TAB> key.
The position of the cursor has no effect when you connect a parallel contact to the highlighted element. The left terminal of the element will always be connected to the left side of the parallel branch.
Pressing the key <0> to <9> and </> is equivalent to clicking on the icon shown in the table. The equivalent keyboard number is shown as a small numeral at the lower right corner of the icon. The </> key is the quickest way of converting a normally-open contact to a normally-closed one (and vice versa).
Pressing the <E> key when a contact or coil is selected allows you to edit the label name directly. Note that it is the user's responsibility to ensure that the label is valid.