Welcome to the forum   
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Share
Options
View
Go to last post in this topic Go to first unread post in this topic
Offline einotuominen  
#1 Posted : 12 April 2023 13:01:38(UTC)
einotuominen

Finland   
Joined: 19/09/2022(UTC)
Posts: 382
Location: Kaarina
Hey there,

I use Rocrail to control my layout. Essentially, I've set it up so that schedules are assigned to locomotives in a particular sequence - almost like a choreography. In the schedules, there are action controls that trigger certain actions, such as assigning new schedules to different locomotives. This ensures that trains follow the same sequence, as long as they start in the same position.

Since I have many terminal tracks, I frequently use the "swap logical direction" option in the schedule block controls. This is especially useful for shunting and switching operations, which I've been able to automate thanks to Johnjean for bringing the XML scripting in to my attention.

All schedules can of course be assigned manually and I've tested and built them this way, and everything works as expected. However, there is one issue I've noticed when running the "full show", meaning that I start the schedule that is supposed to be the number 01 in the sequence and all the others follow that "automatically" by action control. One of the schedules consistently fails to swap the logical direction of a locomotive, which means that the locomotive doesn't end up where it's supposed to. This only happens when running the "full show", not when assigning the schedule manually.

Additionally, there's another case where a schedule triggers an action for another locomotive, but it never gets triggered unless I've manually started the originating schedule.

I'm wondering if anyone else has experienced similar issues with Rocrail and, more importantly, if anyone has found a way to overcome them?

I'm running Rocrail with 2,2 GHz 6-Core Intel Core i7 with 16 gigs of RAM so that should not be a problem.

Best regards,
Eino


thanks 1 user liked this useful post by einotuominen
Offline JohnjeanB  
#2 Posted : 12 April 2023 13:46:00(UTC)
JohnjeanB

France   
Joined: 04/02/2011(UTC)
Posts: 3,115
Location: Paris, France
Originally Posted by: einotuominen Go to Quoted Post
Hey there,

I use Rocrail to control my layout. Essentially, I've set it up so that schedules are assigned to locomotives in a particular sequence - almost like a choreography. In the schedules, there are action controls that trigger certain actions, such as assigning new schedules to different locomotives. This ensures that trains follow the same sequence, as long as they start in the same position.

Since I have many terminal tracks, I frequently use the "swap logical direction" option in the schedule block controls. This is especially useful for shunting and switching operations, which I've been able to automate thanks to Johnjean for bringing the XML scripting in to my attention.

All schedules can of course be assigned manually and I've tested and built them this way, and everything works as expected. However, there is one issue I've noticed when running the "full show", meaning that I start the schedule that is supposed to be the number 01 in the sequence and all the others follow that "automatically" by action control. One of the schedules consistently fails to swap the logical direction of a locomotive, which means that the locomotive doesn't end up where it's supposed to. This only happens when running the "full show", not when assigning the schedule manually.

Additionally, there's another case where a schedule triggers an action for another locomotive, but it never gets triggered unless I've manually started the originating schedule.

I'm wondering if anyone else has experienced similar issues with Rocrail and, more importantly, if anyone has found a way to overcome them?

I'm running Rocrail with 2,2 GHz 6-Core Intel Core i7 with 16 gigs of RAM so that should not be a problem.


Hi Eino
I use Rocrail since late 2013, on a variety of s/w versions and I have NEVER found a mistake in it even though I use many schedules, conditional follow-up schedules and of course change of directions.
I use to my advantage the fact to contradict the normal path of Rocrail (e.g.: a loco is supposed to stop at the IN of a block, but then I start an XML program that overrides this and forces the loco to a very precise point for uncoupling.
You have to see the whole process as a multi-tasking with possibly contradictions (some are un-wanted)
Agreed some debugging may be tricky but usually writing a program (normal RR usage or XML) does the trick.
In your specific case you have to check what is happening:
- EITHER the swap command is never activated
- OR it is activated twice

How to tell which is which? By installing a marker (activation of a solenoid thing) or writing a text. Very intructive usually.

Notes:
- in the past I had to deal with "re'entrancy" It was a program for a crane that did not behaved as supposed.
In the end turned out that the same program was executed multiple times so I had to install a toggle lock to prevent the program to be started before the previous instance was not fully completed.

- to be honest I had also to fight with the GO command. It is used to finish a schedule-operated train and start in Aquarium mode.

Cheers
Jean

thanks 2 users liked this useful post by JohnjeanB
Offline Martti Mäntylä  
#3 Posted : 12 April 2023 21:37:34(UTC)
Martti Mäntylä

Finland   
Joined: 15/11/2018(UTC)
Posts: 398
Location: Uusimaa, Helsinki
Hi Eino,

I don't have experience of implementing the kind of complex behaviour that you are aiming at.

With that said, if indeed your schedules work as intended when executed individually, but lead to unexpected behaviour when executed in parallel, it would appear that there is some unintended interference between parallel activities. Rocrail makes no effort to protect the unwary programmer.

I have seen simpler instances of that when two instances of an action were triggered (nearly) simultaneously. These two instances are not insulated in parallel threads, as they would in a more solid programming environment, but happily share the same data and mess up each other (in my case, the triggers got mixed up). My solution was to create several distinct actions performing the same operations so that each action is only launched by one source.

Just like Jean said, the same goes for XML scripts: if there is a chance that the same piece of XML could be launched twice in parallel, the resulting behaviour may well be unexpected. Again, duplication may help.

(The "toggle lock" Jean mentioned sounds pretty much like the concept of "semaphore" in operating systems, named after the real things appearing along railroads.)
- Martti M.
Era III analog & digital (Rocrail, CAN Digital Bahn, Gleisbox/MS2, K83/K84), C & M tracks, some Spur 1
Offline einotuominen  
#4 Posted : 13 April 2023 09:45:01(UTC)
einotuominen

Finland   
Joined: 19/09/2022(UTC)
Posts: 382
Location: Kaarina
Thanks guys,

I'll try to set up some sort of debugging with dynamic text (I suppose that's the object in Rocrail that suits best)... If I remember correctly in XML scripts there is also a possibility to output log text.

Let's see what will happen.

-Eino
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

| Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.274 seconds.