Floating Point Math on a AB PLC-2/30

Its been a long time, but I don't think the 2/30 does any floating point math - only 3 digit BCD.
 
Decimal Point

Thanks Mike:

But the PLC 2/30 OP Manual suggest that Math operation can use decimal point (fractions). What I want to do is use a Aanalog I/P and O/P relationship to scale 0 - 10VDC to 0 - 8.2VDC in 2 decimal point accuracy. The linear relationship would be of the form y = .82x + 0 or y = 82/100*x + 0. Do you think this would give me 2 decimal point accuracy?
 
That 2/30 is obsolete and you should get rid of it if you can. Otherwise, you are stuck with integer math but you can play some games and get a version of floating point but it takes a lot of code to do it. I would just replace it with something else if at all possible. Just my 2cents.
 
Plc 2/30

I do agree with you but this is just a temporary thing and need to do this for now but will be replacing in within next 6 months when I get ok. So, if you have sample code for floating point, I would appreciate getting some help.

Harry
 
You won't rrally be dooing floating point calculations. All you do is multiply everything by 10 or 100 or 1000 and then you have integers with implied decimal places.

For example, to calculate the area of a circle with a radius of 1.25 inches, you could multiply 125 x 125 x 314 to get 4,906,250. Now, since each of the three integers involved in the calculation was 100 times larger than the actual value it represents, you know that the decimal point in the result is shifted to the right by a factor of 10^6 (100 x 100 x 100), or six places.

You have to be careful of the order of operations so that you dont' exceed maximum values in any intermediate results or wind up with huge round-off losses.
 
If it's temporary get yourself an old 1771-DB and do the math in BASIC.

Hope this helps.

(8{)} :) .)

(Yosi)
 

Similar Topics

I'm working on a math-heavy project on CompactLogix L45 (Rev. 20) and am running into some issues with a calculation to determine the angle...
Replies
8
Views
3,942
Processor: Micrologix 1400 When doing subtraction using floating points (SUB F34:0 F94:10 F94:15 ) I am subtracting two values which have a...
Replies
10
Views
2,547
am using s7200 cpu222 my cpu support cosine,sin,tan function....but i neeed arcsin(sin-1) function how can i obtain it?????
Replies
4
Views
2,265
Hello, I'm working with an AD DL05, integer math only. I've got a C-more micro for an HMI. I need to input inch dimensions for a cut to...
Replies
14
Views
19,136
Hello everybody I'm new to plc programming and i'm trying to program some simple math operations to convert some measurments for a project. The...
Replies
8
Views
5,600
Back
Top Bottom