stanthe1man
-
Posts
1 -
Joined
-
Last visited
stanthe1man's Achievements
Newbie (1/4)
0
Reputation
-
Hello,
I replied to your post but since every post should be checked by the moderators before posted, there is a delay.
So I'm pasting what i wrote to you here....
If the pressure is linearly proportional to the analog input voltage, then you could use linear interpolation formula and floating point registers (MF).
Floating registers are also known as real numbers and it's the best way to deal with fractions.
Since the linearization function within Visilogic can't be used for MF registers, you have to do it step by step using simple mathematical functions.
LINEAR INTERPOLATION FORMULA:
Y = ( ( X - X1 )( Y2 - Y1) / ( X2 - X1) )
Where,
X1,Y1 = First co-ordinates
X2,Y2 = Second co-ordinates
X = Target X co-ordinate
Y = Interpolated Y co-ordinate
If your 0-10V analog input is 12 bit (0-4095) then,
X=Current analog input value linked to an MI
X1=409
X2=3726
Y1=0.000055
Y2=1000
Y= Pressure result displayed on the screen
I created an example for you, you can download it from my dropbox.
https://www.dropbox.com/s/kdpn0mooa9qxmuq/mf pressure.vlp?dl=0
-
Hello Kikis,
Many thanks for your reply.
Unfortunately I don't think that the result will be displayed as required.
I do have a formula that is known to work, but I don't know how to present it to Unilogic
ladder.
Here is the formula:
(expression written in Compact Logix) apparently!
0.00000241*(Vac_Gauge_V**6.552)+(1.0000000e-022*(2.7183001**(Vac_Gauge_V**1.75)))-0.0002
where Vac_Gauge_V can = between 10.0v to 1.0v.
So assume it = 4.35v , the end result should display as this type of format - 4.2x10¯³ or 4.2x10-3
I know this seems a big ask but my maths skills are not good - I can't even get the equation into excel.
Any help would be wonderful!
Thanks
Stan
-
Hello Stan,
You can use the formula command from the math menu.
I think it should look like the picture attached.
-