¿ªÔÆÌåÓý

Trying to replicate 3-way LogixNG code #logixng


 

¿ªÔÆÌåÓý

Dave Sand,

I saw a copy of your 3way LogixNG.xml code (May 6th) which looked interesting (anyway, I assume it¡¯s yours). It operates much smoother than the Sensor/Route/Turnout conglomeration I developed to do the same thing. Up until now, I have been avoiding any Logix or LogixNG coding, at my age, I really didn¡¯t want to learn another programming language.?

Since the code operated the 3-way turnouts just the way I liked. My plan was to add it to my layout.xml with a modification adding of two extra tracks/turnouts. I tried merging the two xml files (but it created two separate panels), not ideal. I also tried the proper way, creating the code from scratch, but (for me) LogixNG is a steep learning curve. I don¡¯t understand the methodology of how to program by completing the dialog boxes. I got as far as the lines completing the (if-) then-else statements which I couldn¡¯t get it to look like your code, I became so frustrated, the project got put on the back burner.?

Is there an editor to directly type-in the code, leaving the debugger to point out syntax errors? I would like an easier way to replicate your code. Thank you in advance for your expertise.?
?
John ?Bauchiero
-?NCE PH-Pro & PowerCab, Pi4, DCC-EX
- JMRI 5.11.6
- Java 17.0.12


 

John,

If you have any LogixNG already created, loading an additional file with LogixNG does not work.

I have created an export file which only has the LogixNG with modified system names to prevent conflicts. ?There are no other table entries or panels. ?Load this after loading your regular file.


Dave Sand


----- Original message -----
From: "John Bauchiero via groups.io" <john4dhmr=[email protected]>
Subject: [jmriusers] Trying to replicate 3-way LogixNG code
Date: Wednesday, May 21, 2025 8:14 PM

Dave Sand,

I saw a copy of your 3way LogixNG.xml code (May 6th) which looked interesting (anyway, I assume it¡¯s yours). It operates much smoother than the Sensor/Route/Turnout conglomeration I developed to do the same thing. Up until now, I have been avoiding any Logix or LogixNG coding, at my age, I really didn¡¯t want to learn another programming language.?

Since the code operated the 3-way turnouts just the way I liked. My plan was to add it to my layout.xml with a modification adding of two extra tracks/turnouts. I tried merging the two xml files (but it created two separate panels), not ideal. I also tried the proper way, creating the code from scratch, but (for me) LogixNG is a steep learning curve. I don¡¯t understand the methodology of how to program by completing the dialog boxes. I got as far as the lines completing the (if-) then-else statements which I couldn¡¯t get it to look like your code, I became so frustrated, the project got put on the back burner.?

Is there an editor to directly type-in the code, leaving the debugger to point out syntax errors? I would like an easier way to replicate your code. Thank you in advance for your expertise.?
?
John ?Bauchiero
-?NCE PH-Pro & PowerCab, Pi4, DCC-EX
- JMRI 5.11.6
- Java 17.0.12


 

¿ªÔÆÌåÓý

Thanks Dave,

I still may not be sure what I am doing with LogixNG, though now being up to my ankles, can edit the existing code to fit my purposes. I¡¯ll assume since you didn¡¯t address the existence of a text editor for LogixNG, there isn't any. None the less, you've gotten my interest peaked to continue with more NG code.?

John ?Bauchiero
-?NCE PH-Pro & PowerCab, Pi4, DCC-EX
- JMRI 5.11.6
- Java 17.0.12

On May 22, 2025, at 1:06?AM, Dave Sand via groups.io <ds@...> wrote:

John,

If you have any LogixNG already created, loading an additional file with LogixNG does not work.

I have created an export file which only has the LogixNG with modified system names to prevent conflicts. ?There are no other table entries or panels. ?Load this after loading your regular file.


Dave Sand


----- Original message -----
From: "John Bauchiero via groups.io" <john4dhmr=[email protected]>
Subject: [jmriusers] Trying to replicate 3-way LogixNG code
Date: Wednesday, May 21, 2025 8:14 PM

Dave Sand,

I saw a copy of your 3way LogixNG.xml code (May 6th) which looked interesting (anyway, I assume it¡¯s yours). It operates much smoother than the Sensor/Route/Turnout conglomeration I developed to do the same thing. Up until now, I have been avoiding any Logix or LogixNG coding, at my age, I really didn¡¯t want to learn another programming language.?

Since the code operated the 3-way turnouts just the way I liked. My plan was to add it to my layout.xml with a modification adding of two extra tracks/turnouts. I tried merging the two xml files (but it created two separate panels), not ideal. I also tried the proper way, creating the code from scratch, but (for me) LogixNG is a steep learning curve. I don¡¯t understand the methodology of how to program by completing the dialog boxes. I got as far as the lines completing the (if-) then-else statements which I couldn¡¯t get it to look like your code, I became so frustrated, the project got put on the back burner.?

