Wan Afifi

How to convert ascii to real number or bcd

3 posts in this topic

Now I working on omron CP1H PLC, i'm receiving ASCII number from another PLC which is something like this  "#3031 #3030 #3030 #3030" which mean 01000000. How to convert the ascii number to real number or bcd without separate them? I know how to convert them which is using HEX but its turn out the number will separate into this 0100  and 0000.

Edited by Wan Afifi

Share this post


Link to post
Share on other sites

@Wan Afifi Assume that your result in D100 (0100) and D101 (0000) maybe you multiply D100 by 10000 then sum with D101 to be

(100 * 10000) + 0000 = 1000000

1 person likes this

Share this post


Link to post
Share on other sites

Thank You, very much Mr@Wasan , thank you for enlighten me.. now I get the idea of it. Now I'm able to create 01000000 without separate it.

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