You have no items in your shopping cart.

New HIDS Drum Scales!

Click Here to Learn More!
Support: 858-292-2710

how do I read the net weight float value so I can get down to a tenth of a pound?

Last updated 05/12/2014 11:00 AM

Question

Using DeviceNet, I need to read the float value of the net weight so I can get down to a tenth of a pound (hundredths would be nice too.) When I map HFI4 to DFO0, I get 1112041062. But if I map HFI4 to DIO0, I get 50 (the weight of the weight I'm using.) How do I read the float value and get 50.10 like the Hardy screen says?

Answer

The mapping registers in the Hardy 3030 unit are 16 bit integer registers.  Your listed Compact Logix PLC uses 32 bit registers for the DeviceNet.  Be aware of the relationship between our words and where they will show up in your scanner input table.  Watch your word boundaries.  When you choose to map as and INT out or FLOAT out, be aware that these will occupy 2 word registers in the Hardy unit and if it is not starting on a word boundary in the PLC, will end up with half the data in one word and half in another in the PLC.  EXAMPLE:  If you have our units inputs to the scanner starting at word 0, our registers will match with words 0 & 1 in your word 0; our words 2 & 3 into your word 1, etc.  If you map a value as a float out, in word 1, then we will use our words 1 & 2 and you will get data in the upper half of your word 0 and lower half of your word 1.  

When you map the output data as a float, you will receive the data in the DeviceNet input table as IEEE float formatted data that is located in an Integer register.  You cannot read float data in an integer register, so you need to move it to a float register maintaining the bit pattern of the data.  You will need to do a copy command from the input register into a Real register.  This will then copy the bit pattern from the integer register to the float register where it can be interpreted correctly.

Another method of getting decimal resolution to your readings is to multiply the reading by some multiplier (usually a power of 10) and transfer the value.  You had an example of mapping the weight as an INT type, HFI4 to DIO0, and getting the value without any decimal resolution.  If you mapped this as DIO0 = HFI4 * HFO0, (multiply the weight reading by a value in scratchpad HFO0 [insure no other mappings are using this scratchpad or select a different scratchpad] and place a value of 10, 100, etc in the scratchpad).  This will then move the decimal point before transferring the reading.  So now if the weight is 50.12, if you place 100 in the scratchpad location, you will receive the value 5012.  You would then need to insure you either divide by the multiplier and place the result in a real location, or use the values in the units you are receiving them in.