¿ªÔÆÌåÓý


Re: LogixNG table editor and CSV question #logixng

 

¿ªÔÆÌåÓý

Erik,

> I the Table import of JMRI_Users_Erik84750_test.csv the resulting Table does not place "Row 1"? and "1,23" and "2,46 and "Hello" each in its own record cell?? ..as is the case with your example file JMRI_Users_Erik84750_test.txt?

That's because that file was exported as CSV, not as a TAB separated text file. So don't use that file. Maybe I shouldn't have sent that file at all.

Daniel

On 2025-05-27 05:28, Erik84750 via groups.io wrote:

On Tue, May 27, 2025 at 05:12 AM, danielb987 wrote:
It is correct. Header A, Header B, Header C is in the Excel file and so are Row 1, Row 2 and Row 3. The reason I have these cells are that the first row and the first column is treated as column headers and row headers by LogixNG.
I am confused now Daniel.
?
I the Table import of JMRI_Users_Erik84750_test.csv the resulting Table does not place "Row 1"? and "1,23" and "2,46 and "Hello" each in its own record cell?? ..as is the case with your example file JMRI_Users_Erik84750_test.txt?


Re: LogixNG table editor and CSV question #logixng

 

On Tue, May 27, 2025 at 05:12 AM, danielb987 wrote:
It is correct. Header A, Header B, Header C is in the Excel file and so are Row 1, Row 2 and Row 3. The reason I have these cells are that the first row and the first column is treated as column headers and row headers by LogixNG.
I am confused now Daniel.
?
I the Table import of JMRI_Users_Erik84750_test.csv the resulting Table does not place "Row 1"? and "1,23" and "2,46 and "Hello" each in its own record cell?? ..as is the case with your example file JMRI_Users_Erik84750_test.txt?


Re: LogixNG table editor and CSV question #logixng

 

¿ªÔÆÌåÓý

Erik,

> Your file JMRI_Users_Erik84750_test.csv (see first screenshot below) opens as follows (second screenshot below) in LogixNG Tables, with "comma separated tabs"
> To me it does not seem a correct import into LogixNG Tables: "Row 1" is not separated from "1,23" etc.. ?

It is correct. Header A, Header B, Header C is in the Excel file and so are Row 1, Row 2 and Row 3. The reason I have these cells are that the first row and the first column is treated as column headers and row headers by LogixNG. See the documentation about tables:

> When I use your JMRI_Users_Erik84750_test.xlsx and want to save it as .csv, I have two .csv options when doing a "save as":
> 1. CSV (MS-DOS) *.csv
> 2. CSV separated by list-separation sign *.csv
> Which of these options did you use?

I store the text file as a TAB separated text file, not as a CSV file.

Daniel


On 2025-05-27 04:29, Erik84750 via groups.io wrote:

On Tue, May 27, 2025 at 03:33 AM, danielb987 wrote:
I created an Excel file, JMRI_Users_Erik84750_test.xlsx, and stored it as a CSV file JMRI_Users_Erik84750_test.csv
Your file JMRI_Users_Erik84750_test.csv (see first screenshot below) opens as follows (second screenshot below) in LogixNG Tables, with "comma separated tabs"
To me it does not seem a correct import into LogixNG Tables: "Row 1" is not separated from "1,23" etc.. ?
?
?
?
When I use your JMRI_Users_Erik84750_test.xlsx and want to save it as .csv, I have two .csv options when doing a "save as":
1. CSV (MS-DOS) *.csv
2. CSV separated by list-separation sign *.csv
Which of these options did you use?
?
When opening Excel "Options", "Advanced", "System record separation sign" box, is it "ticked" in you case? Do you use a comma to separate decimals?
?
Erik
?
?


Re: LogixNG table editor and CSV question #logixng

 

On Tue, May 27, 2025 at 03:33 AM, danielb987 wrote:
I created an Excel file, JMRI_Users_Erik84750_test.xlsx, and stored it as a CSV file JMRI_Users_Erik84750_test.csv
Your file JMRI_Users_Erik84750_test.csv (see first screenshot below) opens as follows (second screenshot below) in LogixNG Tables, with "comma separated tabs"
To me it does not seem a correct import into LogixNG Tables: "Row 1" is not separated from "1,23" etc.. ?
?
?
?
When I use your JMRI_Users_Erik84750_test.xlsx and want to save it as .csv, I have two .csv options when doing a "save as":
1. CSV (MS-DOS) *.csv
2. CSV separated by list-separation sign *.csv
Which of these options did you use?
?
When opening Excel "Options", "Advanced", "System record separation sign" box, is it "ticked" in you case? Do you use a comma to separate decimals?
?
Erik
?
?


