Convert BCD HEX to INT and back
Posted: Wed Feb 29, 2012 5:37 am
Hello,
i need convert date tag from PLC in BCD HEX format to the decimal INT format and back (INT to BCD HEX, for example:
from PLC tag: 0x1202 (= 4610 Int) i need
YEARtag: 12 Int
MONTHtag: 02 Int
(not YEARtag: 46 and MONTHtag: 10 )
I find some C# script, for example:
http://icodesnip.com/snippet/csharp/con ... into-bytes
but i can not implement this to the IX developer - script modules...
Thanks for any advice and sorry for my english )
i need convert date tag from PLC in BCD HEX format to the decimal INT format and back (INT to BCD HEX, for example:
from PLC tag: 0x1202 (= 4610 Int) i need
YEARtag: 12 Int
MONTHtag: 02 Int
(not YEARtag: 46 and MONTHtag: 10 )
I find some C# script, for example:
http://icodesnip.com/snippet/csharp/con ... into-bytes
but i can not implement this to the IX developer - script modules...
Thanks for any advice and sorry for my english )