¿ªÔÆÌåÓý


LogixNG POM #logixng

 

I am using the POM function in LogixNG.
Currently setting a CV = to an IM value.
Works good.
Now I'd like to ADD an IM value to the CV.
In the snip I started out trying to just add a constant (50) but that didn't work.
I think I need to use the Formula tab but not sure of the syntax.?
--

Many thanks in advance!

Vinny DeRobertis ~ Apex, NC
New York & Hudson Valley RR

Windows 7 Pro / Java 11 / JMRI v5.10
Command Station: Digikeijs DR5000.
Booster: Digikeijs DR5033
(4) Samsung A7 10.4" Tablets
Fully Kiosk/Engine Driver v2.37.187
DCC/DMX Gateway: Pricom LLS.
LocoNet Input Modules: Digikeijs DR4088LN
DCC Output Modules:
Digikeijs DR4018 / Yamorc YD8116.
Sensors: Model Train Technology: DETECTOR-HO.
Turnout Motors: MTB MP1


Re: How do I import openpyxl?

 

If openpyxl.py is *NOT* in the "standard" Python dist library
(under Linux that would be /usr/lib/python3/dist-packages/), you will have to
add its path to sys.path:

import os
import sys
sys.path.append("/path/to/the/directory/containing/openpyxl.py")


At Wed, 21 May 2025 13:08:12 -0700 "Nick Brownsberger via groups.io" <nbrownsbe@...> wrote:


I want to run a Jython script inside of ?jmri so I can manipulate turnouts, etc. However, the script doesn't recognize openpyxl when I try to import it. I need openpyxl to access an Excel spreadsheet. How do I import openpyxl?

Thanks in advance,
Nick






--
Robert Heller -- Cell: 413-658-7953 GV: 978-633-5364
Deepwoods Software -- Custom Software Services
-- Linux Administration Services
heller@... -- Webhosting Services


Re: How do I import openpyxl?

 

Nick,

I don't have an answer, but it might be lot easier to export the spreadsheet as a CSV file. ?There are several Jython scripts that work with CSV files that could provide useful examples.

Dave Sand



----- Original message -----
From: "Nick Brownsberger via groups.io" <nbrownsbe=[email protected]>
Subject: [jmriusers] How do I import openpyxl?
Date: Wednesday, May 21, 2025 3:08 PM

I want to run a Jython script inside of ?jmri so I can manipulate turnouts, etc. However, the script doesn't recognize openpyxl when I try to import it. I need openpyxl to access an Excel spreadsheet. How do I import openpyxl?
?
Thanks in advance,
Nick


How do I import openpyxl?

 

I want to run a Jython script inside of ?jmri so I can manipulate turnouts, etc. However, the script doesn't recognize openpyxl when I try to import it. I need openpyxl to access an Excel spreadsheet. How do I import openpyxl?
?
Thanks in advance,
Nick


Re: LogixNG some help requested #logixng

 

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.


Re: Audio Icon on Web Panel - Java

 

Ok that makes sense. The browser is Fully Kiosk Plus. I'll look for that setting, thank you Bob.


Re: Audio Icon on Web Panel - Java

 

This sounds like your browser on the tablet has a ¡°only play sounds from top panel¡± option set.

This is commonly desired so that when you have multiple windows open only the top one will be playing the annoying advertising sounds.

What browser are you using?

JMRI has _no_ _idea_ what window is on top in your browser, so this is not something that JMRI can fix.

Bob

On May 21, 2025, at 1:29?PM, Vinny DeRobertis via groups.io <vinny.derobertis@...> wrote:

I'll start fresh.
Tablet1 only has Fully Kiosk browser running.
Panel A is on top on Tablet1.
Panel A has AudioIcon1.
Pressing AudioIcon1 plays Sound1 on Tablet1.
Issue 1: When I make any other panel on top on Tablet1, Sound1 stops. I'd like Sound1 to keep playing on Tablet1 regardless of which panel is on top on Tablet1.
Issue 2: When I run the script from the JMRI computer, it only works when Panel A is on top on Tablet1. I'd like the script to work regardless of which panel is on top on Tablet1.
¡ª
Bob Jacobsen
rgj1927@...


Re: Audio Icon on Web Panel - Java

 

I'll start fresh.
Tablet1 only has Fully Kiosk browser running.
Panel A is on top on Tablet1.
Panel A has AudioIcon1.
?
Pressing AudioIcon1 plays Sound1 on Tablet1.
?
Issue 1: When I make any other panel on top on Tablet1, Sound1 stops. I'd like Sound1 to keep playing on Tablet1 regardless of which panel is on top on Tablet1.
?
Issue 2: When I run the script from the JMRI computer, it only works when Panel A is on top on Tablet1. I'd like the script to work regardless of which panel is on top on Tablet1.
?
?


Re: LogixNG some help requested #logixng

 

Great! The more I delve into these LogixNG programming the more sophisticated it reveals to be.


Re: Edit dialog boxes do not open with full width

 

¿ªÔÆÌåÓý

Vince,

?

The user-interface.xml getting some odd values in there is a typical cause. Since removing the user-interface.xml which holds things like last size didn¡¯t really work, my guess would be the screen size is not being reported right somehow. There might be debug that you could turn on that would show it thinking ¡°this tool is X wide, the user preference is Y wide, but the screen says it¡¯s only Z wide¡± and that would confirm what going on.

?

But in your screen settings things like magnify or scale might impact this. Also, some hi-res screens run on low res settings can also confuse things sometimes.

?

Others may have clues on this.

?

-Ken Cameron, Member JMRI Dev Team

?

?


Re: LogixNG some help requested #logixng

 

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"?


Re: LogixNG some help requested #logixng

 

Strange, I cannot find this "if-else-if-else"?


