Keyboard Shortcuts
ctrl + shift + ? :
Show all keyboard shortcuts
ctrl + g :
Navigate to a group
ctrl + shift + f :
Find
ctrl + / :
Quick actions
esc to dismiss
Likes
Search
Causes for conditionalNGs to not run when expressions are TRUE
#logixng
On occasion I find cNGs that run properly if I manually execute them but won't run on their own.?? The following fragment is an example of a cNG that has two branches, neither will start running despite having their expressions evaluating as true.? I can click the Execute button on the cNG table where this lives and run each branch.? In other cNG's this has happened I've included a (5Hz) clock pulse in the expression to "kick" them into action, which also works here, but that seems sloppy.? I'd like to know what the cause is and how to properly run without that workaround... unless that's necessary.???
?
? ?ConditionalNG: Control Status Array - Active processing ::: Startup
? ? ? ? ! A ? ? ? ? ? ? Many ? ? ? ? ? ? ? ? ! A1 ? ? ? ? ? ? ? ? ? ? // Fire the Control array processing under proper conditions ? ? ? ? ? ? ? ? ? ? If Then Else. Always execute ? ? ? ? ? ? ? ? ? ? ? ? ? If ? ? ? ? ? ? ? ? ? ? ? ? ? ? Digital Formula: E1 && E2 && E3 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Digital Formula: CtrlStatArray[CtrlPointer] == "ACTIVE" ::: No Listen ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E2 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Sensor sysTCSmode is Active ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E3 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Sensor sysTCSRUNmode is Active ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E4 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? ? ? ? ? ? ? ! Then ? ? ? ? ? ? ? ? ? ? ? ? ? ? // branch on status of audio source playing ? ? ? ? ? ? ? ? ? ? ? ? ? ? If Then Else. Always execute ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? If ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Digital Formula: E1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Digital Formula: CtrlAudioStatusArray[CtrlPointer] != "PLAY" ::: No Listen ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E2 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ! Then ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Many ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ! A1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Audio: Play by table TCS Panel Table, row by local variable "CtrlPointer", column Ctrl Audio ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ! A2 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Digital Formula: CtrlAudioStatusArray[CtrlPointer] = "PLAY" ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ! A3 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Set sensor Pnl-CCKE to state Active ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ! A4 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Else_If_1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Digital Formula: E1 && E2 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Digital Formula: CtrlAudioStatusArray[CtrlPointer] == "PLAY" ::: No Listen ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E2 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Audio by table TCS Panel Table, row by local variable "CtrlPointer", column Ctrl Audio is Stopped ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E3 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ! Then_1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Many ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ! A1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Digital Formula: CtrlAudioStatusArray[CtrlPointer] = "OFF" ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ?
?
--
Jim Moomaw Portland, OR - Willamette Model Railroad Club (WMRC) - NMRA, Pacific NW |
Jim, You need to think about "why" the conditional should run. ?What event is needed? Your direct events are?sysTCSmode and?sysTCSRUNmode. ? Indirect references use "Listen on Beans" to trigger the conditional. ?See the Listen on Beans section at?. ?The "Listen on beans - Table" is handy for gettin a list of "beans" from a table. ?Note: Beans include things like sensor, turnouts, etc. ?However, Audio objects are not included. An alternate approach is to make this a Module which is called as need by a LogixNG. Dave Sand ----- Original message ----- From: "Jim Moomaw - PDX via groups.io" <JMOOMAW_COM=[email protected]> Subject: [jmriusers] Causes for conditionalNGs to not run when expressions are TRUE Date: Saturday, February 22, 2025 5:32 AM On occasion I find cNGs that run properly if I manually execute them but won't run on their own.?? The following fragment is an example of a cNG that has two branches, neither will start running despite having their expressions evaluating as true.? I can click the Execute button on the cNG table where this lives and run each branch.? In other cNG's this has happened I've included a (5Hz) clock pulse in the expression to "kick" them into action, which also works here, but that seems sloppy.? I'd like to know what the cause is and how to properly run without that workaround... unless that's necessary.??? ? ? ?ConditionalNG: Control Status Array - Active processing ::: Startup ? ? ? ? ! A ? ? ? ? ? ? Many ? ? ? ? ? ? ? ? ! A1 ? ? ? ? ? ? ? ? ? ? // Fire the Control array processing under proper conditions ? ? ? ? ? ? ? ? ? ? If Then Else. Always execute ? ? ? ? ? ? ? ? ? ? ? ? ? If ? ? ? ? ? ? ? ? ? ? ? ? ? ? Digital Formula: E1 && E2 && E3 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Digital Formula: CtrlStatArray[CtrlPointer] == "ACTIVE" ::: No Listen ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E2 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Sensor sysTCSmode is Active ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E3 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Sensor sysTCSRUNmode is Active ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E4 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? ? ? ? ? ? ? ! Then ? ? ? ? ? ? ? ? ? ? ? ? ? ? // branch on status of audio source playing ? ? ? ? ? ? ? ? ? ? ? ? ? ? If Then Else. Always execute ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? If ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Digital Formula: E1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Digital Formula: CtrlAudioStatusArray[CtrlPointer] != "PLAY" ::: No Listen ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E2 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ! Then ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Many ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ! A1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Audio: Play by table TCS Panel Table, row by local variable "CtrlPointer", column Ctrl Audio ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ! A2 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Digital Formula: CtrlAudioStatusArray[CtrlPointer] = "PLAY" ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ! A3 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Set sensor Pnl-CCKE to state Active ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ! A4 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Else_If_1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Digital Formula: E1 && E2 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Digital Formula: CtrlAudioStatusArray[CtrlPointer] == "PLAY" ::: No Listen ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E2 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Audio by table TCS Panel Table, row by local variable "CtrlPointer", column Ctrl Audio is Stopped ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E3 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ! Then_1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Many ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ! A1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Digital Formula: CtrlAudioStatusArray[CtrlPointer] = "OFF" ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? -- Jim Moomaw Portland, OR - Willamette Model Railroad Club (WMRC) - NMRA, Pacific NW |
开云体育Dave and Jim, Should Audio be included in "Listen On Beans" and "Listen on beans - Table"? It should be easy to add. Daniel On 2025-02-22 16:52, Dave Sand wrote:
|
Daniel, That would be good. ?I also noticed the "Occupancy Blocks" is not in "For each" list. Dave Sand ----- Original message ----- From: danielb987 <jmri@...> Subject: Re: [jmriusers] Causes for conditionalNGs to not run when expressions are TRUE Date: Saturday, February 22, 2025 10:00 AM Dave and Jim, Should Audio be included in "Listen On Beans" and "Listen on
beans - Table"? It should be easy to add. Daniel On 2025-02-22 16:52, Dave Sand wrote:
|
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 |
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 |
开云体育Dave, See PR #13884. CI passes but I haven't had time to actually test these changes. Daniel On 2025-02-22 17:57, Dave Sand wrote:
|
RE: ?CtrlStatArray --? Ha... no, ACTIVE is a literal string.? Those array cells can have QUIET, PEND, ACTIVE, END, null.? Only one at a time can be ACTIVE (created from the left-most PEND at the moment and then set QUIET when done);? the others can essentially be anything else in multiple (other than END at the end).?
?
I took my best shot at Listen on Beans (at the top of the cNG), such that it runs without errors but doesn't work in causing the true expressions to fire, and does throw a warning:
"ions.ActionListenOnBeansLocalVariable WARN ?- The named bean "[QUIET, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ACTIVE, , , , END, END]" cannot be found in the manager for LogixNG global variable [JMRI LogixNGThread]
I tried providing an index to the CtrlStatArray array but only got error messages doing so.? So far, my beans test hasn't' worked.?
?
HOWEVER, based on your example I realized I can always create an internal Sensor flag that follows the setting of ACTIVE in any cell, and use that as a working trigger at least for the first IF branch, but then I also need a direct trigger to get to the second branch.? I'd still like a way to trigger on the actual end of an audio source being played vs. repetitively checking.? I guess I can take a similar approach and put the table audio source string into an object that is direct and play that vs. the indirect reference to the table cell.?? I think I understand why the cNG isn't firing, so that's progress... I know what I need to do.?
?
?
?
Bean Test that failed:
?ConditionalNG: Control Status Array - Active processing ::: Startup
? ? ? ? ! A ? ? ? ? ? ? Many ? ? ? ? ? ? ? ? ! A3 ? ? ? ? ? ? ? ? ? ? Many ? ? ? ? ? ? ? ? ? ? ? ? ! A1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? Listen to each LogixNG global variable in each row of column "Ctrl Audio" in table "TCS Panel Table" ? ? ? ? ? ? ? ? ? ? ? ? ! A2 ? ? ? ? ? ? ? ? ? ? ? ? ? ? Listen on the bean in the local variable "CtrlStatArray" of type LogixNG global variable ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ! Execute ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? ? ? ? ? ? ? ! A3 ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? ? ? ! A1 ? ? ? ? ? ? ? ? ? ? // Fire the Control array processing under proper conditions ? ? ? ? ? ? ? ? ? ? If Then Else. Execute on change? [note:? or Always] ? ? ? ? ? ? ? ? ? ? ? ? ? If ? ? ? ? ? ? ? ? ? ? ? ? ? ? Digital Formula: E1 && E2 && E3 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Digital Formula: CtrlStatArray[CtrlPointer] == "ACTIVE" ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E2 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Sensor sysTCSmode is Active ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E3 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Sensor sysTCSRUNmode is Active ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E4 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Memory Trigger-Bit is less than or equal "0" ::: Disabled ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E5 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? ? ? ? ? ? ? ! Then ? ? ? ? ? ? ? ? ? ? ? ? ? ? // branch on status of audio source playing ? ? ? ? ? ? ? ? ? ? ? ? ? ? If Then Else. Always execute ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? If ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Digital Formula: E1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Digital Formula: CtrlAudioStatusArray[CtrlPointer] != "PLAY" ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E2 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ! Then ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Many ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ! A1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Audio: Play by table TCS Panel Table, row by local variable "CtrlPointer", column Ctrl Audio ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ! A2 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Digital Formula: CtrlAudioStatusArray[CtrlPointer] = "PLAY" ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ! A3 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Set sensor Pnl-CCKE to state Active ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ! A4 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Else_If_1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Digital Formula: E1 && E2 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Digital Formula: CtrlAudioStatusArray[CtrlPointer] == "PLAY" ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E2 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Audio by table TCS Panel Table, row by local variable "CtrlPointer", column Ctrl Audio is Stopped ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E3 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ! Then_1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Many ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ! A1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Digital Formula: CtrlAudioStatusArray[CtrlPointer] = "OFF" ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ! A2 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Digital Formula: CtrlStatArray[CtrlPointer] = "QUIET" ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? --
Jim Moomaw Portland, OR - Willamette Model Railroad Club (WMRC) - NMRA, Pacific NW |
Jim, It is obvious that I have no idea what data is involved and what you are trying to do. ?I keep trying to map it to a typical CSV table that uses various JMRI "beans". ?Something like the following. 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 7:30 PM RE: ?CtrlStatArray --? Ha... no, ACTIVE is a literal string.? Those array cells can have QUIET, PEND, ACTIVE, END, null.? Only one at a time can be ACTIVE (created from the left-most PEND at the moment and then set QUIET when done);? the others can essentially be anything else in multiple (other than END at the end).? ? I took my best shot at Listen on Beans (at the top of the cNG), such that it runs without errors but doesn't work in causing the true expressions to fire, and does throw a warning: "ions.ActionListenOnBeansLocalVariable WARN ?- The named bean "[QUIET, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ACTIVE, , , , END, END]" cannot be found in the manager for LogixNG global variable [JMRI LogixNGThread] I tried providing an index to the CtrlStatArray array but only got error messages doing so.? So far, my beans test hasn't' worked.? ? HOWEVER, based on your example I realized I can always create an internal Sensor flag that follows the setting of ACTIVE in any cell, and use that as a working trigger at least for the first IF branch, but then I also need a direct trigger to get to the second branch.? I'd still like a way to trigger on the actual end of an audio source being played vs. repetitively checking.? I guess I can take a similar approach and put the table audio source string into an object that is direct and play that vs. the indirect reference to the table cell.?? I think I understand why the cNG isn't firing, so that's progress... I know what I need to do.? ? ? ? Bean Test that failed: ?ConditionalNG: Control Status Array - Active processing ::: Startup ? ? ? ? ! A ? ? ? ? ? ? Many ? ? ? ? ? ? ? ? ! A3 ? ? ? ? ? ? ? ? ? ? Many ? ? ? ? ? ? ? ? ? ? ? ? ! A1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? Listen to each LogixNG global variable in each row of column "Ctrl Audio" in table "TCS Panel Table" ? ? ? ? ? ? ? ? ? ? ? ? ! A2 ? ? ? ? ? ? ? ? ? ? ? ? ? ? Listen on the bean in the local variable "CtrlStatArray" of type LogixNG global variable ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ! Execute ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? ? ? ? ? ? ? ! A3 ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? ? ? ! A1 ? ? ? ? ? ? ? ? ? ? // Fire the Control array processing under proper conditions ? ? ? ? ? ? ? ? ? ? If Then Else. Execute on change? [note:? or Always] ? ? ? ? ? ? ? ? ? ? ? ? ? If ? ? ? ? ? ? ? ? ? ? ? ? ? ? Digital Formula: E1 && E2 && E3 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Digital Formula: CtrlStatArray[CtrlPointer] == "ACTIVE" ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E2 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Sensor sysTCSmode is Active ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E3 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Sensor sysTCSRUNmode is Active ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E4 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Memory Trigger-Bit is less than or equal "0" ::: Disabled ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E5 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? ? ? ? ? ? ? ! Then ? ? ? ? ? ? ? ? ? ? ? ? ? ? // branch on status of audio source playing ? ? ? ? ? ? ? ? ? ? ? ? ? ? If Then Else. Always execute ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? If ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Digital Formula: E1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Digital Formula: CtrlAudioStatusArray[CtrlPointer] != "PLAY" ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E2 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ! Then ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Many ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ! A1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Audio: Play by table TCS Panel Table, row by local variable "CtrlPointer", column Ctrl Audio ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ! A2 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Digital Formula: CtrlAudioStatusArray[CtrlPointer] = "PLAY" ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ! A3 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Set sensor Pnl-CCKE to state Active ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ! A4 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Else_If_1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Digital Formula: E1 && E2 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Digital Formula: CtrlAudioStatusArray[CtrlPointer] == "PLAY" ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E2 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Audio by table TCS Panel Table, row by local variable "CtrlPointer", column Ctrl Audio is Stopped ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E3 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ! Then_1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Many ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ! A1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Digital Formula: CtrlAudioStatusArray[CtrlPointer] = "OFF" ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ! A2 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Digital Formula: CtrlStatArray[CtrlPointer] = "QUIET" ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?* E1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? -- Jim Moomaw Portland, OR - Willamette Model Railroad Club (WMRC) - NMRA, Pacific NW |
to navigate to use esc to dismiss