Sign in to follow this  
Followers 0
RTRBURN

ASCII Hex convert to BIN Decimal

8 posts in this topic

I am trying to convert Ascii Hex value to a BIN value but when I try to the DHABIN, HABIN, DDHABIN commands it crashes the CPU. Heres a ex: [HABIN D(ASCII) D(BIN)] Any Ideas. This is on a Q series.

Share this post


Link to post
Share on other sites
DHABIN section of the Q programming manual. Any help?

Share this post


Link to post
Share on other sites
what CPU (part number), what is the exact instruction and parameters (no overlap for example), what is the exact input value that causes crash (is the input code valid hex number, do you get error code 4100 and SM0 bit set)?

Share this post


Link to post
Share on other sites
CPU: Q02HCPU Here is the exact instruction: [DHABIN D4638 D5200] I get the 4100 alarm but my hex values are in the 30h-39h D4638 is data (32 BIT) that is sent in ASCII and the Hex Value is: D4638= H3131 D4639= H3231 Which is a value of 1112, which is displayed on a ASCII display on the GOT, which is all correct.

Share this post


Link to post
Share on other sites
Won't DHABIN used D4638, D4639,D4640 and D4641? Doesn't explain why HABIN doesn't work though.

Share this post


Link to post
Share on other sites
DHABIN: The D means the result is 32 bit. The instruction acts on 4 consecutive 16 bit addresses D4638...D4641. So D4640 and D4641 are likely to be H0000,H0000. Hence the fault. Edited by Veganic

Share this post


Link to post
Share on other sites
Veganic hit this one right on... You must be reading empty words. You don't need the D in front, that will cut it down to 2 words input. And you should move H3030 into the other word (2 zeros). H00 is the code used to terminate a string.

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