Integer to Hex??

Coops

Member
Join Date
Dec 2004
Posts
103
Slight problem with a Mitsi Q Series PLC, function needed would be BINDHA but this plc does'nt support the use of the function, need to convert from Integer (Bin 16) to HEX data.

What for: It seems that when I convert an integer to ascii it leaves a null/empty space after the ascii i.e A.

Very very annoying, or is there away in which I can just move a HEX value to a memory area or join to integers to form an ascii string?

Please help, i'm going mad.
 
OK, worked out a answer but its not very pratical.

I can store an integer in D600 and another in D601.
Then if I do a swap function on D600, so that the lower 8 bits get transfered to the upper 8 bits and then just add D600 to D601 to get the answer. Therefore 19744 = 204Dh.

I will have to do this about 90 times as i have alot of strings to convert, does anyone know an easier way of doing this?
 
OK, worked out a answer but its not very pratical.

I can store an integer in D600 and another in D601.
Then if I do a swap function on D600, so that the lower 8 bits get transfered to the upper 8 bits and then just add D600 to D601 to get the answer. Therefore 19744 = 204Dh.

I will have to do this about 90 times as i have alot of strings to convert, does anyone know an easier way of doing this?
 
Check Data Processing Instructions like WTOB and BTOW, UNI and DIS, etc.
There is no instructruction BINDHA in Q instruction set (or any other
instruction set). Did you maybe think of BINHA and DBINHA?

Get manual SH_NA080039 from www.meau.com
 
Last edited:
Thanks for the response.

A BTOW is just right for what I need to do...thanks alot.

Thanks Again!!
 
Last edited:

Similar Topics

Hello friends I am reading 32 bytes from a display through ML1500 COM1, configured as ascii and storing in ST file What I am reading is...
Replies
8
Views
3,768
I'm looking for some link or document, to clear some basics formats used in PLC programming to store, read, calculate, compare DATA. I've at...
Replies
7
Views
40,519
Hi Fella's, GOt a problem with a PLC5, I have an integer number....lets say 1234 for example, and I need to convert this to a HEX number and...
Replies
2
Views
2,764
This code's comment say it can convert Hex number to Integer number, but I don't understand how it work, wish you can explain it. Thanks...
Replies
3
Views
2,961
Hi. I'm using a Modbus ProSoft where I basically map data to a big INT array. Example, where GX_I_63HPU is a REAL, MNETC.DATA.WriteData[200] an...
Replies
21
Views
425
Back
Top Bottom