Xpressnet: Output deactivation issue

thera
Posts: 97
Joined: 27.11.2013, 20:13
Location: Seville, Spain

Xpressnet: Output deactivation issue

Post by thera » 04.05.2015, 19:42

Hi Rob,

I'm using a CS connected to rocrail using xpressnet protocol.

I've surprised because output devices did not work properly. Activation was succesfully preformed from rocrail, but deactivation never was performed from rocrail. Debugging the messages I can see deactivaction messages never were sent.

So a sample layout consisting of only an output was prepared, and the useful python script lieth.py was used as protocol register.

Tar file with required information is attached. Script output is also added.

Studying the code I've found that in '27 May 2010' the xpressnet.c file was updated with 'delayed commands thread added for accessory decoders' comment, deleting deactivation code and adding delayed deactivation, perhaps it was a mistake.

A working copy is downloaded and the deactivation code has been recoded.

The change seems as correct. Further tarfile is attached containing correct behaviour.

I would be delighted if you could check this issue.
You do not have the required permissions to view the files attached to this post.

thera
Posts: 97
Joined: 27.11.2013, 20:13
Location: Seville, Spain

Re: Output deactivation issue

Post by thera » 12.05.2015, 22:21

Am I the only one with this problem?

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

Re: Output deactivation issue

Post by rjversluis » 13.05.2015, 08:00

Hi Tomas,

only switches kann be configured for auto deactivation.

thera
Posts: 97
Joined: 27.11.2013, 20:13
Location: Seville, Spain

Re: Output deactivation issue

Post by thera » 13.05.2015, 08:15

Good morning Rob,

I know that. But reading the code, It seems deactivation message is always enqueued and only Output ON Cmd is translated.

Sorry if I am wrong.

Thanks in advance.

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

Re: Output deactivation issue

Post by rjversluis » 13.05.2015, 15:51

Hi Tomás,

you are right!
I just corrected it. Please report because I have no possibility to test it.

thera
Posts: 97
Joined: 27.11.2013, 20:13
Location: Seville, Spain

Re: Output deactivation issue

Post by thera » 13.05.2015, 17:52

Thanks Rob for the quick change.

I'll test the change as soon as possible, but now my layout has electrical problems. I hope this week end that issue will be corrected.

thera
Posts: 97
Joined: 27.11.2013, 20:13
Location: Seville, Spain

Re: Output deactivation issue

Post by thera » 16.05.2015, 17:49

Hi Rob,

the powering issues were solved, so your changes has been tested.

I thing it is wrong because the fourth bit in outa[2] must be 0 to activate, and 1 to deactivate the output.
Switching commands can only be sent to switching decoders. The address is turnout / 4 (group). The
offset in the group and which of the 2 outputs has to be activated or deactivated has to be defined. This is
done with the bits D1 B1 B0 and D2 in data 2.
B1 and B0: These are the two LSB ́s which are the rest of the division by 4.
D1:
D1 = 0 means activate output.
D1 = 1 means deactivate output.
D2:
D2 = 0 means use output 1 of the selected turnout.
D2 = 1 means use output 2 of the selected turnout.
(XpressNet Manual)

I've change the my local copy of code and it seems correct.

Thanks.

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

Re: Output deactivation issue

Post by rjversluis » 16.05.2015, 21:47

can you show your local copy?

thera
Posts: 97
Joined: 27.11.2013, 20:13
Location: Seville, Spain

Re: Output deactivation issue

Post by thera » 16.05.2015, 22:04

Hi Rob,

just change the logic,

Code: Select all

  if (StrOp.equals( wOutput.getcmd( node ), wOutput.on )){
      byte* outa = allocMem(32);
      outa[0] = 0x52;
      outa[1] = addr;
      outa[2] = 0x80 | 0x00 | (port << 1) | gate;
      ThreadOp.post( data->transactor, (obj)outa );
    }
    else {
      byte* outa = allocMem(32);
      outa[0] = 0x52;
      outa[1] = addr;
      outa[2] = 0x80 | 0x08 | (port << 1) | gate;
      ThreadOp.post( data->transactor, (obj)outa );
    }
Thanks.

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

Re: Output deactivation issue

Post by rjversluis » 17.05.2015, 07:06

Hi Tomás,

OK, I changed it too now.

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

Re: Output deactivation issue

Post by rjversluis » 27.05.2015, 15:34

Hi Tomás,

there are problems with this change in Xpressnet operations:
http://forum.rocrail.net/viewtopic.php?f=47&t=9644
I'm afraid I have to revert it.

thera
Posts: 97
Joined: 27.11.2013, 20:13
Location: Seville, Spain

Re: Xpressnet: Output deactivation issue

Post by thera » 27.05.2015, 16:26

Sorry, but I can not understand german.

Which is the problem? Could be compatible with output deactivation?

Thanks.

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

Re: Xpressnet: Output deactivation issue

Post by rjversluis » 27.05.2015, 16:35

Simple signals are translated in output commands.
Since the output commands have been changed in Xpressnet the signals do no longer work for Alois.
I think the implementation is OK now but I cannot check the issue of Alois and his signals.

I am in between a rollback of the Xpressnet changes and desperation.

thera
Posts: 97
Joined: 27.11.2013, 20:13
Location: Seville, Spain

Re: Xpressnet: Output deactivation issue

Post by thera » 27.05.2015, 16:42

OK, don't worry. Because I'm using a self compiled version I can wait without problems until solution will be achieved.

Thanks.

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

Re: Xpressnet: Output deactivation issue

Post by rjversluis » 27.05.2015, 16:44

Thats not a solution.
I cannot test it because I do not have the Hardware Alois has.

Post Reply

Return to “Lenz”