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
LogixNG some help requested
#logixng
I have a turnout that requires a 2-bit operation: two outputs for each direction (straight or divert), with pulsed output signal (on two outputs).
"Divert" or "Straight" are driven by two separate inputs: either of them pulsed.
?
For example: if Sensor_001 is pulsed 'low', then output Turnout_001 is pulsed 'low'. If Sensor_002 is pulsed 'low' then output Turnout_002 is pulsed 'low'.
Turnout_001 and Turnout_002 are two bits for the same turnout.
?
How should this be programmed in LogixNG? I am lost with all the possible parameters ("Add"/"Item"/ "Sensor" or "Turnout" or "Sensor Edge", ...
?
Thanks for any help and/or references,.. !
Erik
? |
I may have figured out a few things. But sadly no copy/past from a LogixNG thread possible?
?
If Then Else Execute on change
If Sensor sensor_001 goes from Active to Inactive
Then Set turnout Turnout_001 to state Straight
Else_If Sensor sensor_002 goes from Active to Inactive
Then Set turnout Turnout_001 to state Divert
?
Correct?
?
The sensor_001 and sensor_002 never can be inactive at the same time due to their wiring (single pole ON-ON switch). Better were two pushbuttons but this is what I have on hand.
?
Alternative would be not an Edge Detection ("..goes from..") but simple 'active' or 'inactive' state.
?
Correct?
? |
¿ªÔÆÌåÓýThere is a copy/paste system within the LogixNG editor, but its not a matter of "copying text code".??
Your sample code seems different to the original posting.? In the original posting, you said there were two turnout outputs for the actual turnout.? ?
I'd use the "Many" construct for what you are doing (based on your second posting):??
?! A
? ? ? ? ? ? Many
? ? ? ? ? ? ? ? ! A1
? ? ? ? ? ? ? ? ? ? If Then Else. Execute on change
? ? ? ? ? ? ? ? ? ? ? ? ? If
? ? ? ? ? ? ? ? ? ? ? ? ? ? Sensor sen1 is Inactive
? ? ? ? ? ? ? ? ? ? ? ? ! Then
? ? ? ? ? ? ? ? ? ? ? ? ? ? Set turnout Turn1 to state Closed
? ? ? ? ? ? ? ? ? ? ? ? ! Else
? ? ? ? ? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ? ! A2
? ? ? ? ? ? ? ? ? ? If Then Else. Execute on change
? ? ? ? ? ? ? ? ? ? ? ? ? If
? ? ? ? ? ? ? ? ? ? ? ? ? ? Sensor sen2 is Inactive
? ? ? ? ? ? ? ? ? ? ? ? ! Then
? ? ? ? ? ? ? ? ? ? ? ? ? ? Set turnout Turn1 to state Thrown
? ? ? ? ? ? ? ? ? ? ? ? ! Else
? ? ? ? ? ? ? ? ? ? ? ? ? ?
------ Original Message ------
From "Erik84750 via groups.io" <e.arckens@...>
Date 21/05/2025 14:27:36
Subject Re: [jmriusers] LogixNG some help requested
|
Erik, If "copy/paste" means getting the text of a LogixNG, use the Browse option from the Select menu. Dave Sand ----- Original message ----- From: "Erik84750 via groups.io" <e.arckens=[email protected]> Subject: Re: [jmriusers] LogixNG some help requested Date: Wednesday, May 21, 2025 8:27 AM I may have figured out a few things. But sadly no copy/past from a LogixNG thread possible? ? If Then Else Execute on change If Sensor sensor_001 goes from Active to Inactive Then Set turnout Turnout_001 to state Straight Else_If Sensor sensor_002 goes from Active to Inactive Then Set turnout Turnout_001 to state Divert ? Correct? ? The sensor_001 and sensor_002 never can be inactive at the same time due to their wiring (single pole ON-ON switch). Better were two pushbuttons but this is what I have on hand. ? Alternative would be not an Edge Detection ("..goes from..") but simple 'active' or 'inactive' state. ? Correct? ? |
Erik, There is also the if-elseif-else structure. ?I have not tested to see which is better for this scenario. Dave Sand ----- Original message ----- From: "Erik84750 via groups.io" <e.arckens=[email protected]> Subject: Re: [jmriusers] LogixNG some help requested Date: Wednesday, May 21, 2025 9:50 AM Yesss!!! Thank you Dave, this is of great help! ? Indeed, two pushbutton switches for each turnout: sensor_001 and sensor_002 (in your example: sen1 and sen2). ? "Many" makes a lot of sense, good to learn. |
Erik, Go to chapter 5 and search for else_if () Dave Sand ----- Original message ----- From: "Erik84750 via groups.io" <e.arckens=[email protected]> Subject: Re: [jmriusers] LogixNG some help requested Date: Wednesday, May 21, 2025 10:16 AM Strange, I cannot find this "if-else-if-else"? |
Erik, Look at the example at? This combines LogixNG with a bit of Java code. Dave Sand ----- Original message ----- From: "Erik84750 via groups.io" <e.arckens=[email protected]> Subject: Re: [jmriusers] LogixNG some help requested #logixng Date: Wednesday, May 21, 2025 12:21 PM Great! The more I delve into these LogixNG programming the more sophisticated it reveals to be. |
Erik, Which URL? ?They work for me. For track 3, T2 has to be closed in order to reach T3. ?T2 thrown is used to access track 2. ?Note: ?T1 is a right hand turnout. ?T2 and T3 are left hand turnouts. Dave Sand ----- Original message ----- From: "Erik84750 via groups.io" <e.arckens=[email protected]> Subject: Re: [jmriusers] LogixNG some help requested #logixng Date: Wednesday, May 21, 2025 4:00 PM The url's at the bottom are not valid, and I am lost with the table: for example, for route three should T1, T2 and T3 not be thrown/thrown/closed? |
to navigate to use esc to dismiss