Jump to content

Recommended Posts

Posted

I am trying to store a variable (Current speed) read from a certain train.

I want to read the current speed of the locomotive at all times and then store it as a variable and check

to see if the current speed is not 0.

If it is not, I plan to trigger a series of events.

Unfortunately I am still on V6.   

I can read the speed, but not check to see if it is zero.

Regards

Curtis

Posted
vor 25 Minuten schrieb Curt84328:

I want to read the current speed [...] and check to see if the current speed is not 0

Hello Curtis,
This is not what you asked for. And Bahnland gave you the appropriate answer. But still ...

Would it help you to know that a train which stops can trigger a dedicated event?

597371151_triggereventtrainstops.jpg.c03e03121d228886121b7884061b5b9b.jpg

Greets
Goetz

Posted

Hello @BahnLand

please allow me a tiny correction. Curtis asked for a solution to see if the speed is not 0. Your solution wouldn't work with trains reversing (current speed < 0). Therefore it should be rather like this:

2021-12-04_224403.jpg.678a43c7223ee25d3f961acc11c4c3fd.jpg

Viele Grüße
Timba

Posted

I tried Bahnland's suggestion, The events do not seem to be activating

running.thumb.jpg.0612d9cbab7e582561e19296706fd14c.jpg

If I manually activate the steam jets and then stop the train,  It does stop all the jets.

stopped.thumb.jpg.a7f798cff3d22235d14cc0ff84ddedbe.jpg

I had it at one point, but am stumped.

Curt

 

Posted

Hi Curtis,

Bahnland's suggestion is not working because the event is not triggered. A user-defined event needs a call. For instance, you could use a timer, set to 1 sec and 'automatic restart' set true. That will give you a tick every second.

2021-12-05_064109.thumb.jpg.312e4a18397ed996a2507fa80215e63b.jpg

 

Next you use the event 'timer expires' and put the code in there, instead of a user-defined event.

2021-12-05_065110.thumb.jpg.7b270bc99b0e6f3384c4e7391ad652ba.jpg

 

Hope that helps.

Best regards
Timba

Posted
14 hours ago, Timba said:

Hi Curtis,

Bahnland's suggestion is not working because the event is not triggered. A user-defined event needs a call. For instance, you could use a timer, set to 1 sec and 'automatic restart' set true. That will give you a tick every second.

2021-12-05_064109.thumb.jpg.312e4a18397ed996a2507fa80215e63b.jpg

 

Next you use the event 'timer expires' and put the code in there, instead of a user-defined event.

2021-12-05_065110.thumb.jpg.7b270bc99b0e6f3384c4e7391ad652ba.jpg

 

Hope that helps.

Best regards
Timba

It does indeed help.   

I got it to do just what I wanted.

timers.thumb.jpg.d203408a1b071d9a31b60fc84dedb9a8.jpg

I used two timers of 2 seconds, offset by one second so that a timer expires every second.

timer1.thumb.jpg.0cc57605f40edca6c1c5c2645dc6e0f9.jpg

I set up 2 timer expires events with one for each timer.  Condition was as everyone has said except condition, not event.

One timer shuts off the front jets, and starts the back jets.  The other times turns on the front jets and shuts off the back jets.

561894678_FrontJet.thumb.jpg.a9336047a9ddb26904b080e2254f44f9.jpg

Here the Back Jet is shutting off and the Front Jet is opening.

 

Much thanks and regards

Curtis.

 

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...