Re: Simple way to move any loco between two points (automated)?

 

Nags,

The "print" statement is used for debugging to make sure the values are as expected. ?Once everything is working you can comment the print lines.

There is no speed unit. ?The value is the percentage of the throttle expressed as 0 to 1.0. ?20% (.2) could be 5 kph or 50 kph depending on other factors such as decoder settings, speed curves, speed profiles, etc.

Dave Sand



----- Original message -----
From: "Nags via groups.io" <snowy999=[email protected]>
Subject: Re: [jmriusers] Simple way to move any loco between two points (automated)?
Date: Monday, May 26, 2025 8:05 PM

Thanks for that Dave!
I can sort of understand scripts just not up on all the syntax.
?
As this will be consistent for direction and speed and long address, I assume I could hard code those parameters(?)
Regarding 'print' I assume this is to update the console.
What speed unit applies (I use kph)?
?
--
H.O. Australia (Layout in Progress)
Digikeijs DR5000 LocoNet
JMRI v5.10 DecoderPro/Warrants/CPE/SML/LogixNG
Java: OpenLogic jre-17.0.12.7 ? Windows 10


Re: LogixNG table editor and CSV question #logixng

 

¿ªÔÆÌåÓý

Ken,

> But that would still leave the question of if the importer would recognize the EU embedded characters in the number or time fields correctly. The issue may span a couple of different stages of this process.

The import of CSV files treats each cell as a string. If the user wants to treat the value as an integer or a floating point number, he needs to convert it. LogixNG has functions for converting a string to an integer or a float.

Daniel

On 2025-05-27 03:40, Ken Cameron wrote:

Does the input also understand tab separated files? If so, that gets around the EU character issue in seeing the right number of fields. But that would still leave the question of if the importer would recognize the EU embedded characters in the number or time fields correctly. The issue may span a couple of different stages of this process.

?

-Ken Cameron, Member JMRI Dev Team

?

?


Re: Simple way to move any loco between two points (automated)?

 