Is there an editor to directly type-in the code, leaving the debugger to point out syntax errors? I would like an easier way to replicate your code. Thank you in advance for your expertise.?
?
John ?Bauchiero
-?NCE PH-Pro & PowerCab, Pi4, DCC-EX
- JMRI 5.11.6
- Java 17.0.12



 

John,

There is no "text editor". ?You can get a text view of a LogixNG using the Browse option in the Select menu. ?However, that does not show all of the details.

Prior to LogixNG, I would use scripts to handle special cases. ?Many of those have been converted to LogixNG.

Dave Sand


----- Original message -----
From: "John Bauchiero via groups.io" <john4dhmr=[email protected]>
Subject: Re: [jmriusers] Trying to replicate 3-way LogixNG code
Date: Thursday, May 22, 2025 10:40 AM

Thanks Dave,

I still may not be sure what I am doing with LogixNG, though now being up to my ankles, can edit the existing code to fit my purposes. I¡¯ll assume since you didn¡¯t address the existence of a text editor for LogixNG, there isn't any. None the less, you've gotten my interest peaked to continue with more NG code.?

John ?Bauchiero
-?NCE PH-Pro & PowerCab, Pi4, DCC-EX
- JMRI 5.11.6
- Java 17.0.12

On May 22, 2025, at 1:06?AM, Dave Sand via groups.io <ds@...> wrote:

John,

If you have any LogixNG already created, loading an additional file with LogixNG does not work.

I have created an export file which only has the LogixNG with modified system names to prevent conflicts. ?There are no other table entries or panels. ?Load this after loading your regular file.


Dave Sand


----- Original message -----
From: "John Bauchiero via groups.io" <john4dhmr=[email protected]>
Subject: [jmriusers] Trying to replicate 3-way LogixNG code
Date: Wednesday, May 21, 2025 8:14 PM

Dave Sand,

I saw a copy of your 3way LogixNG.xml code (May 6th) which looked interesting (anyway, I assume it¡¯s yours). It operates much smoother than the Sensor/Route/Turnout conglomeration I developed to do the same thing. Up until now, I have been avoiding any Logix or LogixNG coding, at my age, I really didn¡¯t want to learn another programming language.?

Since the code operated the 3-way turnouts just the way I liked. My plan was to add it to my layout.xml with a modification adding of two extra tracks/turnouts. I tried merging the two xml files (but it created two separate panels), not ideal. I also tried the proper way, creating the code from scratch, but (for me) LogixNG is a steep learning curve. I don¡¯t understand the methodology of how to program by completing the dialog boxes. I got as far as the lines completing the (if-) then-else statements which I couldn¡¯t get it to look like your code, I became so frustrated, the project got put on the back burner.?

Is there an editor to directly type-in the code, leaving the debugger to point out syntax errors? I would like an easier way to replicate your code. Thank you in advance for your expertise.?
?
John ?Bauchiero
-?NCE PH-Pro & PowerCab, Pi4, DCC-EX
- JMRI 5.11.6
- Java 17.0.12



 

¿ªÔÆÌåÓý

Dave,

Sorry, me again. Thanks for getting me confident in creating and editing code in LogixNG. I have added lines to your code to support two extra turnouts, one to split the tracks on either side of the 3-way, 5 tracks total. Everything worked correctly except two illuminated sensor icons stayed lit all the time.?

Being I had some vestigial code when I was controlling the turnouts with routes and also with Logix. When removed the vestigial code the sensor icons stopped functioning altogether. Not sure why only the first three indicators operated correctly, I assume since you designed the code for only three tracks, when I expanded to five something was missing to turn off those two extra indicators. With some digging in the xml code I found Logix code that turns them off. Should it be in Logix code or LogixNG? I could not find anything explained in the help files.?

It wouldn¡¯t let me edit the Logix, and I could not determine how to create a replacement Logix, so I added the extra lines directly into the xml code. ?Now everything works correctly. Is there a reason why the sensor control is in Logix when everything else is LogixNG?

Copy of the Logix code:
Logix: IX:SYS ? ?System Logix ? ?(Enabled)

