plc math question

walters

Member
Join Date
Feb 2005
Location
reusel
Posts
185
i have to wright a program that follows the opening of a bin and that karakteristik has to be equal to a karakteristic that we manually "teach" to the PLC.

these 2 karakteristiks have to be compared at the end and the one that came out of the opening we just followed may swerve off a few % of the learned karakteristik.

now what i want to know is how can i calculate the percentage that the one may swerve off of the other?

im using a mitsubishi FX1N PLC and program it with melsec medoc

so how can i calculate lets take something easy 2% of 100

i know how to compare the values of th karakteristik so that isn't the prob only the calculating is

i hope i get some very helpfull replies soon

regards walters
 
Don't apologize. After I looked at it for a second I realized what you were referring to. karakteristik actually makes more sense in the phonetic version than it's properly spelled version.

Dan
 
OK I think I see what you want.
1. YOu want to set up a data point (number) that is your allowable value
2. You want to collect data from some process - call this process data
3. You want to ensure that the PROCESS DATA differs from the ALLOWABLE DATA by some criteria - let us use your 2% value.

% error = (true value - experimental value)
----------------------------------
true value

In your case = (ALLOWABLE DATA - PROCESS DATA)
--------------------------------
(PROCESS DATA)

I only know Allen Bradley BUT basically sequence would look like

COPY ALLOWABLE DATA then PUT HERE say ABC
COPY PROCESS DATA then PUT THERE say XYZ

subtract ABC from XYZ PUT here say DEF
Divide DEF by ABC put value here say GHI

Now there may be a problem if the subtraction yields a negative value. IF the PLC can handle that all is OK
IF NOT then you may have to multiply PROCESS DATA by -1 before putting in XYZ

Dan

Dan
 
first:

im glad my first post was clear without the the word karaktersitik spelled well.

second:

thanks for your reply leitmotif but i must calculate upper and minimum value with the 2% (that is 2% of the teach-karakteristik) can i use that formula backwards then or are there more calculations neccisary that way?(never been good in math
icon9.gif
)
 
Using a calculator determine what your upper and lower limits are, then use compares to see if your finished value is good or bad.

Using your 100 and 2% example:
100 x .02= 2, so upper limit is (100 + 2), lower limit is (100 - 2)
upper_limit = 102
lower_limit = 98

Test routine:
If (Process_Value <= upper_limit) AND (Process_Value >= lower_limit) THEN
good_part:=TRUE
Else
good_part:=FALSE
Endif;
 
Last edited:
allready thought something like that.
but you suggest i do something like this?:

("teach_value" div100 D100)
teach_value is getting diversed by 100 and diversed valeu is written to D100

(D100 mul "criteria" D102)
D100 gets multiplied with % valeu and written to D102

("teach_value" + D102 "maximum_valeu")
D102 gets added to teach_valeu and written to maximum_value

("teach_value" - D102 "minimal_value")
D102 gets subtracted from teach_value and written to minimal_value


all i have to do then is compare actual value with thos 2 and if neccisary give alarm when its over max or under minimum?
 

Similar Topics

Hi everybody i am currently working with a project at my company and i have spent mostly of the evening yesterday and the morning today trying to...
Replies
8
Views
4,010
How do I read the value in the first stack location of a Automation Direct PLC (DL 260)? I am doing a divide DIV and I want the value of the...
Replies
2
Views
2,613
Please be patient I just started learning this. In a compare, I have data A: as DF2. data B: I want (DF10 /6.25)+6...
Replies
6
Views
2,310
All, Have not programed a PLC in a couple years and my new job asked me to do a simple project and I thought it would be easy, but I have ran...
Replies
8
Views
2,426
Has anyone done matrix math with a A-B PLC? Not sure if I should be using loops and indirect addresses or go with hard coded program with every...
Replies
4
Views
2,286
Back
Top Bottom