[Solved] Click twice to turn a switch

Moderator: dadolphs

rjversluis
Site Admin
Posts: 42364
Joined: 10.04.2006, 08:48
Location: Speyer, Germany
Contact:

Re: Click twice to turn a switch

Post by rjversluis » 02.08.2015, 14:03

Just disable "Overwrite status".

ejp
Posts: 117
Joined: 01.10.2012, 08:20
Location: Denmark

Re: Click twice to turn a switch

Post by ejp » 02.08.2015, 15:37

Hi Rob

Sorry, does not work.

Test where new sensor does not go on:
When switching from Rocview the red background is OK, but the switch still shows the old position
When switching from LH100, the background stays as it was. ie. if Rocview has left it red, it continues red despite it is in a position with sensor on. If it was left without red, it continues that way despite it is in position with sensor off

Test where new sensor goes on
When switching from Rocview it works correct
When switching from LH100 it turns on the red light in one side (in my example straight) when the sensor on this side goes on

I have not testet train/schedule operation

I would think, that if sensors are defined, the red background should always be on, if neither straight or turnout sensor is set as defined (inverted or not). If both set sensors are defined, both sensors to straight or turnout should be set. (the sensors are 'anded').
Sensors should always be defined in pairs. If there is only one sensor, the other side should be defined as the same sensor, but inverted (like calvin did)


Regards
Erik

rjversluis
Site Admin
Posts: 42364
Joined: 10.04.2006, 08:48
Location: Speyer, Germany
Contact:

Re: Click twice to turn a switch

Post by rjversluis » 02.08.2015, 16:40

Hi Erik,

I think you have a definition problem as you already could reproduce with the virtual test of the sensors.

ejp
Posts: 117
Joined: 01.10.2012, 08:20
Location: Denmark

Re: Click twice to turn a switch

Post by ejp » 02.08.2015, 17:59

Hi Rob

I have reduced my testplan to only consist of the switch and the sensors. And it still works as described. Faulty.

If I use the virtual controller without Overwrite status
click switch turns red on - switch set to new position
set old sensor off - red remains - switch is set to old position
set new sensor on - turns red off
this is OK
Also OK if new sensor does not go on as red remains

Virtual with Overwrite status
click switch turns red on - switch set to new position
set old sensor off - red goes off - switch is set to old position
set new sensor on - red remains red off
this is not OK as red goes off to soon
Also not OK if new sensor does not go on as red is off

Testing virtual with LH100 is not possible.

But virtual is one thing, real layout is another

And I do not think that I have any definition error as the switch is defined as default with only address and the 2 sensors defined. And testet with/without Overwrite status.

Regards
Erik

ejp
Posts: 117
Joined: 01.10.2012, 08:20
Location: Denmark

Re: Click twice to turn a switch

Post by ejp » 03.08.2015, 13:43

Hi Rob

I am still testing this problem, now running version 9572 from today.

You suggested that I should clear Overwrite status.

So this is my test with Overwrite status = false, still with the first pair of sensors defined.

If the sensors go on after switch move
Click in Rocview: It works but it still has the flip back to the old position when the old sensor goes off. There must be a unwanted event.
If I then use LH100, the switch moves to new position on layout and on Rocview, but turns on red background. It seems to me that Rocrail
despite of showing the correct position still thinks that is should be in the opposite position. Clicking in Rocview confirms this
as the first click does not switch but just removes the red background.

After switching with LH100 it is not possible to set a route. Rocrail has internbally the right position for the route, but the
switch has the opposite on the layout and in Rocview, but with the red background. Clicking the switch in Rocview makes the route possible.
Using Automatic/Reset all removes the red background, sets the position i Rocview to the internally position. Which both are wrong as
the switch still is in opposite position on the layout.

I do not understand why Rocrail internally holds the opposite position of what is shown in Rocview.

Futhermore I would like Rocview to show the red background while the position is undefined during switching with LH100 or other
not-Rocview devices

Setting Overwrite status=true just removes the red background after switching with LH100 but has the same problems and errors.


If a sensor does not go of after switch move
Click in Rocview: Moving to a position with a sensor that goes on works. There is no flip back to the old position (there was no old sensor to go off
as the sensor was off already). This must mean that the unwanted event is connected to the event of the old sensor going off.
Moving to the opposite position with no sensor going on results in red background and flip back to old position (now the was a sensor to off).
The new position is not shown.
Switching with LH100 from this incorrect position switches the switch on the layout, but the position and red background does not change
at all.
Again Rocrail must hold an internal position to be "the right one" disregarding the layout and Rocview.