? IX:SYS_SGC_Light Sensors ?Sensor Group Light Sensors ??
? ? [x] ?R1 ?IF OR Sensor "Cmd 1" state is "Sensor Active" ??
? ? [x] ?R2 ? ?OR Sensor "Cmd 2" state is "Sensor Active" ??
? ? [x] ?R3 ? ?OR Sensor "Cmd 3" state is "Sensor Active" ??
? ? [x] ?R4 ? ?OR Sensor "Cmd 4" state is "Sensor Active" ??
? ? [x] ?R5 ? ?OR Sensor "Cmd 5" state is "Sensor Active" ??
? ? ? ? ? ? ?THEN ??
? ? ? ? ? ? ? ?On Change To True, Set Sensor, "Track 1" to Inactive ??
? ? ? ? ? ? ? ?On Change To True, Set Sensor, "Track 2" to Inactive ??
? ? ? ? ? ? ? ?On Change To True, Set Sensor, "Track 3" to Inactive ??
? ? ? ? ? ? ? ?On Change To True, Set Sensor, "Track 4" to Inactive ??
? ? ? ? ? ? ? ?On Change To True, Set Sensor, "Track 5" to Inactive ??

John ?Bauchiero
-?NCE PH-Pro & PowerCab, Pi4, DCC-EX
- JMRI 5.11.6
- Java 17.0.12

On May 22, 2025, at 1:18?PM, Dave Sand via groups.io <ds@...> wrote:

John,

There is no "text editor". ?You can get a text view of a LogixNG using the Browse option in the Select menu. ?However, that does not show all of the details.

Prior to LogixNG, I would use scripts to handle special cases. ?Many of those have been converted to LogixNG.

Dave Sand


----- Original message -----
From: "John Bauchiero via groups.io" <john4dhmr=[email protected]>
Subject: Re: [jmriusers] Trying to replicate 3-way LogixNG code
Date: Thursday, May 22, 2025 10:40 AM

Thanks Dave,

I still may not be sure what I am doing with LogixNG, though now being up to my ankles, can edit the existing code to fit my purposes. I¡¯ll assume since you didn¡¯t address the existence of a text editor for LogixNG, there isn't any. None the less, you've gotten my interest peaked to continue with more NG code.?

John ?Bauchiero
-?NCE PH-Pro & PowerCab, Pi4, DCC-EX
- JMRI 5.11.6
- Java 17.0.12

On May 22, 2025, at 1:06?AM, Dave Sand via groups.io <ds@...> wrote:

John,

If you have any LogixNG already created, loading an additional file with LogixNG does not work.

I have created an export file which only has the LogixNG with modified system names to prevent conflicts. ?There are no other table entries or panels. ?Load this after loading your regular file.


Dave Sand


----- Original message -----
From: "John Bauchiero via groups.io" <john4dhmr=[email protected]>
Subject: [jmriusers] Trying to replicate 3-way LogixNG code
Date: Wednesday, May 21, 2025 8:14 PM

Dave Sand,

I saw a copy of your 3way LogixNG.xml code (May 6th) which looked interesting (anyway, I assume it¡¯s yours). It operates much smoother than the Sensor/Route/Turnout conglomeration I developed to do the same thing. Up until now, I have been avoiding any Logix or LogixNG coding, at my age, I really didn¡¯t want to learn another programming language.?

Since the code operated the 3-way turnouts just the way I liked. My plan was to add it to my layout.xml with a modification adding of two extra tracks/turnouts. I tried merging the two xml files (but it created two separate panels), not ideal. I also tried the proper way, creating the code from scratch, but (for me) LogixNG is a steep learning curve. I don¡¯t understand the methodology of how to program by completing the dialog boxes. I got as far as the lines completing the (if-) then-else statements which I couldn¡¯t get it to look like your code, I became so frustrated, the project got put on the back burner.?

Is there an editor to directly type-in the code, leaving the debugger to point out syntax errors? I would like an easier way to replicate your code. Thank you in advance for your expertise.?
?
John ?Bauchiero
-?NCE PH-Pro & PowerCab, Pi4, DCC-EX
- JMRI 5.11.6
- Java 17.0.12




 

John,

The track selection sensors are treated as a sensor group: ?PanelPro Tools -> Sensor Groups.
The "IX:SYS" Logix contains a conditional for each sensor group. ?The conditional sets the sensors inactive and then the sensor group logic sets the selected sensor active. ?This ensures that only one sensor in the group is active.

The "IX:SYS" Logix cannot be edited directly. ?It is managed by the "Define Sensor Group" dialog.

Dave Sand



----- Original message -----
From: "John Bauchiero via groups.io" <john4dhmr=[email protected]>
Subject: Re: [jmriusers] Trying to replicate 3-way LogixNG code
Date: Saturday, May 24, 2025 9:53 AM

Dave,

Sorry, me again. Thanks for getting me confident in creating and editing code in LogixNG. I have added lines to your code to support two extra turnouts, one to split the tracks on either side of the 3-way, 5 tracks total. Everything worked correctly except two illuminated sensor icons stayed lit all the time.?

