This article assumes that your CS3 is on version 1.3.3. If you are on an earlier version, you will need to update your CS3. Consult the manual for further instructions.
The CS3 from Märklin offers a great deal of advanced features when it comes to automating your layout. In this article I will explain how you create conditional events, meaning events that only trigger if certain conditions are met.
Creating An Event
To follow along in this example, create a new event. You do that by going to the event list and clicking the "+" plus sign.
This will give you an empty event window. The event window consists of a trigger mode box and an event task list. The task list contains the tasks that will be executed when the event is triggered.
There are a few important things to know:
- Trigger mode. The way the event is triggered (manually or automatically). More on this later.
- The task list. The tasks the event will perform when being executed. This can be everything from setting turnouts and signals to starting trains or starting other events.
- The record button. Clicking this button allows you to perform a series of tasks and have the task list filled automatically. This comes in handy when you want to automate a train.
- Icon. The icon button lets you set an icon for the event. If you do not set an icon, the icon for the first task in the task list is chosen.
- Add. The Add button lets you add effects like sound etc. I will not cover this in this article, but I encourage you to experiment with it.
There are three ways of triggering an event on the CS3.
- Manually. You click the event in the event list.
- By feedback. A train occupies or leaves a feedback sensor.
- An event trigger another event.
By default new events are triggered manually. You see this by editing the event.
To change the trigger mode, simply edit the event and drag a feedback contact from the article list onto the trigger mode box.
Clicking the trigger will bring up the settings window for the trigger. The settings window contains a few more options. The most important being "Position". Position tells the CS3 to trigger the event either by the contact becoming occupied or the contact becoming vacant. An event will only trigger on a status change of the feedback contact in question.
The settings window also contains further options for control that I will not cover in depth in this article. They are:
- Control trigger. This is an additional trigger. It will allow you to trigger the event when the CS3 starts, after an emergency stop or when the event handler is restarted.
- Control contact. This is a simple condition that allows you to only start the event if a particular control contact is active. A control contact is a virtual contact that you can create from the article list. It can be either on or off. Note: Manual mode disregards this setting!
- Group. Allows you to put the event in a group with other similar events.
Stopping here will allow you to build events that trigger whenever a feedback contact changes its status or using manual mode. The content of the task list will be activated in the order they appear in the task list.
Try and create an event and fill some turnouts into the task list. Try activating the event.
When you have a feel for it, please continue to read this article for more advanced stuff.
Conditions In Events
In the old days automating the layout was limited to a train activating a contact and then something happens. With conditions you can have that "something" happen only if other conditions are also met. This means that conditions gives you many options for automating your layout. You can do all sorts of cool stuff with conditions because they add an extra layer to events triggered by feedback contacts.
Conditions can be either:
- Status of a locomotive (running, not running)
- Status of a turnout
- Status of a signal
- Status of a feedback contact (S88)
Create a new empty event, leave the event window open, and go to the article list to find an S88 contact to use as a condition.
Drag the contact onto the event task list.
Now that you have dragged the contact to the event task list, you need to decide what the conditions should be. In our example the CS3 chose a default condition which is:
"If the contact has the status occupied, continue executing the event"
This might not be what we want, so let's take a look at the options. While editing the event, click on the contact that you want to change conditions for.
The settings for the task comes up and gives you a few options.
The settings in the Settings window are:
Position. The status that the contact must have to meet the condition. In our case it must be occupied. To change this, simply click the position icon and choose another option.
Delay. The amount of time (defined by the Unit drop down menu) that will have to pass before moving on to the next task in the event list.
Action. This is part of the advanced event handling. This allows you to change the status of the contact. It will be inactive if you have not turned on advanced event handling (System -> CS3 -> System menu -> Scroll down and check "Events - Advanced Mode"). More of this in a later article.
Condition. This determines how the condition should be checked for. In our case it should continue. Continue means that the execution of the event will continue immediately after the check - if the condition is met that is. Your other option is Delay. Delay meaning that the event will pause until the condition is met. What happens if the condition is never met, is a bit unclear, but there is a risk that the event will wait indefinitely. So take care when using this feature, you want to make sure that the condition is eventually met.
If you choose "Continue" the CS3 will put a little question mark "?" overlay icon on task. This allows you to identify what condition the task represents. If you had chosen "Delay" the overlay icon would be a "W" for "Wait!".
In this example choose "Continue".
To test our example. Try and manually set the status of "My contact" to vacant (grey). You change it by clicking it in the article list or on the track plan.
Now execute the event by clicking on it in the event list.
Since our condition was to continue if the contact was occupied the event will not execute because that condition is not met.
It happens like this:
In the event list you will see that our event has a red exclamation mark "!" on it. This tells us that a condition was not met, so the event execution has stopped.
If you go ahead and make the contact occupied (again, just click on it from the article list). Then run the event again. This time the condition is met, so the event will execute fine.
Now, we did not have anything in our task list besides our condition, so it may be difficult to see that something actually happened. Go ahead and edit the event again, now drag a turnout or other article into the event list. If you put a turnout in there, the event will set the turnout to the position shown in the task list when the event i executed.
It could look something like this:
When the event is executed and the condition is met, the turnout will be set to straight ahead.
Try setting the turnout to divert and the contact to occupied, then execute the event and see what happens.
The other option we had was "Delay". Delay means that the event will hold its execution until the condition is met. In our case until the contact gets occupied.
Go ahead and edit the event again, click on the contact and select "Delay" from the condition drop down.
Now you will see that the overlay icon changed to "W". You can say that "W" is for "Wait!".
Go out of edit event mode (click the button with the green bubble in the Event List). Then manually set the contact's status to vacant (grey) and execute the event.
You will notice that the execution does not stop as in the previous example. Instead it waits. Go ahead and set the contact's status to occupied and see that the event now resumes execution and sets the turnout.
Delaying execution of an event is very powerful when operating a shuttle train or automating stuff where conditions are not met when the event starts. You can simply check the status during the execution of an event and delay execution. This is great if a train needs to reach a certain contact before the next task is to be performed.
Status Of Other Articles
It is possible to check the status of other articles, it does not have to be only feedback contacts. You can check the status of another article by dragging it into the task list and clicking it. You will the that the Action options is chosen by default, but that the Condition option is available. If you choose Condition instead of Action, you now have the same options (Continue and Delay) as you would a feedback contact. This is extremely powerful.
It allows you to only set a train route if certain turnouts or signals have certain statuses. Very nice!
This was a bit on events in the CS3. If new stuff comes up, I will update the article.