Help - Search - Members - Calendar
Full Version: More accuracy in analog readback
Forums.MrPLC.com > PLCs and Supporting Devices > Automation Direct
mad1
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?
rlp122
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
QUOTE(rlp122 @ Jun 28 2007, 12:04 PM) [snapback]56099[/snapback]

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


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.
mad1
Here is my program. My DVM reads 4.99V in comparison to the memory location V2100 with a number of 498.
GerryM
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
QUOTE(GerryM @ Jun 29 2007, 01:47 PM) [snapback]56154[/snapback]

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.


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
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.