Jump to content

Simple Loco Detection ...


Empfohlene Beiträge

Good evening ...

A total newcomer, my first post here (sorry; no German, so Google translation...).
Here's my First Question...
A simple Hornby HO oval, with one loco and two wagons. I have one rail detecting the passage of the named loco. If the loco is at the head of the train, the detection is triggered. If there is a wagon before the loco, there is no detection. If I run the train in reverse, there is no detection. The track only triggers if the loco is first in the train.
If I want to detect the named last wagon, again, this only happens if the wagon enters the track first (ie: train running in reverse...). A wagon, or loco, in the middle of a train, is never detected. 
Is this normal, and by design..? I'm not yet using code, only the GUI interface to build the events. Have I missed out something..? I could upload the layout, if it would help (I think..!).
I have many other questions, but I'll start slowly with this one, hoping for a simple answer. If in German, I'll have to use Google to translate.
Thanks in advance for your patience; meanwhile...

Guten Abend ...

Ein totaler Neuling, mein erster Beitrag hier (sorry; kein Deutsch, also Google Übersetzung ...).
Hier ist meine erste Frage ...
Ein einfaches Hornby HO-Oval mit einer Lok und zwei Wagen. Ich habe eine Schiene, die den Durchgang der genannten Lok erkennt. Befindet sich die Lok am Kopf des Zuges, wird die Erkennung ausgelöst. Befindet sich vor der Lok ein Wagen, erfolgt keine Erkennung. Wenn ich den Zug rückwärts fahre, erfolgt keine Erkennung. Die Strecke wird nur ausgelöst, wenn sich die Lok zuerst im Zug befindet.
Wenn ich den genannten letzten Wagen wieder erkennen möchte, geschieht dies nur, wenn der Wagen zuerst auf die Strecke fährt (dh: Zug fährt rückwärts ...). Ein Wagen oder eine Lok mitten in einem Zug wird niemals entdeckt.
Ist das normal und beabsichtigt ..? Ich verwende noch keinen Code, nur die GUI-Oberfläche, um die Ereignisse zu erstellen. Habe ich etwas verpasst ..? Ich könnte das Layout hochladen, wenn es helfen würde (ich denke ..!).
Ich habe viele andere Fragen, aber ich beginne langsam mit dieser und hoffe auf eine einfache Antwort. Wenn ich auf Deutsch bin, muss ich Google zum Übersetzen verwenden.
Vielen Dank im Voraus für Ihre Geduld; inzwischen...

Have a nice day

Douglas

Bearbeitet von Douglas.A.Allen
Link zu diesem Kommentar
Auf anderen Seiten teilen

Hello Douglas,

Writing in English is okay. And offering a translated text is a nice courtesy.

A train should be detected when entering (or leaving) a track, regardless if it is pulled pr pushed. However, when you issue a new command to the train and set it up to affect any train on a particular track, the engine must sit on that track because it represents the train. 

A better tactic is to store the train which triggered the "track entered" event. Keep it in a variable and when you want to affect this train, address the train via this stored reference, regardless of the track (i.e. Track: any)

Does this help or did I miss the point of your question?

kind regards

Goetz

 

p.s. Which version of the train studio are you using? The event management of  V4 and V5 differ greatly.

Link zu diesem Kommentar
Auf anderen Seiten teilen

Thank you , Goetz, for your speedy reply. I've recently downloaded and installed v5; I'm a new user, and know nothing of previous versions.
A little clarification for me, please..? When I use the term 'loco', I mean the engine (diesel, steam, whatever...) that's pulling (or pushing...) the train. To me, the term 'train' means the whole lot, engine, wagons, coaches etc...
When I name a loco, and create an event for a piece of track, this event is triggered whenever this named loco, named in the event, passes. When coupled with wagons behind, the loco again triggers the track event. When running backwards, however, the loco does not trigger the event, despite it having entered the track. I'm now retired, but spent several decades as analyst/programmer in an IT environment, and find this to be strange behaviour. It may be normal, and there are certainly ways to do things differently, which I'll have great pleasure in discovering, but as a complete novice, doing a very simple first 'learner' layout, I first would like to be reassured that anomalies of this nature are not simple errors on my part. Either it does work as I expect or it doesn't. If it doesn't: no matter, I'll continue and get around the issue, but at least I won't waste any more time trying to understand behaviour which has its own rules. I have come across several anomalies (to me...); this is just the first. It's nevertheless a splendid way of creating train layouts, and I'll continue to experiment with it.
So... Should I just accept that it's not going to trigger as I think it should, and use alternative methods, or is there something I can do to have the loco detected, whether first in the train or elsewhere..? I don't mind if I have to change my outlook; better now that after weeks of bashing my head against a wall..!

