convert ASCII to Decimal

9 posts in this topic

hai everuone,
I have a problem with ASCII programming.
how or use any command to convert the ASCII value to Decimal ( D40 Value )
I beg you as soon as possible, because I'm pressed for time.
please see the attachment

Share this post

Link to post

Share on other sites

If you are pressed in time, a quickest way is to look the programming manual, that contain the information you need, than to publish the banal question and to wait an answer on forums. Or at least use the search on forum, because before you this question has been asked for several times. All in your hands!

Share this post

Link to post

Share on other sites

I used the function DEVAL first to convert the ASCII string to REAL value, then REAL_TO_DINT to get it in DINT format when building a communication protocol to an old chiller unit.
If you need interger value, use REAL_TO_INT after DEVAL.

Share this post

Link to post

Share on other sites

I'm apologize to all, because I was almost confused to ask anyone else. I only hope in this forum I get the answer, because the program I want to wear on the 25th of December of this month. once again, i am sorry.

Share this post

Link to post

Share on other sites

Dear Bulan,
As said, no problem you can get the answer to your question immediately just by using the search option on this forum or by learning the programming manual.
Please, take in mind, that experts do not have a prejudice to newbies and are glad to help anyone, who has met with difficulties, if the man itself takes efforts to find the answer.

Share this post

Link to post

Share on other sites

Assuming you are using GX Works and only looking for numbers you can use the WTOB instruction to split the two characters into two locations and subtract 30 HEX from each register to give you the number in decimal.