Jump to content

Recommended Posts

Posted
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.
Posted
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?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...