Vielen Dank, Goetz, für Ihre schnelle Antwort. Ich habe kürzlich v5 heruntergeladen und installiert. Ich bin ein neuer Benutzer und weiß nichts von früheren Versionen.
Eine kleine Klarstellung für mich, bitte ..? Wenn ich den Begriff "Lok" verwende, meine ich den Motor (Diesel, Dampf, was auch immer ...), der den Zug zieht (oder drückt ...). Für mich bedeutet der Begriff "Zug" das ganze Los, den Motor, die Wagen, die Reisebusse usw.
Wenn ich eine Lok benenne und ein Ereignis für ein Stück Spur erstelle, wird dieses Ereignis immer dann ausgelöst, wenn diese im Ereignis benannte benannte Lok passiert. In Verbindung mit Waggons dahinter löst die Lok erneut das Streckenereignis aus. Beim Rückwärtsfahren löst die Lok das Ereignis jedoch nicht aus, obwohl sie die Strecke betreten hat. Ich bin jetzt im Ruhestand, habe aber mehrere Jahrzehnte als Analyst / Programmierer in einer IT-Umgebung verbracht und finde dies ein seltsames Verhalten. Es mag normal sein, und es gibt sicherlich Möglichkeiten, Dinge anders zu machen, was ich sehr gerne entdecken werde, aber als Anfänger, der ein sehr einfaches Layout für Erstlerner erstellt, möchte ich zunächst sicher sein, dass Anomalien auftreten dieser Art sind keine einfachen Fehler meinerseits. Entweder funktioniert es wie erwartet oder nicht. Wenn dies nicht der Fall ist: Egal, ich werde fortfahren und das Problem umgehen, aber zumindest werde ich keine Zeit mehr damit verschwenden, Verhalten zu verstehen, das seine eigenen Regeln hat. Ich bin auf mehrere Anomalien gestoßen (für mich ...); Dies ist nur der erste. Es ist dennoch eine großartige Möglichkeit, Zuglayouts zu erstellen, und ich werde weiterhin damit experimentieren.
Also ... Sollte ich einfach akzeptieren, dass es nicht so ausgelöst wird, wie ich es mir vorstelle, und alternative Methoden anwenden, oder kann ich etwas tun, um die Lok zu erkennen, ob zuerst im Zug oder anderswo? Es macht mir nichts aus, wenn ich meine Einstellung ändern muss; Besser jetzt, nachdem ich wochenlang meinen Kopf gegen eine Wand geschlagen habe ..!


Douglas

Link zu diesem Kommentar
Auf anderen Seiten teilen

Hello, Douglas,
For both possibilities you need a track contact. You can find it under Infrastructure Railway Traffic and there the green-yellow rhombus.
In case the locomotive is at the front or the end of the train, see picture 1

255877689_Trackcontakt1.thumb.JPG.e104ca2986dabdd8125d879416d6259f.JPG
In case the locomotive is in the middle of the train, see picture 2. You can move the track contact to the right or left until the train stops at the right point.

1494358335_Trackcontakt2.thumb.JPG.493394442797fd2be23b8b89ab040e18.JPG

kind regards

streit_ross

 

Link zu diesem Kommentar
Auf anderen Seiten teilen

Thanks, AR...

Track contacts are to be my next subject of investigation. I'll try it out; the question seems to have been indirectly answered in that the track event only responds to the first vehicle, not the named vehicle it was programmed for. If that's the case, at least I know now, and won't rely on it being any other way.
Next step, then: track contacts. I'll see if they do the job, and report back here. Don't go far away, though, as there are sure to be more dumb, idiot, newcomer questions for later..!
Back after testing these contacts, then...

Danke, AR ...