Re: LogixNG some help requested #logixng

 

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.


Re: LogixNG some help requested #logixng

 

... I actually meant @Nigel_Cliffe for the "thanks", and now I see your post @Dave_sand too, kudo's to you too :).


Re: LogixNG some help requested #logixng

 

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.


Re: LogixNG some help requested #logixng

 

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?
?


Re: LogixNG some help requested #logixng

 

¿ªÔÆÌåÓý

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

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?
?


Re: Virtual sound setup #esu

 

¿ªÔÆÌåÓý

I purchased a LokPilot 5 Basic 21MTC (#59029) and have had some time to investigate its capabilities using both DecoderPro (5.10)/NCE PowerHouse (2021 eprom) and LokProgrammer (5.2.12). My LP5Basic came with firmware version 5.0.2 which LokProgrammer updated to version 5.1.6. The results below were the same before and after update.

The original question concerning start delay and CV252 can be answered in the affirmative. LokPilot 5 Basic does have a virtual drive sound that activates the start delay based on the value in CV252 (units of 0.065 sec). But there is a catch. You must also make sure Bit 2 of CV124 is 1 (bit value of 4). There is a check box in LokProgrammer that does this, but not one in DecoderPro (DP). Use CVs sheet in DP or the single CV programmer for this. This Bit is not listed in the instructions that come with the LP5Basic, but it apparently serves the same purpose as it does in LokSound V4, LokSound Select, LokSound 5, LokSound 5 DCC, LokPilot 5, and LokPilot 5 DCC decoders. It enables/disables start delay.

Until a DP interface for LP5Basic is added to JMRI, the best way to program a LP5Basic is to use the LokPilot 5 DCC DP interface (Actually, the best way is to use a LokProgrammer). All of the CVs used by LP5Basic are available in the LP5DCC interface. However, there are also CVs and corresponding functionality in the LP5DCC interface that are not available in the LP5Basic. These are:

CV23, CV24 ¨C consist adjustment for acceleration and deceleration on the DP ¡®Consist¡¯ sheet.

CV57, CV58 ¨C chuff spacing speed step 1 and chuff spacing decrease rate on DP ¡®Sound¡¯ sheet. Why these are even in the LP5DCC interface is a mystery since the LokPilots do not have sound.

CV114, CV115 ¨C fade-in and fade-out time of light effects on DP ¡®Function Settings¡¯ sheet.

CV122 ¨C remember current function states and current speed on DP ¡®Advanced¡¯ sheet.

CV131 ¨C halve trigger pulses in shunt mode and logical function dimmer brightness on DP ¡®Sound¡¯ sheet. Again, I don¡¯t understand the connection to sound.

CV141-CV143 ¨C smoke chuffs on DP ¡®Function Settings¡¯ sheet.

CV150-CV154 ¨C Zimo HLU brake sections on DP ¡®Advanced¡¯ sheet

CV249, CV250 ¨C minimum steam chuff distance and chuff trigger on DP ¡®Sound¡¯ sheet. Why is this even present? Maybe you can have a LP with no sound but still be driving a smoke generator?

CV0.252.257-CV0.252.318 ¨C SUSI map on DP ¡®SUSI Map¡¯ sheet.

CV16.5.385-CV16.5.506, CV16.6.257-CV16.6.506, CV16.7.257-CV16.7.378, CV16.10.385-CV16.10.503, CV16.11.257-CV16,11,503, CV16.12.257-CV16.12.375 ¨C rows 41-72 on DP ¡®Function Map¡¯ sheet.

My advice if using any of the above sheets is you should only do a ¡°Write Changes on Sheet¡± DO NOT do a ¡°Write Full Sheet¡±. Probably no harm, but best to be safe.

CV0.255.261-CV0.255.296 are also missing in LP5Basic. DP CVs sheet will not allow edit of them and they are not listed for a LokPilot 5 Basic by LokProgrammer. Perhaps this is an error in the DP interface since they are also not listed by LokProgrammer for the LP5DCC. I don¡¯t know what they are used for.

Also, a few other items on the DP ¡®Advanced¡¯ sheet are unclear because I don¡¯t have the capacity to test them:

1.? Command Station Compatibility>LGB Function Button Mode affects CV49, but the instructions for LP5Basic do not list this.

2.? Command Station Compatibility>SUSI Master & SUSI Slave use CV124. The instructions show bit 3 of CV124 controlling SUSI serial protocol. Since the SUSI Map is not present, I don¡¯t know what this does.

3.? RailComPlus & M4 Master Decoder Synchronization>M4 Manufacturer ID uses CV191 and RailComPlus & M4 Master Synchronization>M4 Decoder Serial Number uses CV192. My understanding is that LP5 and LP5DCC are multiprotocol: DCC, DC, AC, Motorola, Selectrix, and M4 but the LP5Basic is only DCC and DC. DP doesn¡¯t show these CVs affecting anything else, so it is a mystery why these CVs are present in LP5Basic. The instruction sheet is not helpful.

Mark Granville


Re: LogixNG some help requested #logixng

 

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?
?


Re: Edit dialog boxes do not open with full width

 

Yes, even though it appears I now have a workaround for the problem, I'm definitely interested in poking around some more to get to the bottom of this. I tried the experiment you mentioned with my "working" My_JMRI_Railroad profile (renaming the user-interface.xml file, moving out the .bak files, just in case). Both monitors plugged in. I tried editing a turnout and I get a skinny window. Save it and re-edit, skinny window again.
?
I won't have a lot of time today, but I'm now at least somewhat motivated to see if I can help. I'll try some more experiments, including comparisons with the files in my older X86/Java 11 system, to see if I can gain any insights. Might be an opportunity for me to accidentally learning something while sniffing around in the UUID folder.
?
Will report back when I have something potentially interesting.
?
Vince