pebe
Advanced Member level 4
- Joined
- Dec 1, 2008
- Messages
- 116
- Helped
- 18
- Reputation
- 36
- Reaction score
- 18
- Trophy points
- 1,298
- Location
- Scotland
- Activity points
- 1,893
I thought from your #17 post that you were using some special hardware to derive a voltage from your 4 to 20mA current. But you are just using a 470ohm resistor. Why that value? If you use a 122ohm (122.55oahms to be exact) as I said before, you will get a count of 125 for 20mA and a count of 25 for 4mA. All you then need to do is subtract 25 from the measured D/A value to get the scale of 0 to 100 that you want. You should check that the value is 25 or higher before you subtract, otherwise the register will 'roll under' to give you a value of something just less than 255.