Sign in to follow this  
Followers 0
MIKE31

CONVERSION INTO DECIMAL

9 posts in this topic

HI What instruction is used to convert from bcd , binary or hexa decimal into decimal Thanks

Share this post


Link to post
Share on other sites
Hey Mike Binary to BCD - BCD BCD-Binary - BIN As for converting hex and binary to decimal: Essentially they are a different representation of the same thing i.e you can't convert as such, but you can choose how they're represented. BCD is a different numbering system, whereas hex, bin, dec are different representations of the same thing. Hex - A Dec - 10 Bin - 1010 BCD - 0001 0000 (decimal 10) Make any sense? Pp Edited by ParaffinPower

Share this post


Link to post
Share on other sites
That's an inexact way to explain the different numbering systems. In the PLC world it may be good enough, but you're much better off if you really understand the numbering systems. Binary, decimal, and hexadecimal are all different numbering systems. But, they're all stored in the PLC the same way, as binary. You can change how you see the numbers, but they're always stored in binary. BCD, on the other hand is not a numbering system at all, but a way to represent the decimal system using binary. It was used more commonly in the past to interact between a binary computer system and a decimal human world, back when HMIs were seven segment displays and thumbwheels. BCD isn't used as much since the advent of OITs. So there are only instructions in a PLC for converting between binary and BCD. Everything else is stuck in binary and that won't change.

Share this post


Link to post
Share on other sites
If you place your DM in the symbol table and give them a name you can define the type for that word. If you chosse the wrong type for an instruction it will not display properly.

Share this post


Link to post
Share on other sites
That's cheating!

Share this post


Link to post
Share on other sites
Depends on how much of a masochist you are to yourself I guess. One could consider using the conversions program and Windows calculator as cheating also instead of having to work it all out on paper or with a slide rule - anyone remember them?

Share this post


Link to post
Share on other sites
Although it might be cheating.. it will not always solve the problem when a screen requires BCD etc... Slide rule... yeh i remember them Bob... on old tv progs and museums.... You would remember the Abacus wouldnt' you mate...

Share this post


Link to post
Share on other sites
Yep! Worry beads too.

Share this post


Link to post
Share on other sites
I was joking of course. Although, I believe it is rudimentary in understanding the difference between the data types you are working with and the types you are seeing. I know that you understand them Bob. As for the original poster and anyone else interested, I would suggest reading Jay's Omron Tip #49.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0