I have a device I am trying to collect data from via modbus into controllogix system. I am using a prosoft mvi56-mcm card and have established comms to the device and am able to pull values. The problem is that I have a few data points that are presented in BCD format. I am really stumped on what I need to do to get this data presented properly in the controllogix. I have never had a device that uses BCD like this.
These are the registers from the manual
pages 120-121
http://www.yzsystems.com/StaticFiles/MRContent/StaticFiles/YZSystem/Models/8300L NJEX 02052004 ATEX Rev.pdf
This is the formatting info referenced on registers 40015 and 40016
I am using the 8300 model which should show the data as xx.xx. From what I understand the data in 40016 low register should count up then rollover into the 40015 register and combining these two would represent the total. Same for the other registers except it doesn't have an implied decimal?
I guess my questions are as follows:
I am assuming that the value in register 40016, which is 863 at this time, represents the integer version of the binary bcd representation of the data. How can I convert this to the proper real number from bcd? I have found the FRD instruction that appears to take a bcd number and convert to decimal. Is it that easy to feed the integer that I am receiving from the device and then run it thru this instruction?
These are the registers from the manual
pages 120-121
http://www.yzsystems.com/StaticFiles/MRContent/StaticFiles/YZSystem/Models/8300L NJEX 02052004 ATEX Rev.pdf
40013 Stroke Count High(0000-9999) – BCD
40014 Stroke Count Low (0000-9999) – BCD
40015 Total Odorant Injected High (0000-9999) – BCD *See formatting info.
40016 Total Odorant Injected Low (0000-9999) – BCD *See formatting info.
This is the formatting info referenced on registers 40015 and 40016
40015 High bytes only, combine with address 40016 for total odorant injected.
40016 6300 = . XXXX, 7300 = X.XXX, 8300 = XX.XX (lbs/kg) Note: Low bytes only, combine with address 40015 for total odorant injected.
I am using the 8300 model which should show the data as xx.xx. From what I understand the data in 40016 low register should count up then rollover into the 40015 register and combining these two would represent the total. Same for the other registers except it doesn't have an implied decimal?
I guess my questions are as follows:
I am assuming that the value in register 40016, which is 863 at this time, represents the integer version of the binary bcd representation of the data. How can I convert this to the proper real number from bcd? I have found the FRD instruction that appears to take a bcd number and convert to decimal. Is it that easy to feed the integer that I am receiving from the device and then run it thru this instruction?