Keyboard Shortcuts
Likes
Search
Locked
NX Entry/Exit pairs used in LogixNG do not get put back into logixNG when restarting and reloading the panel.
#logixng
#entryexit
I don't know if this is a bug or if I am doing something wrong.? I have a logixNG that uses an NX Entry/Exit pair in some of the logixNG for example:
I have: ? ? ? ? ! A? If Then Else, Always execute ? ? ? ? ? ? ? if Entry/exit "NXW (E4) to NXE (W4)" is active ? ? ? ? ? ? ?!? Then ... When I debug this logixNG conditional I can see the result is true or false depending on the state of the pair. If I Store all table content and panels I can look in the .xml file and see the logixNG conditional as: ?
? ?
? ? ? IQDE:AUTO:0001
? ? ?
? ? ? ? Direct
? ? ? ? NXW (E4) to NXE (W4)
? ? ? ? no
? ? ?
? ? ? Is
? ? ? Direct
? ? ? Inactive
? ? ?
? ? ?
? ? ?
? ? ?
? ? ? ?
? ? ? ?
? ? ? ? ? Default
? ? ? ?
? ? ?
? ?
When PanelPro is restarted and the panel is reloaded from the File menu The Tools -> Enry/Exit shows the pairs just as they were before saving and restarting PanelPro however, the LogixNG never evaluates the conditional as true because the conditional has been changed. If I look at the LogixNG with the editor tool the LogixNG conditional now appears as: I have: ? if Entry/exit " " is active Is this behavior expected? I have a panel made with all Internal sensors and virtual signals to demonstrate. The panel also references a script called?InitSensors.py I have placed the files in a Google Drive directory called JMRI?? Should this be put as an Issue on GITHub? My goal in all of this was to make some logic that would detect an approaching train and then clear a route through an interlocking if available. But maybe there is another way to accomplish this? I can re-ask this question with a different subject line if needed. Regards, John Figie ? |
John, What version of JMRI are you running? ?You need to be running at least test version 5.3.2. Dave Sand ----- Original message ----- From: John Figie <zephyr9900@...> Subject: [jmriusers] NX Entry/Exit pairs used in LogixNG do not get put back into logixNG when restarting and reloading the panel. #logixng #entryexit Date: Tuesday, May 02, 2023 10:12 PM I don't know if this is a bug or if I am doing something wrong.? I have a logixNG that uses an NX Entry/Exit pair in some of the logixNG for example: I have: ? ? ? ? ! A? If Then Else, Always execute ? ? ? ? ? ? ? if Entry/exit "NXW (E4) to NXE (W4)" is active ? ? ? ? ? ? ?!? Then ... When I debug this logixNG conditional I can see the result is true or false depending on the state of the pair. If I Store all table content and panels I can look in the .xml file and see the logixNG conditional as: ? ? ? ? ? ? IQDE:AUTO:0001 ? ? ? ? ? ? ? Direct ? ? ? ? NXW (E4) to NXE (W4) ? ? ? ? no ? ? ? ? ? ? Is ? ? ? Direct ? ? ? Inactive ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Default ? ? ? ? ? ? ? ? ? When PanelPro is restarted and the panel is reloaded from the File menu The Tools -> Enry/Exit shows the pairs just as they were before saving and restarting PanelPro however, the LogixNG never evaluates the conditional as true because the conditional has been changed. If I look at the LogixNG with the editor tool the LogixNG conditional now appears as: I have: ? if Entry/exit " " is active Is this behavior expected? I have a panel made with all Internal sensors and virtual signals to demonstrate. The panel also references a script called?InitSensors.py I have placed the files in a Google Drive directory called JMRI?? Should this be put as an Issue on GITHub? My goal in all of this was to make some logic that would detect an approaching train and then clear a route through an interlocking if available. But maybe there is another way to accomplish this? I can re-ask this question with a different subject line if needed. Regards, John Figie ? |
Thank you for the solution to my issue described above.
OK I have updated to version 5.3.5 and the issue has gone away. Now I want to set a pair active using the following logixNG I have: ? ? ? ? ! A? If Then Else, Always execute ? ? ? ? ? ? ? if Entry/exit "NXW (E4) to NXE (W4)" is active ? ? ? ? ? ? ?!? Then Many ? ? ? ? ? ? ? ? ?! A2 Set Entry/Exit "NWX (E4) to NXE (W4) to Set NX pair Segment Active / Inactive ? ? ? ? ? ? ? ? ?! A3 Return ? ? ? ? ? ? ?! Else Return Using the debugger I can see that the If condition is satisfied and returns "True" but the A2 action does not set the NX pair from Inactive to Active. Any suggestions? Regards, John |
John, A2 is toggling the state of the NX. ?Since it is active based on the if, the new state will be inactive. The Return statements are not needed, return is automatic. Dave Sand ----- Original message ----- From: John Figie <zephyr9900@...> Subject: Re: [jmriusers] NX Entry/Exit pairs used in LogixNG do not get put back into logixNG when restarting and reloading the panel. #logixng #entryexit Date: Wednesday, May 03, 2023 8:42 AM Thank you for the solution to my issue described above. OK I have updated to version 5.3.5 and the issue has gone away. Now I want to set a pair active using the following logixNG I have: ? ? ? ? ! A? If Then Else, Always execute ? ? ? ? ? ? ? if Entry/exit "NXW (E4) to NXE (W4)" is active ? ? ? ? ? ? ?!? Then Many ? ? ? ? ? ? ? ? ?! A2 Set Entry/Exit "NWX (E4) to NXE (W4) to Set NX pair Segment Active / Inactive ? ? ? ? ? ? ? ? ?! A3 Return ? ? ? ? ? ? ?! Else Return Using the debugger I can see that the If condition is satisfied and returns "True" but the A2 action does not set the NX pair from Inactive to Active. Any suggestions? Regards, John |
Dave,
Thanks again for your reply. Yes you are correct according to what I posted except I made a mistake in the post - sorry about that, what I really had and still have is this: ? ? ? ? ! A? If Then Else, Always execute ? ? ? ? ? ? ? if Entry/exit "NXW (E4) to NXE (W4)" is inactive ? ? ? ? ? ? ?!? Then Many ? ? ? ? ? ? ? ? ?! A2 Set Entry/Exit "NWX (E4) to NXE (W4) to Set NX pair Segment Active / Inactive ? ? ? ? ? ? ? ? ?! A3 Return ? ? ? ? ? ? ?! Else Return So when I look at the debugger I can see that the If condition is true and the A2 Action is reached in the debugger, But I don't think the NX pair gets set to Active.? |
John, I did a test with your logic and it works. Are there any message in the JMRI system console? Does the NX work properly when clicking on the NX sensors? ?Maybe you have a conflicting route which would normally create a Stack dialog. Dave Sand ----- Original message ----- From: John Figie <zephyr9900@...> Subject: Re: [jmriusers] NX Entry/Exit pairs used in LogixNG do not get put back into logixNG when restarting and reloading the panel. #logixng #entryexit Date: Wednesday, May 03, 2023 9:55 AM Dave, Thanks again for your reply. Yes you are correct according to what I posted except I made a mistake in the post - sorry about that, what I really had and still have is this: ? ? ? ? ! A? If Then Else, Always execute ? ? ? ? ? ? ? if Entry/exit "NXW (E4) to NXE (W4)" is inactive ? ? ? ? ? ? ?!? Then Many ? ? ? ? ? ? ? ? ?! A2 Set Entry/Exit "NWX (E4) to NXE (W4) to Set NX pair Segment Active / Inactive ? ? ? ? ? ? ? ? ?! A3 Return ? ? ? ? ? ? ?! Else Return So when I look at the debugger I can see that the If condition is true and the A2 Action is reached in the debugger, But I don't think the NX pair gets set to Active.? |
Dave,
The system console shows no messages when I run the LogixNG to make the NX pair active. I can, with Logix NG, make the NX pair disabled or enabled, however the Exit Entry "Add Entry Exit Points" window does not indicate Disabled, but the signal goes from held to not held and vice versa. If I manually make the sensors active, first NXE then NXW for example, then the pair becomes active and the Layout panel show the route as reserved. I can also use LogixNG to make the pair active or inactive by making the sensors active or inactive like the logixNG shown below: ! A If Then Else, Always execute ? ?? If Entry/exit "NXE (W4) to NXW (E4)" is inactive ? ? ! Then Many ? ? ? ! A1 Set sensor NXE to state Active ? ? ? ! A2 Execute A after 500 milliseconds, Ignore on repeat ? ? ? ? ? ! A Set sensor NXW to state Active ? ! Else Return When the above LogixNG is executed and the NX pair is inactive, then the "Add Entry Exit Points"? window updates to show the pair as active, the track segments change color to indicate the route is reserved, and the signal for the interlocking changes to Clear. But when I try to use the Action? Set Entry/Exit "NXE (W4) to NXW (E4)" to Set NX Pair Segment Active / Inactive, then, I see nothing happen. There is no Console output, The Panel track segments do not change color and the??"Add Entry Exit Points" window does not change indicate the pair is active.? My Files can be accessed So I have a workaround, but I don't understand why the Set Entry/Exit "NXE (W4) to NXW (E4)" to Set NX Pair Segment Active / Inactive? does bit work. Should this be logged as an issue?? Or, am I just not using this the correct way? Regards, John |
John, I am surprised that the manual NX process even works. ?NX pairs have to have a consistent direction of travel. ?You have the pairs going both ways which is contrary to block routing logic, which is the basis for SML and NX. Your SML is manual rather than discovered. ?For NX to work, it needs discovered SML. ?Otherwise it builds temporary SML which might not work as expected. I suspect that these issues are the cause of the LogixNG behavior. Here is what I recommend.
Dave Sand ----- Original message ----- From: John Figie <zephyr9900@...> Subject: Re: [jmriusers] NX Entry/Exit pairs used in LogixNG do not get put back into logixNG when restarting and reloading the panel. #logixng #entryexit Date: Wednesday, May 03, 2023 8:09 PM Dave, The system console shows no messages when I run the LogixNG to make the NX pair active. I can, with Logix NG, make the NX pair disabled or enabled, however the Exit Entry "Add Entry Exit Points" window does not indicate Disabled, but the signal goes from held to not held and vice versa. If I manually make the sensors active, first NXE then NXW for example, then the pair becomes active and the Layout panel show the route as reserved. I can also use LogixNG to make the pair active or inactive by making the sensors active or inactive like the logixNG shown below: ! A If Then Else, Always execute ? ?? If Entry/exit "NXE (W4) to NXW (E4)" is inactive ? ? ! Then Many ? ? ? ! A1 Set sensor NXE to state Active ? ? ? ! A2 Execute A after 500 milliseconds, Ignore on repeat ? ? ? ? ? ! A Set sensor NXW to state Active ? ! Else Return When the above LogixNG is executed and the NX pair is inactive, then the "Add Entry Exit Points"? window updates to show the pair as active, the track segments change color to indicate the route is reserved, and the signal for the interlocking changes to Clear. But when I try to use the Action? Set Entry/Exit "NXE (W4) to NXW (E4)" to Set NX Pair Segment Active / Inactive, then, I see nothing happen. There is no Console output, The Panel track segments do not change color and the??"Add Entry Exit Points" window does not change indicate the pair is active.? My Files can be accessed So I have a workaround, but I don't understand why the Set Entry/Exit "NXE (W4) to NXW (E4)" to Set NX Pair Segment Active / Inactive? does bit work. Should this be logged as an issue?? Or, am I just not using this the correct way? Regards, John |
Dave
Thank you very much for your help. I now have it working they way it should including the LogixNG. I am not sure what your role is with JMRI but maybe your can help me with this proposal. In the??web page there is a section on placing sensors. My suggestion is to add a few more sentences to make the documentation better. I suggest including the 3rd paragraph shown below, to the Placing Sensors section: Placing Sensors Sensors, along with Signal Heads and Signal Masts, can be added at?Block Boundaries. Block boundaries can occur at?Anchor Points,?Turnouts,?Level Crossings?and?End Bumpers.?Edge Connectors?are always a block boundary. Sensors are assigned to anchor points, end bumpers and edge connectors by right clicking on the small colored box that represents the point and select?Set Sensors.... For end bumpers there will be one choice to make. Anchor points and edge connectors provide two choices. Each Sensor has a direction associated with it such as East (or North) or West (or South). A sensor pair must consist of an Entry point and Exit point with each sensor in the pair having the same direction. If for example a West sensor is paired with an East sensor unpredictable behavior will occur with the signals logix(NG) or scripts referencing the sensor pair. |
John, Your link is for a different page. ?What you meant was? The paragraph under the image covers the same concepts as your recommendation. Dave Sand ----- Original message ----- From: John Figie <zephyr9900@...> Subject: Re: [jmriusers] NX Entry/Exit pairs used in LogixNG do not get put back into logixNG when restarting and reloading the panel. #logixng #entryexit Date: Thursday, May 04, 2023 2:06 PM Dave Thank you very much for your help. I now have it working they way it should including the LogixNG. I am not sure what your role is with JMRI but maybe your can help me with this proposal. In the??web page there is a section on placing sensors. My suggestion is to add a few more sentences to make the documentation better. I suggest including the 3rd paragraph shown below, to the Placing Sensors section: Placing Sensors Sensors, along with Signal Heads and Signal Masts, can be added at?Block Boundaries. Block boundaries can occur at?Anchor Points,?Turnouts,?Level Crossings?and?End Bumpers.?Edge Connectors?are always a block boundary. Sensors are assigned to anchor points, end bumpers and edge connectors by right clicking on the small colored box that represents the point and select?Set Sensors.... For end bumpers there will be one choice to make. Anchor points and edge connectors provide two choices. Each Sensor has a direction associated with it such as East (or North) or West (or South). A sensor pair must consist of an Entry point and Exit point with each sensor in the pair having the same direction. If for example a West sensor is paired with an East sensor unpredictable behavior will occur with the signals logix(NG) or scripts referencing the sensor pair. Can you advise me on the best way to suggest this improvement to the JMRI developers? Regards, John |
I somewhat agree, however it is not as?clear to me. I did read this several times before beginning, and I am a new user so there is a lot to take in. Statements like "?It is not possible to add a sensor for the boundary going?out?from the turnout or crossing." are confusing to me because the software let's you do it. It just won't work correctly. Certainly it is OK to place a sensor at each boundary of a level crossing. You just can't use them both in a pair. Seems a little confusing. Keep in mind that what seems obvious to a experienced user is not for someone trying to learn. So I'm only trying to help.? I do greatly appreciate your help an patience.?
Regards John |
John, As a general rule, signals (and NX sensors) are used to protect points of conflict. ?Those are usually turnouts and level crossings. ?As such, attaching signals and NX sensors to turnouts and level crossings are for inbound traffic. Another way to look at this is to pose the question: ?Where do want the train to stop if there is a conflict? ?Normally, signaling is configured to protect a turnout/level crossing and the block beyond up to the next signal in the direction of traffic. Dave Sand ----- Original message ----- From: John Figie <zephyr9900@...> Subject: Re: [jmriusers] NX Entry/Exit pairs used in LogixNG do not get put back into logixNG when restarting and reloading the panel. #logixng #entryexit Date: Thursday, May 04, 2023 4:02 PM I somewhat agree, however it is not as?clear to me. I did read this several times before beginning, and I am a new user so there is a lot to take in. Statements like "?It is not possible to add a sensor for the boundary going?out?from the turnout or crossing." are confusing to me because the software let's you do it. It just won't work correctly. Certainly it is OK to place a sensor at each boundary of a level crossing. You just can't use them both in a pair. Seems a little confusing. Keep in mind that what seems obvious to a experienced user is not for someone trying to learn. So I'm only trying to help.? I do greatly appreciate your help an patience.? Regards John |