Sign in to follow this  
Followers 0
Colin Carpenter

QnA Look Up Table

2 posts in this topic

Wonder if any knows a good way of doing the following? PLC is a Q2AS monitoring a density signal through an analogue input. It also receives a temperature signal via another analogue input. The product is cream at a certain fat percentage. By knowing the density at a certain temperature, I can theoretically determine the fat percentage from a "look up table", in other words, if it's this density at that temperature, then it must be this fat percentage. If I plot a graph of density (y axis) against temperature (x axis) and measure the density of a "known fat percentage cream" as it warms up (or cools down, for that matter), then I can plot a curve on the graph for that particular product. I need to do this for about 6 different creams over a range of 4 - 20 centigrade. It is almost certain that the plots will be curves, not straight lines, so it's going to be tough to come up with an equation for each curve, so a "look up" table seems to be the best bet. Hence the question ..... has anyone done anything similar? Are there dedicated commands? Should I get familiar with 2D arrays? Thanks in advance.

Share this post


Link to post
Share on other sites
i'm not sure about dedicated commands (it's hard to know everything when you are dealing with Mitsubishi) but it is easy to do 1D table, you just need to use pointer and indirect addressing. for example you use D1000..D1799 as lookup table with 800 samples, and Z0 as pointer (this is where you put scaled analog input and it should be in 0-799 range) and now you want to read the value and put it in D200: ---|sm400|------------------[MOV D1000Z0 D200] you can change the table size of course. if the Z0 is 0, you will get value from D1000, if it is 1, you will get the D1001 etc. it is not big deal to use 1D table as 2D, you just have to do simple conversion Z=A+BC where C is one of the table dimension (max number of increments for A) and A and B are your two dimensions. but how big you want this to be?

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0