JMRI Panel Tutorial Part 2 Introduction To Layout Editor And Panel Editor (JMRI) Robert Bucklew bob@quaker-valley.com 06/26/2012
Panel Editor Development We are ready to start development of the second panel using Panel Editor. The Panel Editor is a blank canvas on which you can add graphic icons. Each icon is placed on a level, with 1 being the lowest-level background and 10 being the highest-level foreground. Switches, buttons and levers will go on level 10. We'll move the background icons to level 2 after they are added. Plates and lamps go in between. Graphic images are in the resources\icon directory of JMRI. You select the graphic icons and add them to the panel, moving them into place. The icons drop onto the panel at the x,y coordinates indicated on the panel editor. (See FIG 32) You can then right click and move them as needed. Some icons may be hard to see based on the background at 0,0. But you can grab them and move them just the same. 1. From the main screen, select, Panels, New Panel, Panel Editor as shown in FIG 31. FIG 31 STARTING PANEL EDITOR 2. The blank panel is shown waiting for you to add icons, sensors and turnouts in the right places. Also open is the Panel Editor, which you will use to add elements to the panel. See FIG 32. FIG 32 PANEL EDITOR WITH BLANK PANEL Tutorial Part 2 Page 1 of 59 Revision 1.1
3. Click the drop down box Select the type of icon to Add to the panel and scroll down to the bottom entry Icon as shown in FIG 33. FIG 33 SELECTING ICONS WITH PANEL EDITOR 4. This opens the Add Icon screen and you will click on the Change Icon button. Expand the Program Directory by clicking on the key at the left side. Expand the icons directory as well. Click on Program Directory as shown in FIG 34. FIG 34 ADD ICON SCREEN WITH RESOURCE FOLDERS OPEN Tutorial Part 2 Page 2 of 59 Revision 1.1
5. To add an icon, we must drag it to the top button labeled Icon. First add a left side CTC panel background slice icon. In the Icons folder, scroll down to the USS folder and open it. Find the icon named Panel-left-7 and drag it to the Icon button. Its picture appears ready to be added to the panel. See FIG 35. FIG 35 ADD ICONS WITH LEFT BACKGROUND PANEL SELECTED 6. Click the Add to panel button and the left slice appears in position. When you drag the icon, a box with a cross hair will appear. Please note that the arrow point of your mouse pointer must be inside the Icon button before releasing the mouse button, not the box picture you are dragging. 7. Now drag the icon Panel-blank-7 to the Icon position and click Add to Panel. 8. As it is added at coordinates 0,0 it is on top of the left side slice. Right click the icon and move it to the right. Tutorial Part 2 Page 3 of 59 Revision 1.1
9. Right click on the full slice and select and edit x & y as shown in FIG 36. Move it to position 12,0 so it is adjacent to the left slice. FIG 36 CTC PANEL WITH TWO BACKGROUND ICONS EDITING X Y LOCATION 10. Click on the panel editor and change the x coordinate to 77. Click on the Add Icon panel and the Add to panel button. The new slice lines up with the first full slice. 11. Repeat this adding 65, which is the width of each slice. So 142 is next, then 207. 12. Continue adding a total of 7 lever slices at 272, 337 and 402. 13. Then select and add the Panel-right-7 at x position 467. 14. Right click and delete any icon if needed. Tutorial Part 2 Page 4 of 59 Revision 1.1
15. You can re-size the borders of your new panel by dragging them to fit. Your new panel should look like FIG 37. FIG 37 - COMPLETED CTC BACKGROUND WITH RE-SIZED FRAME I have also turned off the scroll bars on the Panel Editor and re-sized the frame to show the complete CTC panel background. Note the center icon slice is highlighted in yellow as the mouse hovers over it. You can use this feature to identify icons on your panel as it grows. Right click on each slice and Edit Level, Set Level to 2 for each of the background slices. Now is a good time to Store your panels with a new file name. Tutorial Part 2 Page 5 of 59 Revision 1.1
Adding Turnout and Signal Plates Now we will add the turnout plates. 1. Add turnout plates 3, 5, 9 and 11 as shown in FIG 37. These icons are in the \resources\icons\uss\plate\numbered-plates\turnout directory. Drag each one to the Icon position and add to panel at x, y = 0,0 position. Right click and drag them into position over the plugs in the background slices. They should be on level 3, just above the background image. 2. The x, y coordinates for the turnout 3 plate is 77,337. You can add 65 to the x position for each new plate, skipping the 7 position. Add signal plates 4, 6, 10 and 12 from the signal directory in a similar manner. The first (signal 4) goes at x, y = 77,435. 3. You may also add the US&S plate from the \USS\plate\base-plates\misc directory and the Code plate from the same directory. You might like to add the JMRI48x48 icon from the Program Directory itself. You panel should look like FIG 38. FIG 38 PANEL WITH TURNOUT AND SIGNAL PLATES IN PLACE Tutorial Part 2 Page 6 of 59 Revision 1.1
Adding Turnout Levers and Code Buttons The turnout or switch lever is an internal sensor that through the Logix controls the railroad turnouts. So we need to create these sensors before adding them to the panel. We will use IS03, IS05, IS09 and IS11 for the turnout levers and IS04, IS06, IS10 and IS12 as the code buttons. US&S practice was to number turnout levers odd and signal levers even. Open spots were reserved for a future lever, so we will start with lever 3 and leave 1 and 7 open. The signal levers will be multi-position sensors, so we will use the even numbers for the code buttons. 1. From the main screen, select, Tools, Tables, Sensors as we did before; shown in Part 1, FIG 14 2. Press the ADD button and enter the new internal sensor IS03 with name Turnout Lever 3 3. Continue to add turnout lever sensors IS05, IS09 and IS11. 4. Add 4 code button sensors IS04 IS06, IS10 and IS12 as Code Button 4, etc. Your complete sensor table should look like FIG 39. FIG 39 EIGHT INTERNAL SENSORS ADDED 5. Close the Add New Sensor frame, but leave the sensor table open, adjacent to your new control panel. Tutorial Part 2 Page 7 of 59 Revision 1.1
Now we will add the turnout levers and code buttons to the panel. Sensors have 4 states and we need to define an icon image for each. The four states are active, inactive, unknown and inconsistent. 1. In the Panel Editor, click the drop down box to add a sensor to the panel as shown in FIG 40. FIG 40 ADDING SENSOR TO PANEL Tutorial Part 2 Page 8 of 59 Revision 1.1
2. Click Change Icons and open the Program Directory\USS\plate\levers\ directory. Drag the l-left lever to the inactive image as shown in FIG 41. FIG 41 ADDFING THE LEVER ICONS 3. Drag the l-right lever icon to the active image. 4. Drag the l-unknown icon to the unknown image. 5. Drag the l-inconsistent icon to the inconsistent image. 6. Click on the button to Close Tutorial Part 2 Page 9 of 59 Revision 1.1
7. Highlight sensor IS03 in the table and click the Add to panel button as shown in FIG 42. FIG 42 ADD A LEVER SENSOR TO PANEL 8. The sensor icon for IS03 is added at coordinates 0,0; drag it into position. Click on it to change the sensor status. 9. While you have the lever icons selected, add IS05, IS09 and IS11. They will stack on each other at position 0,0. 10. Right click and move them into position, noting the correct order. 11. Click the change icon button. The code buttons are in the same icon directory. 12. Drag the code button icon to the inactive image. 13. Drag the code-press icon to the active image. 14. Drag the code-unknown icon to the unknown image. 15. Drag the code-inconsistent icon to the inconsistent image. 16. Click the Close Catalog button. 17. Highlight the IS04 sensor in the table and click on the Add to panel button. 18. As it is added at coordinates 0,0 drag it into position. 19. While you have the code button icons selected, add IS06, IS10 and IS12. They will stack on each other at position 0,0. 20. Right click and move them into position, noting the correct order. Tutorial Part 2 Page 10 of 59 Revision 1.1
21. Right click a code button so the menu appears. Check the momentary feature so that the code button will immediately go inactive after being pushed. Do the same for each code button. Your CTC panel should look like FIG 43. FIG 43 CTC PANEL WITH TURNOUT LEVERS AND CODE BUTTONS 22. Close the Add Sensor frame. JMRI will ask if you want to keep the icons for future use. Click No. Now you can play with your new CTC panel with the sensor table open along side. Mouse click the code buttons and note they change from unknown to active (momentary) to inactive. Each new push will make them active for a moment, returning to the inactive state. 23. Click the turnout levers and watch the sensor table. They should move from unknown to inactive and active, toggling between the two known states with each additional touch. 24. Clean up the screen by closing the Sensor table and Panel Editor. Now is a good time to SAVE your panel file with a new name. Tutorial Part 2 Page 11 of 59 Revision 1.1
Adding Turnout Lever Logix Now let us start to construct the mechanism behind the CTC panel. First we need to add the turnout lamps to our panel. We re going to use the defined NCE turnouts, so there is no sensor on the turnout. If we tell turnout NT1 to throw, we assume it is thrown. Of course you could have contacts and monitor them just as well. In fact if you want to get more complicated, the turnouts lamps could both go out until the turnout state matches the feedback sensor. Just more Logix to construct. For this tutorial, we are going to stay simple. But these lamps will be turnouts as they are tied to the NTxxx hardware. Turnouts also have four states, closed, thrown, unknown and inconsistent 1. First click on the Panel Menu, Edit to open the Panel Editor 2. In the drop down box, select right hand turnout as shown in FIG 44 FIG 44 SELECTING THE TURNOUT ICON 3. We will replace the standard icons with lamps. Click the Change Icon button. Tutorial Part 2 Page 12 of 59 Revision 1.1
4. Open the resources\icons\uss\sensor directory as shown in FIG 45 FIG 45 SENSOR ICONS FOR THE TURNOUT LAMPS 5. Drag the green-on lamp icon to the closed image. 6. Drag the green-off icon to the thrown image. 7. Drag the s-unknown icon to the unknown image. 8. Drag the s-inconsistent icon to the inconsistent image. 9. Click on the Close Tutorial Part 2 Page 13 of 59 Revision 1.1
10. Highlight NT1 and click the Add to Panel button to add the lamp as shown in FIG 46 FIG 46 ADDING THE TURNOUT LAMP 11. Add turnout icons for NT2, NT3 and NT4 to the panel. They will stack on each other at position 0,0. 12. Right click and move them into position in the left position above each turnout lever, noting the correct order, NT1 to NT4 from left to right. 13. Click on the Change Icon button again. 14. Open the \USS\lamps\ directory again. Drag the amber-off lamp icon to the closed image. 15. Drag the amber-on icon to the thrown image. This opposite what we did for the green lamp. 16. Close the catalog and add the turnout icons for NT1, NT2, NT3 and NT4 to the panel. They will stack on each other at position 0,0. Tutorial Part 2 Page 14 of 59 Revision 1.1
17. Right click and move them into position in the right position above each turnout lever, noting the correct order. Your panel should look like FIG 47. FIG 47 CTC PANEL WITH TURNOUT LAMPS AND LEVERS AND CODE BUTTON IN PLACE. The typical US&S panel showed a green lamp for Normal or Closed turnout and a yellow lamp for a Reverse or Thrown turnout. You can make changes for your particular prototype. Now click on the lamp and the turnout lamp will change, one green and one yellow. Not prototypical at all, but we will fix that as we continue. Note also that the turnout lamp on the CTC panel follows the turnout on the layout panel (and vice versus). Tutorial Part 2 Page 15 of 59 Revision 1.1
Time to automate the first lever: 1. From the main screen, select, Tools, Tables, Logix as shown in FIG 48 FIG 48 LOGIX TABLE OPENED 2. Press the ADD button and create a new Logix IX03 with the name Turnout Lever 3. See FIG 49. FIG 49 NEW TURNOUT 03 LOGIX Tutorial Part 2 Page 16 of 59 Revision 1.1
3. Create a new conditional for the Closed turnout position. See FIG 50 and FIG 51. You will enter the Conditional User Name Lever Normal. Then click on the button Add State Variable FIG 50 - CREATE NEW CONDITIONAL FIG 51 - CLOSED LOGIX FOR TURNOUT 3 Tutorial Part 2 Page 17 of 59 Revision 1.1
4. In the new frame, pick a Variable Type Sensor as shown in FIG 52 FIG 52 ADDING STATE VARIABLES TO CONDITIONAL FOR LEVER NORMAL 5. Enter the User name Turnout Lever 3 and change the state to Inactive as shown in FIG 53 FIG 53 SENSOR VARIABLE FOR CONDITIONAL 6. Add another Sensor to the conditional for Code Button 4. Tutorial Part 2 Page 18 of 59 Revision 1.1
7. Uncheck the Trigger Cal box for the Turnout Lever. Your screen should look like FIG 54 FIG 54 COMPLETE CONDITIONAL VARIABLES We will add additional conditions to prevent throwing a turnout under a train or changing once a route is set across the turnout. But we'll keep it simple now. If you notice, we have set the logic to AND, so both events have to be true. And changing the lever will not trigger the action. Only the code push will trigger the action. Note the Status of the first variable is true, that is the turnout lever 3 is inactive or set to the Normal or Closed position. Now add the action we want. 1. Click on the add action button at the bottom of the Edit Conditional Page Tutorial Part 2 Page 19 of 59 Revision 1.1
2. Select Turnout for the Action Group as shown in FIG 55 FIG 55 ACTION GROUP ITEMS 3. We will enter the System name NT1 here. Or you can enter the user name. We want to Set Turnout to the Closed position when the condition changes to True as shown in FIG 56. FIG 56 EDITING THE ACTION Tutorial Part 2 Page 20 of 59 Revision 1.1
4. Click on the Update Button and your screen should look like FIG 57. Click on the Update Conditional Button FIG 57 - COMPLETE ACTIONS 5. Now follow the same steps to add a new conditional for action on the Lever thrown. Tutorial Part 2 Page 21 of 59 Revision 1.1
6. This conditional should look like FIG 58 FIG 58 - THROWN LOGIX FOR TURNOUT 3 Tutorial Part 2 Page 22 of 59 Revision 1.1
7. Click on Update Conditional and you should return to Logix IX03 screen which should look like FIG 59 FIG 59 COMPLETED LOGIX IX03 8. Click Done and you will get a reminder to save your Logix. Don't worry. When you save your panel, all Logix, turnout and sensor tables are saved along with your open panels. Now you can test your lever Logix. Bring the CTC panel to the foreground and flip the turnout lever 3 back and forth. Nothing else should change. Now set it to the right R position. Click the code button. The Thrown Logix should execute and set the turnout NT1 to the thrown position. You should see this on both the CTC Panel and the Layout Panel. Move the lever back to the N position and click the code button. The turnout should return to a Closed position. The Logix conditionals permit you to monitor many sensors and only take action when all of the Logix you create lines up. The Trigger box is used to activate the conditional when that sensor goes true. So flipping the turnout lever does not trigger the conditional. Only pushing the code button triggers the action. Tutorial Part 2 Page 23 of 59 Revision 1.1
We should add some conditions to the new Logix to prevent throwing a turnout under a train on turnout 3. But we need to create some more internal sensors to accomplish that. Before we add the Logix for the remaining turnouts, let us more fully develop the first turnout position. Now is a good time to save your panel. The CTC Panel Track Diagram There are several ways to develop the track diagram for the CTC panel. On my Quaker Valley Railroad, there are two panels and the track diagrams were developed using MS Paint. This is simply a gif file icon that is placed on the panel at level 3, just above the background. One of my complete track diagrams is provided on the web site. A sample for this tutorial is also available. If you want to see this, add the icon samplectc.gif to the panel. It should be located in the JMRI panels directory if you followed the directions in Part 1. 1. To add this large track diagram icon, click on the CTC panel menu, Editor, Open Editor 2. Click on the drop and select Icon as we have before in FIG 33 3. Click on the Change icon button as in FIG 34 4. Select the menu option for Find Icons, Search File system for icons 5. Navigate to the C:\JMRI_Panels\ directory 6. Click on the samplectc.gif file and click the open button 7. After a brief wait, a Preview Directory frame will open. Click on Add to Catalog 8. The JMRI_Panels directory will appear as a resource below the standard Program Directory 9. Click on this directory and drag the samplectc.gif to the Icon position 10. Click on Add to panel Tutorial Part 2 Page 24 of 59 Revision 1.1
11. Drag the track diagram to position as shown in FIG 60 FIG 60 SAMPLE CTC GIF TRACK DIAGRAM ON PANEL This sample diagram includes a schematic diagram of the track layout, turnout numbers in gold, signal locations and text to identify locations. It was developed in MS paint. Right click and remove this sample if you want to see how to develop the track diagram in another way. For this tutorial, we will build the track diagram using the JMRI icons provided. 1. From the Panel Editor, select a Left Hand Turnout 2. Keep the standard icons and highlight NT1 Tutorial Part 2 Page 25 of 59 Revision 1.1
3. Click Add to Panel and examine your CTC panel. In the upper left corner should appear a turnout as shown in FIG 61 FIG 61 TURNOUT ICON 4. Throw your turnout lever and push the code button. 5. Note your turnout icon is live and follows the lamps on the panel. 6. This is not very prototypical, so right click and remove the turnout icon Lets build a track diagram using the standard JMRI icons. 1. From the Panel Editor, select Icon 2. Click on Change Icon and open the Program Directory\USS\track\turnout\left\east Tutorial Part 2 Page 26 of 59 Revision 1.1
3. Click on the Dark Grey bullet at the bottom to set the background to make it easier to see the white icons see FIG 62 FIG 62 TURNOUT ICON SELECTION 4. Drag the east-l icon to the Icon image at top and Add to Panel 5. Add a second one to the panel Tutorial Part 2 Page 27 of 59 Revision 1.1
6. Navigate to the turnout\right\west directory and add two west-r icons to the panel, Now go the panel and drag your four icons into position as shown in FIG 63 FIG 63 - TURNOUT ICONS IN POSITION FOR TRACK DIAGRAM Now lets add some straight track 7. From the Panel Editor, select Icon 8. Click on Change Icon and open the Program Directory\USS\track\block 9. Drag the block.gif to the Icon position and add 15 icons to the panel 10. Drag the b-45-dark gif to the Icon and add 1 copy to the panel. 11. Go to the panel and select the gray line on the diagonal as shown in FIG 64. Drag it onto the track diagram. FIG 64 ADDING BLOCK ICONS Tutorial Part 2 Page 28 of 59 Revision 1.1
12. Right click on it and select rotate (degrees) 13. Enter 90 degrees and set 14. Now drag it down between the two passing sidings. This will represent your stub yard track. 15. Now drag the rest of the blocks onto the diagram and work toward FIG 65 FIG 65 TRACKS IN PLACE ON DIAGRAM 16. Note I overlapped some straight block and the turnouts to create a larger place for block indicators. Now we can add text to the track diagram. 1. On the Panel Editor, add WESTON to the block next to the Add text button 2. Click the Add text button 3. Right Click the text and change the font size to 16, color to yellow and drag into position. Tutorial Part 2 Page 29 of 59 Revision 1.1
4. Add numbers 3, 5, 9 and 11 and change color and move as shown in FIG 66 FIG 66 - TEXT ADDED TO TRACK DIAGRAM We are now ready to place block sensors. 1. Click the Panel Editor to add a sensor. 2. We'll use the standard sensors here. 3. Highlight sensor IS801 and add two icons to the panel 4. Highlight each sensor IS802 through IS806 and add 1 icon to the panel for each 5. Add an extra for IS804 6. Go to the panel and drag them into place. IS801 shows twice, on each end of the track diagram, as the layout is a loop. IS802 is the main at Weston, IS803 is the siding. IS804 shows twice on the single track on either side of the yard turnout. IS805 is the main at Eastville. IS805 is the siding there. Note that IS806 will be on top as it was added last. As you right click you can confirm the name of the icon you are moving. Now we will add the sensors in the interlockings. We will select a red icon for active from the \icons\smallschematics\leds directory. 7. Drag the red icon to the active position and Close Catalog. 8. Select sensors IS901 through IS904 and add one icon to the panel for each. 9. Go to the CTC panel and drag them into position numbered from left to right. Tutorial Part 2 Page 30 of 59 Revision 1.1
10. When you are done, you should have FIG 67. Note some sensors may still be in an unknown state. FIG 67 TRACK SENSORS IN PLACE Activating the Block Sensors Now we need a way to activate the block sensors. Since we are working as a simulator, we'll do it with some additional sensors. 1. From the main menu, select Tools, Tables, Sensors as we did in the part 1 of the tutorial. 2. Click the Add button and set the sensor drop down box to NCE. Tutorial Part 2 Page 31 of 59 Revision 1.1
3. The first new sensor will be 801 for Detector 801 as shown in FIG 68. FIG 68 ADDING NCE SENSORS 4. Add NCE sensors for Detectors 802 through 806. 5. Your sensor table should look like FIG 69. FIG 69 SENSOR TABLE WITH NCE DETECTORS IN PLACE Tutorial Part 2 Page 32 of 59 Revision 1.1
6. Open the Panel Editors and click on sensor in the drop down box. 7. Click on Change Icon and Open the Program Directory Icons USS plate levers. 8. Drag the switch-off icon to the Inactive position. 9. Drag the switch-on icon to the Active position. 10. Drag the switch-unknown and inconsistent icons to their respective positions. 11. Your Add Sensor frame should look like FIG 70. FIG 70 ADDING NCE SWITCH SENSORS TO PANEL 12. Click on Close Catalog 13. Highlight sensor NS801and click on Add to Panel. 14. Add sensors for NS802 through NS806. 15. Close the Add Sensor frame 16. Drag the switch icons into position to match up with the internal sensors IS801 through IS806. Tutorial Part 2 Page 33 of 59 Revision 1.1
17. NS806 is above Eastville, NS805 is below Eastville, NS803 is above Weston, NS801 is the left most block, as shown in FIG 71. FIG 71 NCE SWITCH SENSORS IN PLACE ON CTC PANEL Tutorial Part 2 Page 34 of 59 Revision 1.1
Now we will add Logix to tie the NCE sensors and internal block sensors together. 1. From the Main panel, select Tools, Tables, Logix as shown in FIG 72. FIG 72 SELECTING THE LOGIX TABLE 2. Click the Add button and enter 801 for the system name and Block 801 for the user name as shown in FIG 73. Note here that I did not have you enter the IX prefix as we did when entering the Turnout Lever Logix. I confirmed with the JMRI developers that it doesn't matter with Logix as it does with sensors and turnouts. I might suggest you be consistent and use the IX prefix on all Logix. Tutorial Part 2 Page 35 of 59 Revision 1.1
FIG 73 ADDING BLOCK 801 LOGIX 3. Click the Create Logix button. 4. Click the New Conditional button on the Edit Logix frame. 5. Enter the Conditional name Block 801 Occupied 6. Click on the Add State Variable button 7. In the Variable Type drop down box, select Sensor as shown in FIG 74. FIG 74 ADDING A SENSOR TO THE CONDITIONAL Tutorial Part 2 Page 36 of 59 Revision 1.1
8. In the Edit Variable frame, enter Sensor NS801 going Active as shown in FIG 75. FIG 75 ADDING NS801 TO THE CONDITIONAL 9. Click the Update Button 10. We only need one action item so click on the Add Action Button at the bottom of the frame. 11. Select Sensor from the Action Group drop down box as shown in FIG 79. FIG 79 ADDING A SENSOR ACTION TO THE CONDITIONAL Tutorial Part 2 Page 37 of 59 Revision 1.1
12. We want to set IS801 Active On Change to True as shown in FIG 77. FIG 77 SETTING ACTION FOR CONDITIONAL 13. Click the Update button 14. Add a sound for fun here. Click the Add Action button and select Audio from the drop down box as shown in FIG 78 FIG 78 SELECTING AN AUDIO ACTION Tutorial Part 2 Page 38 of 59 Revision 1.1
15. Select Play Sound File On change to True and click the File button as shown in FIG 79. FIG 79 SELECTING AN AUDIO FILE 16. Click the toggle-on.wav file and click Open 17. The file name will show and just click on the Update button as shown in FIG 80. FIG 80 SETTING THE AUDIO FILE 18. Our two actions are set, so hit the Update Conditional button at the bottom of the Edit Conditional frame. 19. In the same way, click the New Conditional button. 20. Enter Block 801 Unoccupied for the name. Tutorial Part 2 Page 39 of 59 Revision 1.1
21. Add a sensor action for NS801 Inactive as shown in FIG 81. FIG 81 - INACTIVE SENSOR ACTION 22. Click the Update button. 23. Click on the Add Action button and select a sensor action. 24. Select a Delayed Set Sensor for IS801 and enter 5 seconds as shown in FIG 82. FIG 82 DELAYED SENSOR ACTION 25. Click Update and then click Add Action. 26. Select the sound file toggle-off.wav and click on the Update button as shown in FIG 83. FIG 83 SETTING A SOUND FILE Tutorial Part 2 Page 40 of 59 Revision 1.1
27. You now have the Unoccupied conditional set as shown in FIG 84. FIG 84 UNOCCUPIED CONDITIONAL 28. Click on the Update Conditional button. Tutorial Part 2 Page 41 of 59 Revision 1.1
29. You should see the Block 801 Logix as shown in FIG 85. FIG 85 COMPLETE LOGIX 30. Click on the Done button 31. Click on the Okay button when reminded to save your Logix 32. You should now have two Logix as shown in FIG 86. FIG 86 TWO COMPLETE LOGIX Tutorial Part 2 Page 42 of 59 Revision 1.1
Now let us test our new Logix. Move aside the Logix frame and click on the toggle switch for NS801. It should turn IS801 on when active and off after 5 seconds when inactive. This delay will help stop flicker when a real block detector is sensing a lighted cabin on dirty track. I set the delay to 15 seconds on my Quaker Valley Railroad. Note the second IS801 icon at the far right follows as shown in FIG 87. FIG 87 TESTING THE BLOCK 801 DETECTOR LOGIX Continue to create new Logix in the same manner for NS802 controlling IS802 with Occupied and Unoccupied conditionals. You need not add the sound files if you want silent operation. You need to create four more Logix for blocks 803 through 806. Now is a good time to Save your panel file. Once you have all six block detectors controlling their internal block sensors, we need to create Logix for the sensors over the turnouts. These are the interlocking sensors. Dependent on turnout position, these Logix will turn on the interlocking sensor over the turnout when both adjacent block sensors are active. After a 5 second delay, they will turn off the sensor when either adjacent sensor is turned off. So we will use AND logic for on and OR logic for off. Tutorial Part 2 Page 43 of 59 Revision 1.1
Logix for the Interlocking Sensors 1. From the main menu, select Tools Tables, Logix. 2. Click the Add button to create a new Logix. 3. Enter IX901 for the Logix System Name and Interlock 901 for the Logix User Name as shown in FIG 88. FIG 88 NEW LOGIX FOR INTERLOCK 901 4. Click on the Create Logix button 5. Click on the New Conditional button in the next frame. 6. Enter Turnout Normal Occupied for the conditional User Name as shown in FIG 89. FIG 89 ADDING TURNOUT NORMAL OCCUPIED CONDITIONAL 7. Click on the Add State Variable button 8. Select sensor from the drop down box and enter IS801 Active for the first variable. 9. Click the Update button. 10. Click on the Add State Variable button 11. Select sensor from the drop down box and enter IS802 Active for the second variable. Tutorial Part 2 Page 44 of 59 Revision 1.1
12. Click the Update button. 13. Click on the Add State Variable button 14. Select turnout from the drop down box and enter NT1 Closed for the third variable. 15. Click the Update button. 16. Deselect the Trigger Cal box for the turnout. Your screen should look like FIG 90. FIG 90 ACTION VARIABLES 17. Click on the Add Action button at the bottom of the frame. 18. Select sensor IS901 and set it active on a change to true as shown in FIG 91. FIG 91 ACTION SET SENSOR 19. Click the Update button and you have a complete conditional. 20. Click Update Conditional 21. Click on the New Conditional button 22. Enter Turnout Normal Unoccupied for the conditional name. Tutorial Part 2 Page 45 of 59 Revision 1.1
23. Click on the Add State Variable button and add three variables as before but with the block sensors IS801 and IS802 inactive. Your screen should be as in FIG 92. FIG 92 UNOCCUPIED CONDITIONAL BEFORE LOGIC CORRECTION We need to change the Logic because as it is both would have to be inactive to set the interlocking sensor off. We want either to turn it off if the turnout is normal. 24. Click on the Logic Operator box and select Mixed. Note the new antecedent expression line appears. Tutorial Part 2 Page 46 of 59 Revision 1.1
25. Change the first AND within the parentheses to an OR as shown in FIG 93. FIG 93 MIXED LOGIC EXPRESSION If you consider the logic now, the parentheses group either sensor IS801 or IS802 going inactive will trigger the conditional if the turnout is Closed. 26. Click the Add Action button 27. Select an action sensor and make IS901 inactive (Delayed Set Sensor) after 5 seconds as shown in FIG 94. FIG 94 DELAYED INACTIVE SET FOR SENSOR IS901 28. Click the Update button. 29. Click Update Conditional in the next frame. 30. Click Done to close the Logix IX901. 31. Click Okay when warned to save your Logix. Tutorial Part 2 Page 47 of 59 Revision 1.1
Now let us test the Logix. Set the turnout lever 3 to the left and push the code button 4. The green turnout lamp should light with the turnout in the closed position. Now turn on the blocks on either side of the turnout. The Interlocking sensor should turn on or red immediately. Now turn off one of the adjacent block detector sensors. That block should go dark in 5 seconds and the interlocking should go dark 5 seconds after that. That only considers the turnout in the closed position. We can add two conditionals to the Logix to handle the turnout in the thrown position. Open the Logix IX901 by clicking on select next to it in the Logix table. A drop down will show Edit as an option. 32. Click on New Conditional and add a conditional Turnout Reverse Occupied. 33. Add the variables and action items as we did before, only with the turnout thrown. Your complete conditional should look like FIG 95. FIG 95 TURNOUT REVERSE OCCUPIED CONDITIONAL 34. Click on Update Conditional. 35. Click on New Conditional and add a conditional Turnout Reverse Unoccupied. Tutorial Part 2 Page 48 of 59 Revision 1.1
36. Add the variables and action items as we did before, only with the turnout thrown. Your complete conditional should look like FIG 96. FIG 96 TURNOUT REVERSE UNOCCUPIED CONDITIONAL 37. Click on Update Conditional 38. Click Done 39. Click Okay when reminded to save your Logix. Test the new conditionals. Turn off Block 802. The Interlocking should go dark in 10 seconds. Change the turnout to the reverse position. Turn on Block 802. The Interlocking should stay dark as the turnout is against it. Turn off Block 802 and turn on Block 803. The interlocking should follow based on the turnout setting. Tutorial Part 2 Page 49 of 59 Revision 1.1
Now edit the Logix IX03 for the turnout lever 3. Add that sensor IS901 must be inactive in order to throw the turnout. The revised conditional should look like FIG 97. FIG 97 TURNOUT CONDITIONAL WITH NEW INTERLOCKING SENSOR Be sure to uncheck the trigger for the new sensor. We only want the code button to trigger the turnout action. Tutorial Part 2 Page 50 of 59 Revision 1.1
Also add the sensor IS901 to the reverse action of the turnout Logix as shown in FIG 98. FIG 98 TURNOUT CONDITIONAL WITH NEW INTERLOCKING SENSOR There is a lot of work to now add the remainder of the interlocking Logix and Turnout lever Logix. You may also want to right click the block sensors on the track diagram. Check the disable menu item so they cannot be changed manually using the mouse. Likewise, disable the turnout lamps. Before we finish part 2 of the tutorial, we want to add block detection to the layout panel. Now is a good time to save your panel. Tutorial Part 2 Page 51 of 59 Revision 1.1
Adding Block Detection to the Layout Panel Now that we have block detection working on the CTC panel, let s go back to the Layout panel and add block detection there too. 1. On the layout editor, click the menu item Options and click on Edit Mode. 2. Right click on the straight track segment at the top, corresponding to the first block on the CTC panel. Select Edit as shown in FIG 99. FIG 99 EDIT A LAYOUT PANEL BLOCK Tutorial Part 2 Page 52 of 59 Revision 1.1
3. Enter the Block Name Block 801 and click the button to Create/Edit Block as shown in FIG 100. FIG 100 CREATE A BLOCK 4. Enter Sensor IS801 and change the Occupied Track Color to Red as shown in FIG 101. FIG 101 CHANGE BLOCK OCCUPIED TO RED 5. Click Done on both frames. 6. Turn on the Block detector NS801 on the CTC panel and the block should change to red. Turn off the detector and the block should go back to black after 5 seconds. Tutorial Part 2 Page 53 of 59 Revision 1.1
7. Do the same thing for the Block 802 circular segments on the left side of the layout. 8. Enter Block 802 name, IS802 sensor and change to red when Occupied. When entering the second segment with the same Block 802 name, you need not create it again. 9. Do the same for the straight segments at the bottom using Block 804 and IS804. 10. Also Edit the turnout IT5, as shown in FIG 102. FIG 102 EDITING A TURNOUT BLOCK 11. Edit the block at right for Block 805 and IS805. 12. The three siding segments to the right are IS806. Make them Orange when occupied. 13. The siding on the left is IS803. Make it Orange also. 14. Now select the upper left turnout and change NT1 to Block 901 and IS901. 15. Do the same for lower left NT2, Block 902, IS902 and red when occupied. 16. Complete setting blocks for NT3 and NT4. 17. Turn the Edit Mode off. Edit the panel size and position. 18. Click menu Options, Save Size and Position. Tutorial Part 2 Page 54 of 59 Revision 1.1
19. Your finished panel should look like FIG 103. FIG 103 COMPLETED PANELS FOR PART 2 The above panels show all turnouts in the normal or closed position. Blocks 801 and 802 are occupied so the Interlocking for Turnout NT1, IS901 is also active. Make sure all of your Logix are in place and working. You have a fully functioning set of panels with control of your turnouts and indication of all block detection. I operated for three or four years at this stage on my Quaker Valley Railroad. In Part 3, we will learn to create signals on the Layout panel and to create Simple Signal Logic (SSL) to relate the turnouts and signals and block detectors. We will then add signal lamps and signal levers to the CTC panel and learn how and to create Logix to automatically drop and hold the signals based on the CTC levers and track occupancy. Then signals will only be released under dispatcher control. Save your Panel! Tutorial Part 2 Page 55 of 59 Revision 1.1
Panel Startup Route When you open your panels, the sensors and turnouts may be in an unknown state. Some hardware will report back and you need not include them in a startup route. Since we are all simulated, we will create the route to set the turnouts, levers and code buttons. 1. From the main panel, select Tools, Tables, Sensors and add a new internal sensor 999 named RESET. 2. From the main panel, select Tools, Tables, Routes and you will get a blank frame as shown in FIG 104. FIG 104 ROUTE TABLE 3. Click the Add button. 4. On the Add/Edit Route frame, enter the Route name R999, the user name Reset Panel at Startup and select all of the turnouts closed. 5. We only need set some sensors, the Logix will set the rest. Set the Turnout Levers and Code Buttons inactive. Set the Block detectors NS801 NS806 inactive. Enter RESET or IS999 for the Sensor to trigger the route. 6. Enter RESET or IS999 for the Sensor to trigger the route. Tutorial Part 2 Page 56 of 59 Revision 1.1
7. Your frame should look like FIG 105. FIG 105 COMPLETE RESET ROUTE 8. Click the Update Route button and close the Route frame, hitting Okay when you are reminded to save your routes. 9. Add a sensor RESET to your CTC panel and move it to the upper right corner above the track diagram. 10. Right click on the new sensor and make it momentary. 11. Add text to identify the Reset Button you just added. Try out the reset sensor. Enjoy your panels. Now is a really good time to save your panel. Tutorial Part 2 Page 57 of 59 Revision 1.1
CTC Panel Components To help a novice understand the parts of a CTC panel, I include FIG 109. To better understand how these panels work, I highly recommend a DVD video available from http://www.ctcparts.com/video.htm This video shows the development of signaling on the prototype, the history of CTC panels on the prototype and how to use them with a model railroad. FIG 106 CTC PANEL COMPONENTS Tutorial Part 2 Page 58 of 59 Revision 1.1
Tutorial Part 2 Conclusion Now you have a foundation to further explore JMRI on your own. As stated up front, there are a number of different ways to accomplish each of these tasks. For example, we did not use the Routes table until the end. But Routes and Logix can be used in similar ways. Part 3 of the Panel Tutorial will show you how to add signals to the Layout Panel and how to add signal levers and Logix to hold the signals under dispatcher control. I have more information on CTC panels and the development of my panels at my web site: http://www.quaker-valley.com/ctc/jmri_demo_xml.html http://www.quaker-valley.com/ctc/ctc_index.html And my newest panels are at http://www.quaker-valley.com/ctc/qv_ctcnew.html And the JMRI yahoo group is always available at http://groups.yahoo.com/group/jmriusers/ Special thanks to Dan Foltz for improving the format of the tutorial. If you have a question for me, contact me via email at bob@quaker-valley.com Bob Bucklew Quaker Valley Railroad Tutorial Part 2 Page 59 of 59 Revision 1.1