larry818 Posted March 14, 2012 Report Posted March 14, 2012 (edited) Hi, I'm trying to code the "Time Action" function ("Time Switch" in the F900GOT, "Time Clock" to the rest of us...). The manual says the data is BCD, but when I set the time values with GT Designer, it seems it's kind of bastard hex. I've set the times in GT Designer to 9:10:11 When I look at the register values, I get, in hex, 09:10:11 (note, not 09,0A,0B) So, here's what's happening: Hex Dec Bin 09 09 0000 1001 10 16 0001 0000 11 17 0001 0001 Has anyone seen this before? Is there an easy way to deal with it? Thanks! Edited March 14, 2012 by larry818 Quote
larry818 Posted March 14, 2012 Author Report Posted March 14, 2012 Ok, so this is something called "packed bcd"... I guess I get it now... Quote
Crossbow Posted March 14, 2012 Report Posted March 14, 2012 BCD is nothing more than hex that only goes 0-9. If you had a thumbwheel input, it uses 4 inputs per digit. It can only go 0 to 9. To make 10, you need 2 digits. 9 is 1001 10 is 0001 0000 There's nothing packed about it, simply look at it in hex and it will display properly. Quote
larry818 Posted March 15, 2012 Author Report Posted March 15, 2012 http://en.wikipedia.org/wiki/Binary-coded_decimal#Packed_BCD Quote
Crossbow Posted March 15, 2012 Report Posted March 15, 2012 It's just BCD, there are no signs, there are no negative time numbers. I see nothing different in the data than any other string of BCD data. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.