
adccommunitymod (AutomationDirect) asked a question.
Do-More lookup table
Created Date: November 23,2017
Created By: Bolt
**** This post has been imported from our legacy forum. Information in this post may be outdated and links contained in the post may no longer work.****
Is there a way to do something like LERP on a BRX, but on a much larger scale? 400+ values? Besides nesting a bunch of LERP's together? At my desired resolution, I don't really need the interpolation anymore, more like the LOOKUP formulas in MS Excel.
Created Date: November 23,2017
Created by: Bolt
Is there a way to do something like LERP on a BRX, but on a much larger scale? 400+ values? Besides nesting a bunch of LERP's together?
At my desired resolution, I don't really need the interpolation anymore, more like the LOOKUP formulas in MS Excel.
Created Date: November 23,2017
Created by: BobO
From a input X, you need an output Y? What type of values are X?
Created Date: November 23,2017
Created by: Bolt
I have an egg shaped tank with a known calibration chart. I would like to take a pressure transducer reading, and convert it to pounds. The resolution of my chart is to the millimeter, hence the 400+ readings. I would like to get fairly accurate.
Created Date: November 24,2017
Created by: BobO
So your X values are linear and bounded...makes this easy. Use a SCALE box to convert from transducer raw values to 0 to 400. Use a MATH box to convert from the scaled R value to a V. Use the V to index a table (memory block) containing the calibration values. You can actually do the last two parts in a single MATH box. Easy...the whole thing will take two instructions. Let me know if you need help coding it.
Created Date: November 24,2017
Created by: Bolt
Bingo! That was my missing link, I did not think to put the values in a V memory block. I got it to work in a test scenario, but did not play with combining the math functions. Out of curiosity, how do you combine MATH of V100=R100, and REF(10,V100) into one instruction? REF(10,(ROUND(R100))?
Thanks for your help!
Created Date: November 24,2017
Created by: BobO
Bingo! That was my missing link, I did not think to put the values in a V memory block. I got it to work in a test scenario, but did not play with combining the math functions. Out of curiosity, how do you combine MATH of V100=R100, and REF(10,V100) into one instruction? REF(10,(ROUND(R100))?
Thanks for your help!
Don't need the REF command. It's for when you want to make the block itself a variable.
It could be as simple as MATH OutVal = Table , but yeah, I'd probably use MATH OutVal = Table .
Created Date: November 25,2017
Created by: Bolt
Okay, now you have me wondering. What is the Table you are referring to? Are you creating a Heap Item named Table telling it that Vx000-Vx400 is named Table? Please enlighten me...
Created Date: November 25,2017
Created by: BobO
Okay, now you have me wondering. What is the Table you are referring to? Are you creating a Heap Item named Table telling it that Vx000-Vx400 is named Table? Please enlighten me...
Kinda...creating memory block named Table that is 400 elements long.
{ "data-align ": "none ", "data-size ": "full ", "data-attachmentid ":109406}