Posted 21 Apr 2017 Dear all, did anyone did this before. Actually I require to store the weighing reading in hex in order for SCADA to read. But now the weighing value is in decimal format. For example: Indicator display 1234 KG suppose I need to store this value in 1234(hex) in data register, but now is 1234(decimal). Does anyone here know how to do it? or can i do it manually? i have no idea on how to convert it. Share this post Link to post Share on other sites
Posted 21 Apr 2017 Decimal = 1234 kg Hex => 1234/16 = 77 plus remainder of 2; next...77/16 = 4 plus remainder 13 (which is D); next...4/16 = 0 plus remainder 4. Thusly, Decimal 1234 = Hex 4D2 http://www.rapidtables.com/convert/number/decimal-to-hex.htm http://www.permadi.com/tutorial/numDecToHex/ Share this post Link to post Share on other sites
Posted 22 Apr 2017 On 4/21/2017 at 9:29 PM, kaiser_will said: Decimal = 1234 kg Hex => 1234/16 = 77 plus remainder of 2; next...77/16 = 4 plus remainder 13 (which is D); next...4/16 = 0 plus remainder 4. Thusly, Decimal 1234 = Hex 4D2 http://www.rapidtables.com/convert/number/decimal-to-hex.htm http://www.permadi.com/tutorial/numDecToHex/ Hi, yes, I got 4D2 when displaying in hex. But what i need is I need to show 1234kg in hex instead of 4D2. Share this post Link to post Share on other sites
Posted 23 Apr 2017 (edited) Convert decimal number to BCD and display in Hex 1234 (decimal) = 0001001000110100 (BCD) 0001001000110100 (BCD) displayed in HEX format = 1234(hex) Edited 23 Apr 2017 by Moggie Share this post Link to post Share on other sites
Posted 24 Apr 2017 23 hours ago, Moggie said: Convert decimal number to BCD and display in Hex 1234 (decimal) = 0001001000110100 (BCD) 0001001000110100 (BCD) displayed in HEX format = 1234(hex) Hi, thank you very much for your help. But i found that there is no function block in my Panasonic PLC can perform this function. So is that means i need to do it manually, for example, write a calculation function for this conversion? or is there any better way to do this? Share this post Link to post Share on other sites
Posted 24 Apr 2017 55 minutes ago, alpha91 said: Hi, thank you very much for your help. But i found that there is no function block in my Panasonic PLC can perform this function. So is that means i need to do it manually, for example, write a calculation function for this conversion? or is there any better way to do this? What model PLC are you using - or look at P80(BCD) / P82(DBCD) Share this post Link to post Share on other sites
Posted 24 Apr 2017 exactly... https://www.panasonic-electric-works.com/cps/rde/xbcr/pew_eu_en/mn_63489_0050_en_fpwinpro_programming.pdf Share this post Link to post Share on other sites
Posted 25 Apr 2017 9 hours ago, Moggie said: What model PLC are you using - or look at P80(BCD) / P82(DBCD) Hi, it works! with the P80. Thank you very much. May I know what is happening for this function? Sorry that i rarely do data conversion. I just roughly get the concept. Is it the current decimal i reading now is BCD? 9 hours ago, panic mode said: exactly... https://www.panasonic-electric-works.com/cps/rde/xbcr/pew_eu_en/mn_63489_0050_en_fpwinpro_programming.pdf Hi, thank you very much for the manual. Share this post Link to post Share on other sites
Posted 25 Apr 2017 http://www.computerhope.com/jargon/b/bcd.htm Share this post Link to post Share on other sites