Keyboard Shortcuts
Likes
Search
Locked
NCE Accessory Event Monitoring and possibly CS-105
#nce
Hi all,?
?
Background:
I have a mid-size n-scale layout (about 65 turnouts and 40 blocks) and am running NCE for most of it. NCE PH-Pro 5amp Command Station, 4x AIU01 & BD20 occupancy detectors, NCE Light-it for signals, SMails for turnouts, etc. I have started to move across to using JMRI mainly so I can manage and control the signal lights on the layout and to potentially use a few old iPads as monitors around the layout. My next project is to add switch panels to control the turnouts and while I could use iPads I also was thinking of making physical switch panels using some NCE Macro-Panels that I have.?
?
Issue:
One of the things that I notice, and someone correct me if there is another way to do this, is that if I throw a turnout using the NCE Throttle, it is not reported to JMRI as there is no event raised by the NCE command station that can be read from the serial port. That command is not issued as a DCC command and so is not reportable to JMRI so JMRI does not know the state of that turnout. So for it to work, you need to throw switches via JMRI so it knows the state. This makes using the Macro-Panel an issue as the state would not be reported. (as an aside, I did write some software (not in Java) that allows me to use a NCE Packet Analyzer to detect this and potentially send this to something like JMRI or to some other software I was developing but have subsequently put on the back-burner).?
?
Question:
So I was wondering if LCC might support this and wondered if anyone has used the TCS CS-105 as a replacement for an NCE system (maybe still using the NCE PH-PRO as a booster) and does the CS-105 provide any additional feedback via LCC that JMRI can use while still using the existing AIU01 and Macro-Panels via the CS-105 bus? Would switching to a CS-105 (if and when they are available in New Zealand) provide the ability to know if an accessory has been thrown via the NCE throttle or if a turnout has been thrown via a Macro-Panel.?
?
Thank in advance,?
Trevor
? |
On Tue, Sep 24, 2024 at 07:51 PM, <trevor@...> wrote:
Have you tried NCE turnout monitoring?
?
?
Dan
|
On Sat, Sep 28, 2024 at 06:07 PM, <trevor@...> wrote:
Just wanted to thank you @Dan - I didn't know that the PHPro reported turnout status and I switched all my points to "Monitoring" and it works a charm. Super excellent. Thank you.?You're welcome, it was the very first Java program I wrote for JMRI in 2007.? There's also the ability to lock a NCE turnout. ?
?
Dan |
Have PowerPro, 40 turnouts, Switch8 Mk2+Button Boards, and several AIU-01 Boards that I use for BD20 block occupancy sensing. I am running JMRI Panel Pro on Windows 11 and have good success with Simple Signaling Logic.
?
I have selected Monitored for all my turnouts, but I still do not get an automated update of turnout position on the Main Panel after NCE Switch8 Mk2 / Button Board action changes the turnout position. I did notice that upon restarting, PanelPro now does seem to know the positions of all turnouts. Before, I had to run a script to set all the turnouts and get Panel Pro Main Panel updated.? |
开云体育Eric, ? Are the AIU conveying status of just the blocks or are they also monitoring the positions of the turnouts? ? By default turnout status is returned to JMRI from the command station which remembers the last turnout commands seen by it. Sensors in JMRI are updated by it reading memory in the command station which polls the AIU boards while it is talking with all the other cabs. ? But the problem is the button boards talk directly to the Switch8 board and nothing goes on the cab bus to let others know about it. If you don’t have the AIU monitoring the status of the turnouts, that can get out of sync. ? Make sure you have reviewed the NCE page at for some of the other details. ? -Ken Cameron, Member JMRI Dev Team
? ? |
Currently I am using the AIU to monitor the status of BD20s. I have not used the AIU to monitor turnout position. To monitor turnout position with the AIU, am I correct in understanding that I would need to run an additional circuit from an AIU port to the contacts on the Tortoise Switch machine (that would close when the turnout is in a closed position) and back to the ground connection on the AIU. The AIU port would light up if the switch was closed. Then edit the Turnout table to assign that AIU port address as Sensor 1? |
开云体育Eric, ? Yes, that’s the usual way. Tortoise motors are nice, you have one set of contacts to power the frog and one for feedback. Set that sensor as ONESENSOR in the turnout table and it will follow fine. It won’t matter if JMRI, a throttle, or a button tells a turnout to move. ? -Ken Cameron, Member JMRI Dev Team
? ? |
Also I was attempting to draft a script that would ping each turnout in JMRI and return its current state. I note that the first time I touch the turnout icon in Panel Pro Main Panel, the turnout will first change color to its actual state. If I touch a second time it will physically change its state. Therefore, I was looking for a way to poll each turnout (without changing its position) and update Panel Pro Main Panel accordingly.
?
In Visual Studio Code with Copilot (ChatGPT) tried this code but I did not work. UpdateTurnoutState function was supposed to read state and then set turnout to that state without changing it - simulating what happens when you touch the screen once and it updates.
?
class setStartup(jmri.jmrit.automat.AbstractAutomaton) :
? ? def init(self): ? ? ? ? self.turnouts = jmri.InstanceManager.getDefault(jmri.TurnoutManager) ? ? ? ? return ? ?? ? ? def handle(self): ? ? ? ? self.waitMsec(500) ? ? ? ? self.updateTurnoutState("1001") ? ? ? ? self.waitMsec(500)
? ? ? ? self.updateTurnoutState("1002") # repeat for as many turnouts
?
? ? ?def updateTurnoutState(self, turnoutId):
? ? ? ? turnout = self.turnouts.provideTurnout(turnoutId) ? ? ? ? currentState = turnout.getState() ? ? ? ? turnout.setState(currentState) ?
? |
Your script does not do anything. ?It is getting and setting the JMRI turnout state which does not change anything. It appears that your goal is to get the "layout" turnout state and set the JMRI turnout state to that value. ?The ability to that depends on the layout hardware including the command station, switch machines, turnout feedback, etc. The easiest and most reliable approach is for JMRI to initialize the turnouts to a known state. Dave Sand ----- Original message ----- From: "Eric Troup via groups.io" <etroup=[email protected]> Subject: Re: [jmriusers] NCE Accessory Event Monitoring and possibly CS-105 Date: Wednesday, January 08, 2025 9:10 AM Also I was attempting to draft a script that would ping each turnout in JMRI and return its current state. I note that the first time I touch the turnout icon in Panel Pro Main Panel, the turnout will first change color to its actual state. If I touch a second time it will physically change its state. Therefore, I was looking for a way to poll each turnout (without changing its position) and update Panel Pro Main Panel accordingly. ? In Visual Studio Code with Copilot (ChatGPT) tried this code but I did not work. UpdateTurnoutState function was supposed to read state and then set turnout to that state without changing it - simulating what happens when you touch the screen once and it updates. ? class setStartup(jmri.jmrit.automat.AbstractAutomaton) : ? ? def init(self): ? ? ? ? self.turnouts = jmri.InstanceManager.getDefault(jmri.TurnoutManager) ? ? ? ? return ? ?? ? ? def handle(self): ? ? ? ? self.waitMsec(500) ? ? ? ? self.updateTurnoutState("1001") ? ? ? ? self.waitMsec(500) ? ? ? ? self.updateTurnoutState("1002") # repeat for as many turnouts ? ? ? ?def updateTurnoutState(self, turnoutId): ? ? ? ? turnout = self.turnouts.provideTurnout(turnoutId) ? ? ? ? currentState = turnout.getState() ? ? ? ? turnout.setState(currentState) ? ? |
Well, the script was supposed to do nothing. I wanted to simulate pushing the turnout icon once on the Panel Pro Main Panel. Something happens that reports the physical state and updates the Main Panel if they are out of synch. It takes a second touch on the icon to change the turnout position. I just have not figured out what that first step is yet nor how to access that programmatically.
?
The main panel display is on iPads accessing the Panel Pro Web Server. That works well.
?
However, I wanted to supplement that with physical buttons located at the edge that can also change turnouts without going to the Main Panel. Below is an example of one such button that changes a crossover.
?
It would be very nice if activation of the local button would update the Panel Pro Main Panel.
?
The major reason I stopped building elaborate panels is to reduce physical wiring and make things more software driven. However, individual button controls like this are very nice to have especially in support of local operations. Adding another circuit to incorporate a sensor is another added piece of wiring infrastructure to install and maintain. |
开云体育Eric, Monitoring mode would like it track all the commands (via the cab bus) to the turnouts. Like anything commanded by the throttles would be seen. But things like direct movement of the turnout would not be seen. The buttons to the Switch8 do not interface with the cab bus so the monitoring method would not know what they did. ? -Ken Cameron, Member JMRI Dev Team
? ? |
开云体育Eric, ? The other option would be having the buttons drive the AIU. Then JMRI would watch that and drive the turnouts. That would mean the turnouts only move in response to turnout commands known to the command station and JMRI. But then JMRI becomes a critical part of the operation of the turnouts. Generally that’s not an acceptable choice. ? But if you want to protect movement of the turnouts based on occupancy, namely prevent movement if a train is on that block, then involving JMRI for that decision path might make sense. ? -Ken Cameron, Member JMRI Dev Team
? ? |
Eric, After starting PanelPro and loading the layout xml data file, go to the turnout table. ?What is the current state for the turnouts? Now do one click and see if anything changed in the turnout table. Dave Sand ----- Original message ----- From: "Eric Troup via groups.io" <etroup=[email protected]> Subject: Re: [jmriusers] NCE Accessory Event Monitoring and possibly CS-105 Date: Wednesday, January 08, 2025 10:07 AM Well, the script was supposed to do nothing. I wanted to simulate pushing the turnout icon once on the Panel Pro Main Panel. Something happens that reports the physical state and updates the Main Panel if they are out of synch. It takes a second touch on the icon to change the turnout position. I just have not figured out what that first step is yet nor how to access that programmatically. ? The main panel display is on iPads accessing the Panel Pro Web Server. That works well. ? However, I wanted to supplement that with physical buttons located at the edge that can also change turnouts without going to the Main Panel. Below is an example of one such button that changes a crossover. ? It would be very nice if activation of the local button would update the Panel Pro Main Panel. ? The major reason I stopped building elaborate panels is to reduce physical wiring and make things more software driven. However, individual button controls like this are very nice to have especially in support of local operations. Adding another circuit to incorporate a sensor is another added piece of wiring infrastructure to install and maintain. |
Dave,
That is exactly what I was talking about. When you do that click on the turnout, either on the Main Panel graphic or the Turnout Table, JMRI first queries the physical turnout. If the physical turnout state is different than the digital twin in JMRI, JMRI updates the digital twin's state in Panel Pro to reflect reality. If you click a second time, a command is issued to change the state and then Panel Pro updates to reflect the new state. ?
I wanted to know if that functionality is, or could be, exposed somewhere as a function that could be called by a program.? If so, one could periodically run a polling program and update the panel for anything that got changes locally. Since most turnouts are not being actually changed, the power / bandwidth used should be minimal. |
Eric, How do you know that it queries the physical turnout. ?Do you see a turnout message in the NCE Monitor? Dave Sand ----- Original message ----- From: "Eric Troup via groups.io" <etroup=[email protected]> Subject: Re: [jmriusers] NCE Accessory Event Monitoring and possibly CS-105 Date: Wednesday, January 08, 2025 11:10 PM Dave, That is exactly what I was talking about. When you do that click on the turnout, either on the Main Panel graphic or the Turnout Table, JMRI first queries the physical turnout. If the physical turnout state is different than the digital twin in JMRI, JMRI updates the digital twin's state in Panel Pro to reflect reality. If you click a second time, a command is issued to change the state and then Panel Pro updates to reflect the new state. ? I wanted to know if that functionality is, or could be, exposed somewhere as a function that could be called by a program.? If so, one could periodically run a polling program and update the panel for anything that got changes locally. Since most turnouts are not being actually changed, the power / bandwidth used should be minimal. |
Eric, You did not answer my question about the initial turnout states after starting PanelPro and loading the xml file. There is another step. ?Before starting PanelPro, start the NCE command station from a power off. ?After the command station is running, turn on track power. ?Now start PanelPro and load the xml file. ?Before doing anything else, what are the turnout table states? Dave Sand ----- Original message ----- From: Dave Sand <ds@...> Subject: Re: [jmriusers] NCE Accessory Event Monitoring and possibly CS-105 Date: Wednesday, January 08, 2025 11:14 PM Eric, How do you know that it queries the physical turnout. ?Do you see a turnout message in the NCE Monitor? Dave Sand ----- Original message ----- From: "Eric Troup via groups.io" <etroup=[email protected]> Subject: Re: [jmriusers] NCE Accessory Event Monitoring and possibly CS-105 Date: Wednesday, January 08, 2025 11:10 PM Dave, That is exactly what I was talking about. When you do that click on the turnout, either on the Main Panel graphic or the Turnout Table, JMRI first queries the physical turnout. If the physical turnout state is different than the digital twin in JMRI, JMRI updates the digital twin's state in Panel Pro to reflect reality. If you click a second time, a command is issued to change the state and then Panel Pro updates to reflect the new state. ? I wanted to know if that functionality is, or could be, exposed somewhere as a function that could be called by a program.? If so, one could periodically run a polling program and update the panel for anything that got changes locally. Since most turnouts are not being actually changed, the power / bandwidth used should be minimal. |
Dave,
?
Setting the conditions of the test as you state if:
1. turnouts configured in Monitoring or One Sensor Mode, the state in the turnout xml table tends to match the physical state - or at least matches the state when system was turned off.
2. turnouts configured in Direct Mode tend to show up as Thrown regardless of their true physical state. Clicking on the turnout icon changes the state to the actual state. Clicking a second time changes the state.?
?
I made a video of the test under condition two but this system says the file is too big to send as an attachment. |