Trains.com

Subscriber & Member Login

Login, or register today to interact in our online community, comment on articles, receive our newsletter, manage your account online and more!

Values that can be used in programming CV's

1235 views
5 replies
1 rating 2 rating 3 rating 4 rating 5 rating
  • Member since
    October 2006
  • From: York Maine
  • 133 posts
Values that can be used in programming CV's
Posted by MrMick on Friday, July 15, 2016 11:53 AM

My understanding of programming CV values is that they are restricted to byte values, and not values that are in between byte values:  For example,  I can assign a value of 1, or 2 or 4 or 8 etc to a CV, but not 3 or 7 or 18, because these values are not the values of the bits in a byte.  Yet the nice article by Mat Thompson in the July Model railroader specifies  ranges of values ( e.g., "40 to 60" for the bell function CV) when programming sound decoders. Is my understanding incorrect?

  • Member since
    December 2001
  • From: Trois-Rivieres Quebec Canada
  • 1,063 posts
Posted by jalajoie on Friday, July 15, 2016 12:14 PM

Of course you can assign any value between 0 to 255 to CV. You need to understand binary math. In your ex. a value of 3 = 00000011, a value of 7 = 00000111 and 18 = 00010010. If you want to program 3 in a CV, simply write decimal 3 with your DCC system.

Jack W.

  • Member since
    October 2006
  • From: York Maine
  • 133 posts
Posted by MrMick on Friday, July 15, 2016 12:45 PM

OK, Thanks for clearing that up for me.

  • Member since
    February 2002
  • From: Reading, PA
  • 30,002 posts
Posted by rrinker on Friday, July 15, 2016 5:38 PM

A single byte can be any value between 0 and 255.

Most CVs use that as a range, but there are some exceptions where the range might be say 0-32. Using a value higher than 32 could cause erratic operation. These ranges are usually noted in the decoder instruction manuals.

 Then there is CV29 which is totally different, where individual bits in the byte mean different things. The lighting function CVs are also somewhat like this if you actually take the decimal numbers for each effect and convert to binary, different bit combinations, thius different decimal numbers, indicate different effcts, like flashing, mars light, solid on, flicker, etc.

                     --Randy

 


Modeling the Reading Railroad in the 1950's

 

Visit my web site at www.readingeastpenn.com for construction updates, DCC Info, and more.

  • Member since
    October 2006
  • From: York Maine
  • 133 posts
Posted by MrMick on Friday, July 15, 2016 8:33 PM

Thanks Randy; I think that I was influenced by how CV29 works - I extended that to all the other CVs. It makes sense both that CV29 is different because of what it does,  and that does not extend to many of the others CVs, again bexausse of wht they control- typically a single function such as a bell or light.

  • Member since
    February 2002
  • From: Reading, PA
  • 30,002 posts
Posted by rrinker on Saturday, July 16, 2016 11:26 AM

 Right. Other things, such as momentum values or the start/mid/top speed are absolute values so they aren't restricted to some specific pattern of bits - you just want a number in there.

                  --Randy

 


Modeling the Reading Railroad in the 1950's

 

Visit my web site at www.readingeastpenn.com for construction updates, DCC Info, and more.

Subscriber & Member Login

Login, or register today to interact in our online community, comment on articles, receive our newsletter, manage your account online and more!

Users Online

Search the Community

ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT
Model Railroader Newsletter See all
Sign up for our FREE e-newsletter and get model railroad news in your inbox!