mad1 Posted June 28, 2007 Report Posted June 28, 2007 (edited) I have a voltage connected to a f4-08ad analog input module. The voltage scale that I will be reading is 0-10V. I take the input to the module and load the value into memory,divide by 409(this is my scaling factor),then output the value to another memory location.When I read the value in the memory location that I specified I can only read in whole numbers, I would like to read in 1/10th's of a number at a minimum. How can I make my voltage value be displayed with more accuracy? Edited June 28, 2007 by mad1
rlp122 Posted June 28, 2007 Report Posted June 28, 2007 The easy way is to use an implied decimal. This means shifting your scaling slightly to make an extra digit that is implied as a decimal point. Since the upper limit of the analog card is 4095, you can: LD V2000 * Analog value MUL K4090 * 409 * 10 to make an implied decimal place DIV K4095 * Divide by the card resolution OUT V2100 * Output address for scaled number
mad1 Posted June 28, 2007 Author Report Posted June 28, 2007 (edited) Here is a picture of my sample program and the Data View window. I am inputting 5V to the analog input module. I updated the picture of my program. Edited June 28, 2007 by mad1
mad1 Posted June 29, 2007 Author Report Posted June 29, 2007 (edited) Here is my program. My DVM reads 4.99V in comparison to the memory location V2100 with a number of 498. Edited June 29, 2007 by mad1
GerryM Posted June 29, 2007 Report Posted June 29, 2007 Multiply by 10 before you divide and see what you get as rlp122 suggested. You may have to use double precision math at that point I'm not sure. It's been a while since I've done math with that PLC. The way you have it now you are depending on every bit. That is not realistic. What accuracy do you need? I'm guessing that input card is about 1/4% of F.S. accuracy which would give you about +/- 0.025 volts on a 0-10V scale.
mad1 Posted July 2, 2007 Author Report Posted July 2, 2007 (edited) That would be acceptable. When I leave the program in the current setup, V2000=2049 V2100=500 After the addition of the X10 box, v2000=2049 V2100=21 Thanks Edited July 2, 2007 by mad1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now