Jim, What is contained in "CtrlStatArray[CtrlPointer]"? ?Since you are testing for ACTIVE, that implies a sensor. ?The "CtrlPointer" index implies an array of sensors. ?If so, you can put the actual sensors in a "Listen on beans" action. ?Whenever one changes state, the ConditionalNG will run. ? Here is an example.
The "Listen on beans" has three sensors. ?When one of them becomes active, the user name is copied to the "gChestnut" global variable. Note: ?The three sensors are also in a "Sensor Group". ?When one becomes active, the others are inactive. ?Technically, all of them are set Inactive with one being set Active as the last event. Dave Sand ----- Original message ----- From: "Jim Moomaw - PDX via groups.io" <JMOOMAW_COM=[email protected]> Subject: Re: [jmriusers] Causes for conditionalNGs to not run when expressions are TRUE Date: Saturday, February 22, 2025 1:37 PM I think there are things I don't understand about what causes expressions to fire (or not).? In this case, events sysTCSmode and sysTCSRUNmode are essentially static... they get turned on at the start of an ops session and stay on all day.? The first term array-cell=ACTIVE is what toggles in real-time, and is essentially the trigger.? Putting the kicker-clock in the first expression group with these fixes the problem; the following two IF clauses fire properly, but its probably a workaround to the non-triggering events that follow.? ? Dave, you mentioned "direct events are sysTCSmode and sysTCSRUNmode", which implies array-cell=ACTIVE is not.? Since that's the real trigger I should focus on that with beans.? Further, the audio trigger "end of play" is an important so that's another focus point.? My career programming predated objects, so "beans" fall into the mystery class of JMRI things. ? Funny, this little "sound & lights" feature I'm trying to add to a CTC panel that's otherwise functional in controlling the layout is really pushing me to learn most of the "odd" JMRI features I'd been avoiding.?? Modules and beans are two more on that list, which is getting shorter.? If DaveS wasn't helping me when I get stuck this would be about impossible.? But he does, so I'm getting there.? JMRI is a funny beast... it can do essentially anything but learning its tricks is a challenge for a legacy programmer.? -- Jim Moomaw Portland, OR - Willamette Model Railroad Club (WMRC) - NMRA, Pacific NW |