Track-Kontakte sollen mein nächstes Untersuchungsobjekt sein. Ich werde es ausprobieren; Die Frage scheint indirekt beantwortet worden zu sein, da das Streckenereignis nur auf das erste Fahrzeug reagiert, nicht auf das benannte Fahrzeug, für das es programmiert wurde. Wenn das der Fall ist, weiß ich es zumindest jetzt und werde mich nicht darauf verlassen, dass es anders ist.
Nächster Schritt dann: Kontakte verfolgen. Ich werde sehen, ob sie den Job machen, und mich hier melden. Gehen Sie jedoch nicht weit weg, da es für später sicher mehr dumme, idiotische, neue Fragen geben wird ..!
Zurück nach dem Testen dieser Kontakte, dann ...

Douglas.

Link zu diesem Kommentar
Auf anderen Seiten teilen

OK, I've a simple oval with a train (loco with two wagons...) on it. There's a track contact. What do I need to do to get the track contact to 'know' that it's the loco that has triggered it..? For the moment, the track contact is triggered by whatever rolls across it. Is there a simple way to know if it's a loco or a wagon that has triggered the event..?

OK, ich habe ein einfaches Oval mit einem Zug (Lok mit zwei Wagen ...) drauf. Es gibt einen Streckenkontakt. Was muss ich tun, damit der Streckenkontakt weiß, dass es die Lok ist, die ihn ausgelöst hat? Im Moment wird der Gleiskontakt durch alles ausgelöst, was darüber rollt. Gibt es eine einfache Möglichkeit festzustellen, ob es sich um eine Lok oder einen Wagen handelt, der das Ereignis ausgelöst hat?

Douglas

Link zu diesem Kommentar
Auf anderen Seiten teilen

vor 2 Stunden schrieb Douglas.A.Allen:

When I use the term 'loco', I mean the engine 
To me, the term 'train' means the whole lot, engine, wagons, coaches etc...

Same here.

 

vor 3 Stunden schrieb Douglas.A.Allen:

When I name a loco, and create an event for a piece of track, this event is triggered whenever this named loco, named in the event, passes.

This part is confusing. Because when you set up an event for the occasion, that a train enters a track, you don't specify a particular train:

375691293_trainenterstrack.thumb.jpg.53e109d41a79196d4a804976aa58941c.jpg

You only specify the track that is to trigger this list of actions.

Inside the event definition, you may address the train that triggered the event:

658109466_addresstriggeringvehicle.jpg.cfc77ee269a0a5f29046a19b5522cf42.jpg

or define a condition for your list of actions which specifys a certain train to be at a certain location.

1428371737_specifytrainasacondition.jpg.84cbdd0676f5cb2c94025b4dc7a6ca2d.jpg

 

But neither appears to be what you did.

Would you mind showing a screen shot of your attempt, so that I can maybe spot where your misunderstanding lies?

 

streit_ross is correct in suggesting contacts as the better option. But they aren't the answer to your particular problem (just yet).

Link zu diesem Kommentar
Auf anderen Seiten teilen

vor 8 Minuten schrieb Douglas.A.Allen:

Is there a simple way to know if it's a loco or a wagon that has triggered the event..?

It's always the engine. Even if it pushes a wagon and that wagon touches the contact, triggering the event. The wagon is seen as an extension of the engine.

Bearbeitet von Goetz
Link zu diesem Kommentar
Auf anderen Seiten teilen

Here's my simple oval. What do I need to put into the event 'Trac_Cont' to get it to display the Loco's Name in the 'Trig_Labe' caption, please..?..?

Hier ist mein einfaches Oval. Was muss ich in das Ereignis 'Trac_Cont' einfügen, damit der Name der Lok in der Beschriftung 'Trig_Labe' angezeigt wird, bitte ..? ..?

Trac_Cont_Test_2.mbp

Clipboard01.thumb.jpg.ff778035d469ba8f88002ee54c173403.jpg

We're getting there..!

Wir kommen dorthin ..!

Douglas

Link zu diesem Kommentar
Auf anderen Seiten teilen

vor 17 Minuten schrieb Douglas.A.Allen:

We're getting there..!

Indeed, we are   :)

 

In the video, I'm still using a track element as trigger, not a contact. But the principal is identical.

The huge advantages of a contact are:

  1. precise trigger spot - easy to shift
  2. directional - you may turn off either direction A or B (under the <> symbol)
  3. visible only in construction mode
Link zu diesem Kommentar
Auf anderen Seiten teilen

Goetz...