Regards
Erik

rjversluis
Site Admin
Posts: 42364
Joined: 10.04.2006, 08:48
Location: Speyer, Germany
Contact:

Re: Click twice to turn a switch

Post by rjversluis » 03.08.2015, 15:44

Hi Erik,

I must setup a test environment, but you have to wait until coming weekend.

Or can you create a sequence diagram of the signals and movements?
It must be reproducible with virtual sensors.

ejp
Posts: 117
Joined: 01.10.2012, 08:20
Location: Denmark

Re: Click twice to turn a switch

Post by ejp » 03.08.2015, 18:10

Hi Rob

Next weekend is quite allright.

It works as in my test with virtual sensors, so I will tomorrow make an issue and a description for you.

Regards
Erik

ejp
Posts: 117
Joined: 01.10.2012, 08:20
Location: Denmark

Re: Click twice to turn a switch

Post by ejp » 04.08.2015, 13:29

Hi Rob

Attached is the issue used in my tests.


The plan consists of 1 switch with 2 sensors indicating each position placed on the corresponding side of the switch.
In my tests the switch was a real switch on the layout and the sensors were the sensors attached to the motor drive
using LR101 to report status.

There are 2 dummy sensors without matching LR101 addresses used to indicate sensors constantly off.

In your case where you simulate the sensors (addresses of the sensors must not match real addresses) you do not need these dummy sensors.

Normal start of the test were:
1. Switch set to straight
2. Sensor straight set to on
3. Sensor turnout set to off
4. No routes set
5. No locomotive assignment

In the following a * means status what I think is an error

To perform the test showing the flip (unwanted event):
1. Set to normal start
2. Click switch - switch moves to turnout - * Rocview shows turnout - red background is set * but sometimes only as long as the cursor points to the switch
3. Set sensor straight to off - switch does not move - * Rocview flips to show straight - red background is set * but sometimes disappears if the cursor points to the switch
4. Set sensor turnout to on - switch does not move - Rocview shows turnout - red background disappears


To perform the test switching with LH100:
1. Set to normal start
2. Switch on LH100 - switch moves to turnout - Rocview still shows straight
3. Set sensor straight to off - switch does not move - Rocview still shows straight - * red background is not set
4. Set sensor turnout to on - switch does not move - Rocview shows turnout - * red background is set but disappears if the cursor points to the switch - * afterwards an extra click is needed to switch in Rocview


If sensors are defined for a switch:

1. Sensors should always be defined in pairs and reported as an error in check plan health if not. If one sensor in a pair is missing Rocrail should internally define the other as the first but inverted.
2. If the switch is switched in Rocview or wanted to be switched by a route setting, Rocview should show red background until the new sensor is set to on. The position should be set to the old one as long as the old sensor is on. When the old sensor goes off, the position could be set to the new one.
3. If not during switching in Rocrail, Rocrail should accept the sensors as showing the switch position.
4. If not during switching in Rocrail. Rocview should show red background if both sensors are set to off or both sensors are set to on. If there are 2 pairs, the sensors are anded to reflect position.
5. If these 4 statements are true Rocview will always report the actual status no matter the switching method. And in addition a red background if switching is in progress by Rocrail.

If you agree in these statements I believe that route setting will be fixed too, so I will not make a detailed description of this, unless you want it.
And in addition I do not think that the option Overwrite status is needed. The new way of showing is more correct and the red background always signals switching or error.

And finally switching with contacts outside the controller also will show correct position. But of course switching with LH100 and contacts cannot check for locked switches.

I hope my test description is detailed enough.


Regards
Erik
You do not have the required permissions to view the files attached to this post.

rjversluis
Site Admin
Posts: 42364
Joined: 10.04.2006, 08:48
Location: Speyer, Germany
Contact:

Re: Click twice to turn a switch

Post by rjversluis » 04.08.2015, 14:26

Hi Erik,

I do not see an error in the flow of events and representation.
(Maybe you are testing in edit mode?!)

A) Initial start:
S06 = straight
S06straight = off
S06turnout = off

B) After query sensor at startup:
S06 = straight
S06straight = on
S06turnout = off

C) Click on the switch:
S06 = left + red background
S06straight = on
S06turnout = off

D) The straight sensor goes off and make the field status undefined which is represented as straight:
S06 = straight + red background
S06straight = off
S06turnout = off

E) The turnout sensor goes on:
S06 = left
S06straight = off
S06turnout = on

