You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
yesterday I made my first setup of DCC-EX to test the new turnout decoders from Proto Design Labs. I am using an Arduino Mega and the Arduino Motorshield, no WiFi. The setup process just went smooth without any troubles and quickly I was able to run loco with DCC++ EX Web Throttle. Perfect!
I then connected a Kato N Scale # 4 turnout with an integrated N4L decoder from Proto Design Labs who gets his power from the rails. For test purpose I also connected another Kato turnout with the Digitrax DS51K1 decoder powered from the Main Track too.
The DCC-EX command reference is saying a 1 1 should thrown the turnout. But instead 1 set both turnouts to straight.
a 1 0 => thrown a 1 1 => closed / straight
And that's compliant to the DCC Norm where 0 = thrown and 1 = straight.
I then took a look at the code of DCCEXParser.cpp, line 317:
// Honour the configuration option (config.h) which allows the command to be reversed
#ifdef DCC_ACCESSORY_COMMAND_REVERSE
DCC::setAccessory(address, subaddress,p[activep]==0);
#else
DCC::setAccessory(address, subaddress,p[activep]==1);
#endif
But there is no DCC_ACCESSORY_COMMAND_REVERSE section / definition in config.h. However, there is:
I don't understand why there are two defines and what is the purpose of having two defines. A turnout decoder is mostly a simple accessory decoder, but could be an extended accessory decoder as well. There are no turnout decoders in the specification, only accessory decoders.
DCC_ACCESSORY_RCN_213 in't used at any place in the code.
DCC_TURNOUT_RCN_213 is used in Turnouts.cpp, line 325 to set a flag which is used in setClosedInternal() and it's doing what the comments say. Thrown = 1 when not compliant with RCN_213 and Straight = 1 when compliant with RCN-213.
setAccessory(address, number, activate) in DCC.cpp is sending 1 when activate = true. That is not compliant to NMRA / RCN-213. When activated a 0 has to be send.
I assume DCC_ACCESSORY_RCN_213 should be evaluated in setAccessory and DCC_TURNOUTS_RCN_213 and DCC_ACCESSORY_COMMAND_REVERSE is obsolet as otherwise they would be evaluated in a chain.
As I think DCC-EX should be follow the specifications there should be no define to follow the specification, there should be rather a define for not follow the specifications. So DCC_ACCESSORY_COMMAND_REVERSE is a good idea, but that should be placed where the DCC command is build in DCC::setAccessory() and not when parsing a command line string or throwing a turnout in setClosedInternal().
For "a 1 0" DCCEXParser::parseOne() will call DCC::setAccessory(1, 0, false) which will generate a package is command 0 = thrown. So when no defines are made that is complaint with RCN-213.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
yesterday I made my first setup of DCC-EX to test the new turnout decoders from Proto Design Labs. I am using an Arduino Mega and the Arduino Motorshield, no WiFi. The setup process just went smooth without any troubles and quickly I was able to run loco with DCC++ EX Web Throttle. Perfect!
I then connected a Kato N Scale # 4 turnout with an integrated N4L decoder from Proto Design Labs who gets his power from the rails. For test purpose I also connected another Kato turnout with the Digitrax DS51K1 decoder powered from the Main Track too.
The DCC-EX command reference is saying a 1 1 should thrown the turnout. But instead 1 set both turnouts to straight.
a 1 0 => thrown
a 1 1 => closed / straight
And that's compliant to the DCC Norm where 0 = thrown and 1 = straight.
I then took a look at the code of DCCEXParser.cpp, line 317:
But there is no DCC_ACCESSORY_COMMAND_REVERSE section / definition in config.h. However, there is:
I don't understand why there are two defines and what is the purpose of having two defines. A turnout decoder is mostly a simple accessory decoder, but could be an extended accessory decoder as well. There are no turnout decoders in the specification, only accessory decoders.
DCC_ACCESSORY_RCN_213 in't used at any place in the code.
DCC_TURNOUT_RCN_213 is used in Turnouts.cpp, line 325 to set a flag which is used in setClosedInternal() and it's doing what the comments say. Thrown = 1 when not compliant with RCN_213 and Straight = 1 when compliant with RCN-213.
setAccessory(address, number, activate) in DCC.cpp is sending 1 when activate = true. That is not compliant to NMRA / RCN-213. When activated a 0 has to be send.
I assume DCC_ACCESSORY_RCN_213 should be evaluated in setAccessory and DCC_TURNOUTS_RCN_213 and DCC_ACCESSORY_COMMAND_REVERSE is obsolet as otherwise they would be evaluated in a chain.
As I think DCC-EX should be follow the specifications there should be no define to follow the specification, there should be rather a define for not follow the specifications. So DCC_ACCESSORY_COMMAND_REVERSE is a good idea, but that should be placed where the DCC command is build in DCC::setAccessory() and not when parsing a command line string or throwing a turnout in setClosedInternal().
For "a 1 0" DCCEXParser::parseOne() will call DCC::setAccessory(1, 0, false) which will generate a package is command 0 = thrown. So when no defines are made that is complaint with RCN-213.
I am confused.
Best regards
Klaus
Beta Was this translation helpful? Give feedback.
All reactions