How to lock and unlock a Turnout using a TxCanTurn board and JMRI:
First you need a "sensor" in JMRI for every turnout you would like to lock. The system name for the "internal sensor" can be anything, IS01 or IS9009, not important. What matters is the "username", it has to start with "LCL", then the board's NodeNumber, like "1001" and then the turnout number on the board in 2 digits, like "01", so "LCL100104" is the 4th turnout on the board with number 1001.
This sensor will disallow the user at the board to press the button on it when the sensor you just created is ACTIVE. So on your display panel, use an icon, like a red lock, to indicate the ACTIVE or locked state. And then a green, unlocked icon for the INACTIVE or unlocked state.
Once you have all the LCL sensors in, or has finished all the changes to them, you need to run the "CANLocalControl_version.py" jython script (version=1.2 as of 2013.01.11) to attached listeners to each of the sensors so that, when you change its state, it can send the needed CAN messages on the bus.
Usually we add a "route" in the Route Table for this, so that you don't forget at start-up to deploy the Local Control part. Side note: Every board that has this local control implemented will have ALL its turnouts in the UNLOCK state on every power up...which allows you to change turnouts as soon as you turn the system on and do not have to wait for the computer and JMRI to launch to throw turnouts...so beware, a small power outage, and all your towns are unlocked again!
IS27 shown with LCL200703 username:
Green and Red Locks for the turnout:
JMRI Sensors Table showing the System Names and User Names:
Adding a sensor for Local Control (LCL), notice that JMRI will add the "IS" for the System Name, so you just type the number:
Showing the Route Table in JMRI and the "button" that will show up when the CANLocalControl script is run:
(note: When you need to change an LCL sensor, click on the button shown above to unload all the listeners, make your changes and then run the script (or route) again.)
Once you have an LCL sensor for each turnout, and you don't need to display them all on the Panel, you can create a route to group them into towns or other collections and when the route is run, it will lock every "sensor" selected in the route and one created to unlock them again will do the opposite. It is also easy to create a Logix that would activate or inactivate groups or LCL sensors, all triggered by another button, sensor or event.
Each rev 2 board also contains two sensors, MS+NN(in decimal)E06 and MS+NN(in decimal)E07, see image below on where to connect the sensors 06 and 07. Black wires connect the sensor's GND pin with GND on the board and the red wires goes to the sensor's other pin:
The rev 1 boards have the GND pin for each push button on the edge of the board: