PlasticsDude Posted March 10, 2007 Report Posted March 10, 2007 Anobody have a link to a good explanation of how to set an RTC (real time clock) using BCD time and date? For example, 16#02 is the year 2002, why?
BobB Posted March 10, 2007 Report Posted March 10, 2007 That would depend on the PLC. What are you using? It looks like the 16 is an addative for a fixed figure. In other words, there is a base that the 16 is added to.
BobB Posted March 11, 2007 Report Posted March 11, 2007 Have never used one but I believe my previous remarks are probably the basis for the addition. Your local Siemens rep should be able to tell you straight away.
panic mode Posted March 12, 2007 Report Posted March 12, 2007 seams they only use last two digits so 2002 becomes 02 (could be 1902 if PLCs existed at that time and it can be 2102, 2202 etc but this in another hundred or two hundred years). prefix 16# should indicate format (16-bit value)
504bloke Posted March 28, 2007 Report Posted March 28, 2007 You could always convert from decimal to bcd using the I_BCD and BCD_I function. Then do the clock in real units.
Crossbow Posted March 28, 2007 Report Posted March 28, 2007 In S7-200, the 16# in front is telling the PLC the data is in the HEX format. BCD format is same as Hex except doesn't go above 9. Without that, PLC assume it's decimal, which would result in different bits being turned on in the word.
504bloke Posted April 2, 2007 Report Posted April 2, 2007 If you try this library function then you can access the clock in real decimal format.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now