Bidiretional comunications with NanoX central

Post Reply
rjversluis
Site Admin
Posts: 42309
Joined: 10.04.2006, 08:48
Location: Speyer, Germany
Contact:

Post by rjversluis » 04.05.2009, 06:06

Hi Nicola,

can you provide traces and layout file to document this behavior?

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

Post by rjversluis » 05.05.2009, 14:04

Hi Nicola,

I tested without a connected Lenz CS and with dummyio activated.
The byte trace shows different addresses for sw1 and sw2 send on the xPressNet.

Are you sure the switch decoder is setup correctly?

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

Post by rjversluis » 06.05.2009, 06:15

Hi Nicola,

I do not know if Windigipet evaluates the turnout feedback comming from the NanoX because those events are setting the turnout positions in the Rocview.

If you see this in the rocrail trace:

Code: Select all

20090424.220431.010 r9999c cmdr00EA OSwitch  0512 Switch [Sw1] will be set to [straight]
20090424.220431.020 r9999I 000007BC OLenz    0574 gate 0 0 
20090424.220431.020 r9999c 000007BC OLenz    0587 turnout 1 1 straight
20090424.220431.100 r9999I 00000498 OSwitch  0880 field state=straight
20090424.220431.100 r9999I 00000498 OSwitch  0880 field state=turnout
The NanoX responds with two "field state" events after sending a command for only one switch.

If you activate the debug trace level you also will see the addresse which NanoX sends back.

So I am very sure that the problem is the NanoX.
But it would be nice if someone with a real Lenz CommandStation can confirm this.

ron&bram
Posts: 2460
Joined: 11.06.2008, 19:34
Location: Heemskerk, Netherlands

Post by ron&bram » 06.05.2009, 16:22

Hi Nicola,

I checked the sourcecode and the xpressnet protocol specification and can only agree with Rob. The Nano-X is generating a lot of turnout position messages after setting a turnout. In case the Nano-X does the reporting based upon the feedbacks attached to the turnouts there is need for some "contact debouncing" in the firmware.

Best regards,
Ronald

P.S.
I saw that Rob is working on a change in the code so that you can see which turnout is generating all the messages form the Nano-X.

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

Post by rjversluis » 10.05.2009, 15:34

Hi Nicola,
My doubt is, may be RocRail incorrectly...
Could be, but as long as it works OK with a Lenz (or compatible) Command Station I will not investigate.

ron&bram
Posts: 2460
Joined: 11.06.2008, 19:34
Location: Heemskerk, Netherlands

Post by ron&bram » 10.05.2009, 19:48

Hi Rob,

I checked the Lenz code and I think Nicola does have a point, the situation that the command station reports a turnout as not changed position is handled by Lenz.c as postition is turnout.

In detail:

The reponse byte in the format of I TT N Z3 Z2 Z1 Z0 is handled as follows:

Code: Select all

if TT = 00 or TT = 01 {  //accessory decoder
  if N = 0
    addressoffset = 1
  else
    addressoffset = 3
  report Z0 as turnout position
  report Z2 as turnout position
}
In Xpressnet the Z1Z0 (or Z3Z2) combination is specified as follows:
00 turnout has not been controlled
01 last command was 0
10 last command was 1
11 invalid

A possible solution could be:

Code: Select all

if TT = 00 or TT = 01 { //accessory decoder without/with feedback
  if N = 0              //lower nibble
    addressoffset = 1
  else
    addressoffset = 3
  if (Z0 + Z1) == 1     //valid position
      report Z0 as turnout position
  if (Z2 + Z3) == 1
      report Z2 as turnout position
}
I can have a go at implementing something like the above, if you agree and if Nicola is willing to test.

@Nicola:
When Rob agrees, please give me the exact version of Rocrail you are using, the operating system Rocrail runs under and your email address via PM.

Best regards, Ronald
Last edited by ron&bram on 10.05.2009, 19:55, edited 1 time in total.

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

Post by rjversluis » 10.05.2009, 19:54

Hi Ronald,

I agree with the test.
I did not check the xPressNet protocol, but it could make sense.

ron&bram
Posts: 2460
Joined: 11.06.2008, 19:34
Location: Heemskerk, Netherlands

Post by ron&bram » 10.05.2009, 20:01

Hi Rob,

Despite all the enjoyfull exercises with Roco.c and Mcs2.c I still have a weak spot in my heart for Lenz.c, probably because of the very positive first encounter with Rocrail due to the enormous good coorporation with Jean-Michel in getting into grips with the Hornby Elite. I tend to dig a little deeper into user problems related to Lenz (and ofcourse I have not forgotten all of the way the code is written).

Best regards, Ronald

Post Reply

Return to “Lenz”