Well..! Helpful..? Yes, Sir..! I'd not have thought of that 'logic' in a month of Sundays..! I'll play around with this notion and see where it takes me.
Just a little background; it may help communications going forward. I've been an 'OOP' programmer, and handled many different IT languages, each of which have their own foibles, quirks and traits. I'll get on to Lua soon enough, and battle with its intricacies, but I need to accumulate some basic ideas of how to command trains in this context. I'm not a purist, modelling any specific railroad (although I admire the fine work of many that I see on this site...), I'm just messing about seeing whether I can run two trains over a partially-shared layout. I won't be adhering to 'real-life' principles nor terminology, through ignorance, and will be making many fundamental errors along the way. Some of my questions may seem to yourself and others to come from 'left field'; my apologies in advance.
Enough for now; back to trying out triggers..! Thanks again. 3p9T3qx.gif

Goetz ...

Gut..! Hilfreich..? Jawohl..! Ich hätte in einem Monat sonntags nicht an diese 'Logik' gedacht ..! Ich werde mit dieser Vorstellung herumspielen und sehen, wohin sie mich führt.
Nur ein kleiner Hintergrund; Es kann die zukünftige Kommunikation unterstützen. Ich war ein 'OOP'-Programmierer und habe viele verschiedene IT-Sprachen behandelt, von denen jede ihre eigenen Schwächen, Macken und Eigenschaften hat. Ich werde früh genug zu Lua kommen und mit seinen Feinheiten kämpfen, aber ich muss einige grundlegende Ideen sammeln, wie man in diesem Zusammenhang Züge befiehlt. Ich bin kein Purist und modelliere eine bestimmte Eisenbahn (obwohl ich die gute Arbeit vieler, die ich auf dieser Seite sehe, bewundere ...). Ich mache mir nur Gedanken darüber, ob ich zwei Züge über ein teilweise gemeinsames Layout fahren kann . Ich werde mich nicht durch Unwissenheit an die Prinzipien des realen Lebens oder an die Terminologie halten und dabei viele grundlegende Fehler machen. Einige meiner Fragen scheinen Ihnen und anderen vom "linken Feld" zu kommen. Ich entschuldige mich im Voraus.
Genug für jetzt; zurück zum Ausprobieren von Triggern ..! Danke noch einmal.
  3p9T3qx.gif

Douglas

Link zu diesem Kommentar
Auf anderen Seiten teilen

vor 20 Minuten schrieb Douglas.A.Allen:

my apologies in advance.

no apologies needed, Douglas :)

concerning Lua:
you can convert any graphical EV into Lua script, simply by pressing the <> key.
Saves you from guessing how specific functions need to be written.

 

Link zu diesem Kommentar
Auf anderen Seiten teilen

It's starting to work, although still in simple fashion, but I just cannot understand certain actions that are taking place. I'll have to attach the circuit, in order to explain, so here it is...

Es fängt an zu funktionieren, obwohl es immer noch einfach ist, aber ich kann bestimmte Aktionen, die stattfinden, einfach nicht verstehen. Ich muss die Schaltung anbringen, um zu erklären, also hier ist es ...

_Doub_Loop_4.mbp

Please ignore the second train, set aside for now, and explain to me how this can happen. When the train on the track runs, it follows the inner loop. There is a track contact to lower the inner signal; this works when the train contacts. However, as the train continues, over other contacts, the signal is raised again. What is it that is raising this signal..? I can see no event causing this, and cannot control without knowing what's happening. Again, am I missing something simple..?
I don't want to know how to raise or lower signals; just what is it that's triggering this particular signal in this simple layout.
Thanks in advance.
On a secondary theme, I find that I have to save my simple layouts often, as the programme will intermittently not allow saving, with a message asking to send a bug report. Is this a normal instability that everyone suffers, or just me on this, ordinary PC..? When I cannot save, I export instead, but it's annoying, just the same. Any explanation..?
Sorry for the nuisance...

