outputs, switches, addresses and srcp

Moderator: Moderators

Postby rjversluis » 22.05.2013, 15:39

What should change?...
Best Regards, Rob.
:!: PS: Do not forget to attach the usual files.
:!: PS: Nicht vergessen die übliche Dateien an zu hängen.
[ macOS - Linux] - [ N: CBUS - CANGCx ] - [ G: CBUS - CANGCx ]
rjversluis
Site Admin
 

Postby Richard-TX » 22.05.2013, 15:46

Here is what I am saying is needed,


Image
Richard-TX
 

Postby rjversluis » 22.05.2013, 15:52

OK, and the other direction of the switch?
Best Regards, Rob.
:!: PS: Do not forget to attach the usual files.
:!: PS: Nicht vergessen die übliche Dateien an zu hängen.
[ macOS - Linux] - [ N: CBUS - CANGCx ] - [ G: CBUS - CANGCx ]
rjversluis
Site Admin
 

Postby Richard-TX » 22.05.2013, 16:14

The other direction would be

SET 4 GA 1 2 1 -1
Richard-TX
 

Postby rjversluis » 22.05.2013, 16:23

Thats for single gate switches.
Commonly switches are controlled by two coils; One for straight and one for thrown.

SET 4 GA 2 0 1 -1 (Gate green)
SET 4 GA 2 1 1 -1 (Gate red)

Yes, I know its weird. But you have to live with that when using certain protocols including SRCP.
Last edited by rjversluis on 22.05.2013, 16:25, edited 1 time in total.
Best Regards, Rob.
:!: PS: Do not forget to attach the usual files.
:!: PS: Nicht vergessen die übliche Dateien an zu hängen.
[ macOS - Linux] - [ N: CBUS - CANGCx ] - [ G: CBUS - CANGCx ]
rjversluis
Site Admin
 

Postby Richard-TX » 22.05.2013, 16:23

Image
Richard-TX
 

Postby rjversluis » 22.05.2013, 16:27

Just use the single gate option for switches and you'll be happy.
Best Regards, Rob.
:!: PS: Do not forget to attach the usual files.
:!: PS: Nicht vergessen die übliche Dateien an zu hängen.
[ macOS - Linux] - [ N: CBUS - CANGCx ] - [ G: CBUS - CANGCx ]
rjversluis
Site Admin
 

Postby Richard-TX » 22.05.2013, 16:46

sort of....

here is a switch with an address of 2 and a port of 5 set to single gate.

SET 2 GA 9 0 0 -1 <- OFF

SET 2 GA 9 0 1 -1 <- ON


I think it should have been

SET 2 GA 2 5 1 -1 <- ON

SET 2 GA 2 5 0 -1 <- OFF
Last edited by Richard-TX on 22.05.2013, 16:58, edited 1 time in total.
Richard-TX
 

Postby rjversluis » 22.05.2013, 16:53

I shortly will give up on you.
You did read the SRCP specs which shows you a valid port range of 0-1.
Any questions? Use the SRCP Forum. :-(
Best Regards, Rob.
:!: PS: Do not forget to attach the usual files.
:!: PS: Nicht vergessen die übliche Dateien an zu hängen.
[ macOS - Linux] - [ N: CBUS - CANGCx ] - [ G: CBUS - CANGCx ]
rjversluis
Site Admin
 

Postby rjversluis » 22.05.2013, 17:08

Code: Select all
    addr = (mod-1)*4+pin;

    if( wSwitch.issinglegate(node) ) {
      action = StrOp.equals( wSwitch.getcmd( node ), wSwitch.turnout ) ? 1:0;
      StrOp.fmtb( srcp, "SET %d GA %d %d %d %d\n", ga_bus, addr, wSwitch.getgate1(node), action, -1 );
    }

No need to change anything.
Best Regards, Rob.
:!: PS: Do not forget to attach the usual files.
:!: PS: Nicht vergessen die übliche Dateien an zu hängen.
[ macOS - Linux] - [ N: CBUS - CANGCx ] - [ G: CBUS - CANGCx ]
rjversluis
Site Admin
 

Postby Richard-TX » 22.05.2013, 17:16

rjversluis wrote:I shortly will give up on you.
You did read the SRCP specs which shows you a valid port range of 0-1.
Any questions? Use the SRCP Forum. :-(


The restrictions on port numbers is based on protocol.

Page 18 of the document at http://srcpd.sourceforge.net/srcp/srcp-084.pdf says this:


"Protocol by server
The server uses the initialisation parameters from its own configuration. The parameter list MAY
give some parameters. Address, port and value [action] are not limited."

When srcpd is talking to a DCC controller, then the following applies:

"NMRA-DCC Format
Valid addresses are from 1 to 511, valid ports are 0 or 1, valid values are: 0 and 1"

When srcpd is talking to a Selectrix then the following applies:

"Selectrix Format
Valid addresses are from 0 to 111, valid ports are 1 to 8..."

So, the way I interpret this is that if a srcpd bus is defined as NMRA/DCC, then the DCC limits will be enforced by srcpd for that bus. Same thing applies when a Selectrix bus if configured.

It isn't up to the client (Rocrail) to enforce anything. Srcpd will tell the client (Rocrail) if the user has configured something out of bounds for the bus in question.

What am I missing?
Richard-TX
 

Postby rjversluis » 22.05.2013, 17:28

Hi Richard,

I changed it in 5263; 1:1 Addressing.

In case any other SRCP user will cry in this forum: You are for this matter the moderator.
Best Regards, Rob.
:!: PS: Do not forget to attach the usual files.
:!: PS: Nicht vergessen die übliche Dateien an zu hängen.
[ macOS - Linux] - [ N: CBUS - CANGCx ] - [ G: CBUS - CANGCx ]
rjversluis
Site Admin
 

Postby Richard-TX » 22.05.2013, 17:29

rjversluis wrote:Thats for single gate switches.
Commonly switches are controlled by two coils; One for straight and one for thrown.

SET 4 GA 2 0 1 -1 (Gate green)
SET 4 GA 2 1 1 -1 (Gate red)

Yes, I know its weird. But you have to live with that when using certain protocols including SRCP.


The srcpd connected switches that require two coils or other special address will be handled by the protocol device "driver" within srcpd.

Depending on the device driver within srcpd, all manner of command processing is done. The one that is most notable at this time is the I2c-dev device withing srcpd. That one is fairly ugly.

While I have not looked at the DCC driver, I could and that might help clarify things for me and possibly others.
Richard-TX
 

Postby Richard-TX » 22.05.2013, 17:39

rjversluis wrote:Hi Richard,

I changed it in 5263; 1:1 Addressing.

In case any other SRCP user will cry in this forum: You are for this matter the moderator.


Rob,

If I wind up eating my words so to speak, I will buy you dinner for 2 someplace nice. There is no reason why your have to "eat crow"* if I do! :D

Does that sound good to you?

Richard - who has to go and modify his Rpi controller code.

*http://en.wikipedia.org/wiki/Eating_crow
Richard-TX
 

Postby Richard-TX » 22.05.2013, 17:45

Richard-TX wrote:
While I have not looked at the DCC driver, I could and that might help clarify things for me and possibly others.


I gave the srcpd dcc/nmra driver a perusal. It made my head hurt! Lots of bit manipulation going on.
Richard-TX
 

Previous

Return to srcp