Only step (D) could be improved by showing the wanted position.

ejp
Posts: 117
Joined: 01.10.2012, 08:20
Location: Denmark

Re: Click twice to turn a switch

Post by ejp » 04.08.2015, 17:16

Hi Rob

OK, when switched by Rocview it all ends up correct. My suspicion of an incorrect event was luckily wrong.

But you haven't made a comment on the rest of my note.

Regards
Erik

ejp
Posts: 117
Joined: 01.10.2012, 08:20
Location: Denmark

Re: Click twice to turn a switch

Post by ejp » 08.08.2015, 08:32

Hi Rob

An extra observation.

I see 2 kinds of switches. One without sensors and another with sensors.

My observations are based on my Lenz LZV100, LI-USB, LH100 and finally LR101 to report the sensors.

Switch without sensor
- When I click the switch in Rocview, the switch immediately switches to the new position in Rocview.
- When I switch from LH100, the switch immediately switches to the new position in Rocview.
In both cases route setting is based on this new position.


Switch with sensor
- When I click the switch in Rocview, the switch immediately switches to the new position in Rocview, turns on the red background and when the sensor reports the new position, the red background disappears.
- When I switch from LH100, the switch still shows the old position in Rocview until the new sensor reports on. Then the new position is shown and the red background is shown. Only when switched back on LH100 or clicked on Rocview (which does not move the switch) the red background disappears.
In the first case route setting is based on this new position. In the last case with LH100 Rocrail first accepts the new position after click in Rocview. Until then route setting is blocked.

Why does Rocrail in the case with LH100 accept a new position claimed by the CS and not the position confirmed by sensor?

The claiming does not guarantee the position as it just reports the position switched to.
The sensor guarantees the new position with information from the switch motor or from the switch itself.

The sensor must be the most correct one.

Regards
Erik

rjversluis
Site Admin
Posts: 42364
Joined: 10.04.2006, 08:48
Location: Speyer, Germany
Contact:

Re: Click twice to turn a switch

Post by rjversluis » 08.08.2015, 12:48

Hi Erik,

the switch sensors can only be evaluated by the initiator.
If you set a switch with the Lenz Throttle Rocrail does not know the wanted position of the Throttle and will still use its last known wanted position.
If the wanted position is mangled by an external throttle and the background will show red.

You need a throttle which is capable to inform Rocrail of a new wanted position.

This issue is from my point of view solved and is based on a misunderstanding.

ejp
Posts: 117
Joined: 01.10.2012, 08:20
Location: Denmark

Re: Click twice to turn a switch

Post by ejp » 08.08.2015, 13:27

Hi Rob

OK, I will have to accept your oppinion of a misunderstanding. :(

But I still do not understand why Rocrail does accept the position sent from CS on basis of LH100 with no sensors and does not accept the position from the sensors when switched in exactly the same manner.

Why is there a wanted position when using sensors and not when using no sensors?
Why cannot Rocrail accept a position confirmed by the sensor as wanted?
Why must a throttle be capable of both reporting the switch position and a "wanted" position? I have never heard of a "wanted" state in the Lenz world. To me an actual position is the same as a wanted position unless the switch is being switched or a route is being set and therefore locked for other purposes.


On LH100 the position is shown correctly both when switched from Rocview and from LH100.

I will close this issue as the original issue is solved.

Regards
Erik

rjversluis
Site Admin
Posts: 42364
Joined: 10.04.2006, 08:48
Location: Speyer, Germany
Contact:

Re: [Solved] Click twice to turn a switch

Post by rjversluis » 08.08.2015, 13:57

Hi Erik,

Rocrail is master and if it has a wanted position for a switch it won't change that because of an external throttle interruption.
The LH100 triggers a field event which does not fit to the wanted position of Rocrail.
If you do not like this you should remove the switch sensors and set the servo speed to max.

ejp
Posts: 117
Joined: 01.10.2012, 08:20
Location: Denmark

Re: [Solved] Click twice to turn a switch

Post by ejp » 08.08.2015, 16:24

Hi Rob

Maybe I have found a solution that works for me in my environment. :)

For every switch with sensors I create 2 actions, one to switch to turnout, another to switch to straight

For the sensors defined in switch/wiring I define action control for the on-state, that executes the action to the position the sensor belongs to.

This way I automatically set the wanted position to the position confirmed by the sensor.

Until now I have found no problems with solution.

Regards
Erik

Post Reply

Return to “Basic topics”