Bitte ignorieren Sie den zweiten Zug, legen Sie ihn vorerst beiseite und erklären Sie mir, wie dies passieren kann. Wenn der Zug auf der Strecke fährt, folgt er der inneren Schleife. Es gibt einen Gleiskontakt, um die innere Signal abzusenken. Dies funktioniert, wenn der Zug Kontakt aufnimmt. Während der Zug über andere Kontakte weiterfährt, wird das Signal jedoch erneut ausgelöst. Was ist es, das dieses Signal auslöst? Ich kann kein Ereignis sehen, das dies verursacht, und kann nicht kontrollieren, ohne zu wissen, was passiert. Vermisse ich wieder etwas Einfaches?
Ich möchte nicht wissen, wie man Signale erhöht oder senkt. Was genau löst dieses spezielle Signal in diesem einfachen Layout aus?
Danke im Voraus.
Bei einem sekundären Thema muss ich meine einfachen Layouts häufig speichern, da das Programm das Speichern zeitweise nicht zulässt und eine Meldung zum Senden eines Fehlerberichts angezeigt wird. Ist das eine normale Instabilität, unter der jeder leidet, oder nur ich auf diesem gewöhnlichen PC? Wenn ich nicht speichern kann, exportiere ich stattdessen, aber es ist trotzdem ärgerlich. Irgendeine Erklärung ..?
Entschuldigung für das Ärgernis ...

Douglas

Bearbeitet von Douglas.A.Allen
Link zu diesem Kommentar
Auf anderen Seiten teilen

vor 4 Stunden schrieb Douglas.A.Allen:

I have to save my simple layouts often, as the programme will intermittently not allow saving, with a message asking to send a bug report. Is this a normal instability that everyone suffers, or just me on this, ordinary PC..?

That's definitely not normal. I find the 3D train studio to be very stable. On an ordinary PC too!

Concerning your layout, I'll have a look as soon as I can.

Bearbeitet von Goetz
Link zu diesem Kommentar
Auf anderen Seiten teilen

Hello Douglas,

vor 5 Stunden schrieb Douglas.A.Allen:

What is it that is raising this signal..? I can see no event causing this ...

To observe cause and effect, open the event tracer:

940128713_eventtracer.jpg.551eb8b353f1e9185869b5ff0cc93539.jpg

 

Your culprit is the Cont_Sign_Oute

846583452_ContSignOute1.jpg.aa1c02bf17ecdf1c0200224d79a37e47.jpg

 

Reason being that you didn't specify the contact that is supposed to trigger this list of actions:

427589568_ContSignOute2.jpg.cf2cba6c13accdd01a6eb794cea50b48.jpg

 

Every contact will therefor trigger it's dedicated action list as well as this generic one.

Kind regards
Goetz

Link zu diesem Kommentar
Auf anderen Seiten teilen

Thanks, Goetz. I'll clean my glasses (again..!). I hadn't spotted that; well done.
I'll try to find a reason for the programme crashes, and send off some of these bug alerts.

Onward and upward.

Danke, Goetz. Ich werde meine Brille putzen (wieder ..!). Ich hatte das nicht bemerkt; gut gemacht.
Ich werde versuchen, einen Grund für die Programmabstürze zu finden und einige dieser Fehlerwarnungen zu senden.

Vorwärts und aufwärts.

Douglas

Link zu diesem Kommentar
Auf anderen Seiten teilen

Just to round off this topic, here's the working version, modest, but instructive...

Um dieses Thema abzurunden, hier ist die Arbeitsversion, bescheiden, aber lehrreich ...

_Doub_Loop_6.mbp

Thanks to S-R and Goetz; many hours or days have been saved by their generous replies. On to the next steps, then: getting the signal to reset the loco to its previous speed, not just a fixed value. I'll have a go at manipulating triggers, too. More questions to come, surely, but in new topics, probably.

Danke an S-R und Goetz; Viele Stunden oder Tage wurden durch ihre großzügigen Antworten gerettet. Weiter zu den nächsten Schritten: Das Signal zum Zurücksetzen der Lok auf die vorherige Geschwindigkeit, nicht nur auf einen festen Wert. Ich werde auch versuchen, Trigger zu manipulieren. Weitere Fragen werden sicherlich kommen, aber wahrscheinlich zu neuen Themen.

Douglas

Link zu diesem Kommentar
Auf anderen Seiten teilen

Erstelle ein Benutzerkonto oder melde dich an, um zu kommentieren

Du musst ein Benutzerkonto besitzen, um einen Kommentar verfassen zu können

Benutzerkonto erstellen

Neues Benutzerkonto für unsere Community erstellen.

Neues Benutzerkonto erstellen

Anmelden

Du hast bereits ein Benutzerkonto? Melde dich hier an.

Jetzt anmelden
×
×
  • Neu erstellen...