Sign in to follow this  
Followers 0
helfire75

Convert 7 digit ascii (hex) to 32 bit Dword (dec)

2 posts in this topic

Dear all,

please can somebody help me out with the folowing challenge:

plc , Q06UDEHCPU

prog: GX Developer 

I recieve a 7 digits AScii ( HEX) code from a scanner and need to send these numbers to a Cognex  in the 32 bits decimal Double word.

There is an instruction from Ascii ( HEX) to Dword (HEX)   DHABIN  but i need it in (DEC). 

i also can pick out al the 7 carracters out if the ascii string and put them in a word but then i still have two 16 bit words and stil no 32bit Dword.

scanner does only send  0-9 and no other carracters

 

somebody have a good way to solve this ? that would be great!

 

Helfire

Share this post


Link to post
Share on other sites

Certainly. What prevents you to use DDABIN instruction? Before the conversion, just move the datablock, given from the scanner, into an array of 6 words. Then, using the DDABIN convert the array into 2 integers (DWORD).

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