Hi Nags,
?
As I understand it, Dave has provided a script that is adaptable to multiple scenarios, but you could hard code direction (True for Fwd or False for Rev) and Long Address (True for a long address, otherwise False)
?
As for the speed value, if you always need the same throttle setting for all trains, then that could also be hard coded, using a value between 0 and 1.? The speed value represents the throttle position, so .2 (as in Dave's example for the memory variable contents, note the full stop) equates to setting the throttle to 20%, .75 would be 75% etc.
?
Cheers,
Trevor


Re: LogixNG table editor and CSV question #logixng

 

¿ªÔÆÌåÓý

Does the input also understand tab separated files? If so, that gets around the EU character issue in seeing the right number of fields. But that would still leave the question of if the importer would recognize the EU embedded characters in the number or time fields correctly. The issue may span a couple of different stages of this process.

?

-Ken Cameron, Member JMRI Dev Team

?

?


Re: LogixNG table editor and CSV question #logixng

 

¿ªÔÆÌåÓý

Erik,

I too have Excel 2010. And I live in Sweden in northern Europe so I have the same problem with Excel CSV files as you have.

I created an Excel file, JMRI_Users_Erik84750_test.xlsx, and stored it as a CSV file JMRI_Users_Erik84750_test.csv and as a TAB separated text file JMRI_Users_Erik84750_test.txt. I start PanelPro, open the LogixNG Tables table and then click "Add". I click the CSV file name button and selects the textfile (without renaming it to CSV) and opens it and then click on the Create button. Now the table opens correctly. Note that I didn't renamed the txt file to csv.

See my attached files for reference.

Daniel


On 2025-05-26 20:09, Erik84750 via groups.io wrote:

On Mon, May 26, 2025 at 06:59 PM, danielb987 wrote:

Erik,

Which version of Excel do you have? I have Excel 2010 and it supports export to TAB separated CSV file

I have MS Office 2010.
Two versions of export to .csv are presented when using "save as":
1. CSV (MS-DOS) *.csv
2. CSV separated by list-separation sign *.csv
?
In both cases the exported .csv file uses semi-colon (";"), as described in my previous message. Summary: due to the fact that EU decimal (,) and thousands (.) separation is different from US separation, a semi-colon is used as record separation.
If I want to use tab-separated records I have to export as "Text (tab separated) *.txt".
Causing my file to loose any Excel link.
?
Hence my upcoming request to have this third option when retrieving .csv files, (besides "tab" and "comma" separation) for "semi-colon" separation.


Re: Simple way to move any loco between two points (automated)?

 

Thanks for that Dave!
I can sort of understand scripts just not up on all the syntax.
?
As this will be consistent for direction and speed and long address, I assume I could hard code those parameters(?)
Regarding 'print' I assume this is to update the console.
What speed unit applies (I use kph)?
?
--
H.O. Australia (Layout in Progress)
Digikeijs DR5000 LocoNet
JMRI v5.10 DecoderPro/Warrants/CPE/SML/LogixNG
Java: OpenLogic jre-17.0.12.7 ? Windows 10


Re: LogixNG table editor and CSV question #logixng

 

¿ªÔÆÌåÓý

Erik,

Forgot this mail. I missed that you have already answered my other email.

Daniel

On 2025-05-27 00:18, danielb987 wrote:

Erik,

Please attach the file you get when you export the Excel document using TAB.

Which version of Excel do you use? Do you use Windows och Mac?

Daniel


On 2025-05-26 21:45, Erik84750 via groups.io wrote:
Erik,
Try renaming the .txt file as .csv.
Dave Sand
?
That results in a Excel file with one column and all records (all columns) compressed together per row, hence useless.


Re: LogixNG table editor and CSV question #logixng

 

¿ªÔÆÌåÓý

Erik,

Please attach the file you get when you export the Excel document using TAB.

Which version of Excel do you use? Do you use Windows och Mac?

Daniel


On 2025-05-26 21:45, Erik84750 via groups.io wrote:

Erik,
Try renaming the .txt file as .csv.
Dave Sand
?
That results in a Excel file with one column and all records (all columns) compressed together per row, hence useless.


Re: Simple way to move any loco between two points (automated)?

 

Nags,

Ramping will depend on momentum.

Here is a script (assuming you email client does not get carried away):

import java
import jmri

class MoveFromStaging(jmri.jmrit.automat.AbstractAutomaton):
??? def init(self):
??????? addr, long, direct, speed = memories.getMemory("TrainInfo").getValue().split("/")
??????? self.addr = int(addr)
??????? self.long = True if long == 'L' else False
??????? self.dir = True if direct == 'F' else False
??????? self.speed = float(speed)
??????? self.sensor = sensors.getSensor("OccSensor")
??????? print 'Train: {}, long = {}, forward = {}, speed = {}'.\
??????????????? format(self.addr,\
??????????????? 'True' if self.long else 'False',\
??????????????? 'True' if self.dir else 'False',\
??????????????? self.speed)

??? def handle(self):
??????? self.throttle = self.getThrottle(self.addr, self.long)
??????? self.throttle.setIsForward(self.dir)
??????? self.throttle.setSpeedSetting(self.speed)
??????? print 'train shoud be moving'

??????? self.waitSensorActive(self.sensor)

??????? print 'train has arrived'
??????? self.throttle.setSpeedSetting(0)
??????? self.throttle.release(None)
??????? self.throttle = None
??????? return False

mfs = MoveFromStaging()
mfs.start()

The memory variable has four parts: ?1234/L/F/.2.
The second part is L or S for long or short. ?The third part is the throttle direction, F or R. ?The last is the speed.

Dave Sand


----- Original message -----
From: "Nags via groups.io" <snowy999=[email protected]>
Subject: Re: [jmriusers] Simple way to move any loco between two points (automated)?
Date: Monday, May 26, 2025 4:32 PM

On Tue, May 27, 2025 at 07:01 AM, Dave Sand wrote:
Nags,
?
Is the memory variable name and sensor name always the same?
?
Dave Sand
Yep, the memory variable will be the same. The destination (sensor) will always be the same. However I would replicate the solution to use it for other locations.
I envisage the train will ramp up to a slow speed and ramp down upon the destination block sensor going active.
?
--
H.O. Australia (Layout in Progress)
Digikeijs DR5000 LocoNet
JMRI v5.10 DecoderPro/Warrants/CPE/SML/LogixNG
Java: OpenLogic jre-17.0.12.7 ? Windows 10


Re: Simple way to move any loco between two points (automated)?

 

On Tue, May 27, 2025 at 07:01 AM, Dave Sand wrote:
Nags,
?
Is the memory variable name and sensor name always the same?
?
Dave Sand
Yep, the memory variable will be the same. The destination (sensor) will always be the same. However I would replicate the solution to use it for other locations.
I envisage the train will ramp up to a slow speed and ramp down upon the destination block sensor going active.
?
--
H.O. Australia (Layout in Progress)
Digikeijs DR5000 LocoNet
JMRI v5.10 DecoderPro/Warrants/CPE/SML/LogixNG
Java: OpenLogic jre-17.0.12.7 ? Windows 10


Re: Simple way to move any loco between two points (automated)?

 

Nags,

Is the memory variable name and sensor name always the same?

Dave Sand



----- Original message -----
From: "Nags via groups.io" <snowy999=[email protected]>
Subject: [jmriusers] Simple way to move any loco between two points (automated)?
Date: Monday, May 26, 2025 1:37 AM

I'm looking for a simple way to move any loco from the staging track (siding/yard) to the block where the warrant will start.
Conceptually the solution would:
  • Use a loco/consist address supplied (e.g. from a memory variable)
  • Drive the train until a sensor (block occupancy) is triggered.
  • Assume a clear path has been established (user responsibility)
Thanks.
--
H.O. Australia (Layout in Progress)
Digikeijs DR5000 LocoNet
JMRI v5.10 DecoderPro/Warrants/CPE/SML/LogixNG
Java: OpenLogic jre-17.0.12.7 ? Windows 10


Re: Cannot change horn, no bell #esu

 

I will take this to ESU group.


Re: Cannot change horn, no bell #esu

 

I have cycled through 0-14 for CV163 (Horn) and 0-5 for CV164 (Bell)


Re: Ad Hoc Changing Block Alternate Colour - Means of Showing Cab Allocation with DC Cab Control

 

Colin,

Here is a demo that sort of implements what you are looking at doing.


After expanding the zip file, move the xml and py files and custom icons to an existing profile. ?Everything is internal so there is no requirement for a specific connection.

Comments

EntryExit dynamically builds the block list based on the active sensor pair. ?You cannot build a list of blocks that will be allocated. ?Since you will not have signals, it is also not possible to predict the "possible" block set from the signal mast logic. ?

The demo inverts the process. ?There is a LogixNG that is triggered when EntryExit has allocated a block. ?It runs the set-alternate-color.py script. ?The script has access to the LogixNG symbol table which provides the block name and cab name. ?

The cab sensor group triggers a LogixNG which updates a global LogixNG variable. ?The script has a Python dictionary that maps the cab names to the color for each cab name.

Since you don't have occupancy detection, you will need to "cancel" the EntryExit routes.

Setting unallocated blocks to a selected cab is probably not a good idea. ?That would require changing the normal block color.

Dave Sand


----- Original message -----
From: "colin smith via groups.io" <colinsmithwork=[email protected]>
Subject: Re: [jmriusers] Ad Hoc Changing Block Alternate Colour - Means of Showing Cab Allocation with DC Cab Control
Date: Monday, May 26, 2025 6:02 AM

Oh and it is good to have seen that block managing script, where and how it is described and syntax. All part of learning.


Re: Cannot change horn, no bell #esu

 

Sorry,
I didn't even look.


On Mon, May 26, 2025 at 2:25?PM Peter Ulvestad via <ulvestad=[email protected]> wrote:
Not really a JMRI issue. I recommend you take it back to your dealer.

--
Peter Ulvestad
Linux Mint 22.1, JMRI 5.11.6, Java 21.0.7
JMRI Users Group Moderator ( /g/jmriusers )
JMRI Developers Group Moderator ( )
Tam Valley Group Moderator ( )
Sprog-DCC Group Moderator ( )
Edmonton Model Railroad Association ( )







--
John Griffin

Model Railroading Topics


Re: Cannot change horn, no bell #esu

 

Peter,
I'll get him to open the topic again on the ESU group.


On Mon, May 26, 2025 at 2:25?PM Peter Ulvestad via <ulvestad=[email protected]> wrote:
Not really a JMRI issue. I recommend you take it back to your dealer.

--
Peter Ulvestad
Linux Mint 22.1, JMRI 5.11.6, Java 21.0.7
JMRI Users Group Moderator ( /g/jmriusers )
JMRI Developers Group Moderator ( )
Tam Valley Group Moderator ( )
Sprog-DCC Group Moderator ( )
Edmonton Model Railroad Association ( )







--
John Griffin

Model Railroading Topics