Being I had some vestigial code when I was controlling the turnouts with routes and also with Logix. When removed the vestigial code the sensor icons stopped functioning altogether. Not sure why only the first three indicators operated correctly, I assume since you designed the code for only three tracks, when I expanded to five something was missing to turn off those two extra indicators. With some digging in the xml code I found Logix code that turns them off. Should it be in Logix code or LogixNG? I could not find anything explained in the help files.?

It wouldn¡¯t let me edit the Logix, and I could not determine how to create a replacement Logix, so I added the extra lines directly into the xml code. ?Now everything works correctly. Is there a reason why the sensor control is in Logix when everything else is LogixNG?

Copy of the Logix code:
Logix: IX:SYS ? ?System Logix ? ?(Enabled)

? IX:SYS_SGC_Light Sensors ?Sensor Group Light Sensors ??
? ? [x] ?R1 ?IF OR Sensor "Cmd 1" state is "Sensor Active" ??
? ? [x] ?R2 ? ?OR Sensor "Cmd 2" state is "Sensor Active" ??
? ? [x] ?R3 ? ?OR Sensor "Cmd 3" state is "Sensor Active" ??
? ? [x] ?R4 ? ?OR Sensor "Cmd 4" state is "Sensor Active" ??
? ? [x] ?R5 ? ?OR Sensor "Cmd 5" state is "Sensor Active" ??
? ? ? ? ? ? ?THEN ??
? ? ? ? ? ? ? ?On Change To True, Set Sensor, "Track 1" to Inactive ??
? ? ? ? ? ? ? ?On Change To True, Set Sensor, "Track 2" to Inactive ??
? ? ? ? ? ? ? ?On Change To True, Set Sensor, "Track 3" to Inactive ??
? ? ? ? ? ? ? ?On Change To True, Set Sensor, "Track 4" to Inactive ??
? ? ? ? ? ? ? ?On Change To True, Set Sensor, "Track 5" to Inactive ??

John ?Bauchiero
-?NCE PH-Pro & PowerCab, Pi4, DCC-EX
- JMRI 5.11.6
- Java 17.0.12

On May 22, 2025, at 1:18?PM, Dave Sand via groups.io <ds@...> wrote:

John,

There is no "text editor". ?You can get a text view of a LogixNG using the Browse option in the Select menu. ?However, that does not show all of the details.

Prior to LogixNG, I would use scripts to handle special cases. ?Many of those have been converted to LogixNG.

Dave Sand


----- Original message -----
From: "John Bauchiero via groups.io" <john4dhmr=[email protected]>
Subject: Re: [jmriusers] Trying to replicate 3-way LogixNG code
Date: Thursday, May 22, 2025 10:40 AM

Thanks Dave,

I still may not be sure what I am doing with LogixNG, though now being up to my ankles, can edit the existing code to fit my purposes. I¡¯ll assume since you didn¡¯t address the existence of a text editor for LogixNG, there isn't any. None the less, you've gotten my interest peaked to continue with more NG code.?

John ?Bauchiero
-?NCE PH-Pro & PowerCab, Pi4, DCC-EX
- JMRI 5.11.6
- Java 17.0.12

On May 22, 2025, at 1:06?AM, Dave Sand via groups.io <ds@...> wrote:

John,

If you have any LogixNG already created, loading an additional file with LogixNG does not work.

I have created an export file which only has the LogixNG with modified system names to prevent conflicts. ?There are no other table entries or panels. ?Load this after loading your regular file.


Dave Sand


----- Original message -----
From: "John Bauchiero via groups.io" <john4dhmr=[email protected]>
Subject: [jmriusers] Trying to replicate 3-way LogixNG code
Date: Wednesday, May 21, 2025 8:14 PM

Dave Sand,

I saw a copy of your 3way LogixNG.xml code (May 6th) which looked interesting (anyway, I assume it¡¯s yours). It operates much smoother than the Sensor/Route/Turnout conglomeration I developed to do the same thing. Up until now, I have been avoiding any Logix or LogixNG coding, at my age, I really didn¡¯t want to learn another programming language.?

Since the code operated the 3-way turnouts just the way I liked. My plan was to add it to my layout.xml with a modification adding of two extra tracks/turnouts. I tried merging the two xml files (but it created two separate panels), not ideal. I also tried the proper way, creating the code from scratch, but (for me) LogixNG is a steep learning curve. I don¡¯t understand the methodology of how to program by completing the dialog boxes. I got as far as the lines completing the (if-) then-else statements which I couldn¡¯t get it to look like your code, I became so frustrated, the project got put on the back burner.?

Is there an editor to directly type-in the code, leaving the debugger to point out syntax errors? I would like an easier way to replicate your code. Thank you in advance for your expertise.?
?
John ?Bauchiero
-?NCE PH-Pro & PowerCab, Pi4, DCC-EX
- JMRI 5.11.6
- Java 17.0.12