Help me understand BCD value into controllogix via modbus Prosoft MCM Module

diat150

Lifetime Supporting Member
Join Date
Mar 2006
Location
Louisiana
Posts
1,474
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

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?
 
It's been a while since I messed with BCD.

I think the clue is "0000-9999". so it means 4 digits of 0 to 9. What is the binary value of 40015 and 40016?
 
tried to wrap my head around it but the 2 words doesn't make sense

I see it as XX.XX where each XX goes from 0-99 however each set of 8 bits in the word in BCD can go from 0-99 so in theory 40016 can go from 00.00 all the way to 99.99 maybe the combined words are leftovers from another application that had more figures.

I look at it as 08.63

is there anything in 40015 or is it a totalizer if so I may actually go to 9998.99 and the lower 8 bits of 40015 are used to represent 1XX.XX 99XX.XX

I would call the vendor as the manual is confusing
 
The manual is confusing. It mention 0-9999 then says low/high byte only which if it's BCD then it should be only 2 digits, 0-99.

I would see if there's a way to "drive" a value, say something like 12.34 and see what 40015 and 40016 show up as. That way, you can then decipher how it works.
 
The only other way I read it as only use low byte of 40016 and high byte of 40015

so in this case disregard the 8 and count 40016 as XX.63 and your high bytes in 40015 would account for the 00.XX
 
This is what I had to do.

Take the int value from the prosoft card and use frd instruction to convert to an integer. Then for the 40013 and 40014 I had to add those 2 values togther since the end result is an int. For the 40015 and 40016 I had to divide each of those by 100 and turn them into a float and then add them up to get the total.

My big hangup was the frd instruction. I had searched for bcd in the manual and looked for the instruction but could t find it for some reason. Not sure why they choose to present the data in bcd seems like they could have used an integer and a float.
 
is the number 863 the integer value or the BCD value? or other word, what's the raw integer value for the register 40016 and 40015?
 

Similar Topics

If a programmable controller controls the operation of a motor, what connects motor control to the PC? A) Line voltage B) I/O device C) Modem D)...
Replies
27
Views
7,069
Okay. On a semi-impulse, I scored one of these units relatively inexpensively. A development rig upgrade over my L320ERM: 5MB user memory, 120...
Replies
4
Views
1,439
OK, so am wanting to move 100+ tags into a new UDT. I figured the easiest way to do this is to copy and paste the tags into excel. Then...
Replies
5
Views
1,895
Can someone explain to me what exactly the SP62 is doing. I understand that SP62 is a greater than instruction but dont really understand its...
Replies
2
Views
1,317
I know what it is doing, it is creating P#DB104.DBX48.0 Byte 32. This is later used in an SFC14 block further on. I just can't wrap my head...
Replies
4
Views
1,593
Back
Top Bottom