Studio 5000: Find closest number in Array

janner_10

Lifetime Supporting Member
Join Date
Dec 2014
Location
Tewkesbury
Posts
1,301
Hello!

I am in the process of converting a Horner program into Studio 5000 for a customers gasifier.

The Oxygen sensors are +/- 1000 mV.

The find out the % of O2 in the vessel, I need to use a look up table I have build into a 2D Array.

Now I wish to search this array to find a value that is the closest to my reading.

Anyone have any ideas how to go about this?

TIA
 
You could get a bit creative with an FSC instruction. Otherwise, there's always brute force, it wouldn't be overly complex in this case.

I haven't really used FB to be able to vouch for the FGEN instruction, but I'm about to go and look at what it does...
 
The FGEN seems to work pretty well so far, so thanks for the suggestion.

Trouble is I now have to work out the different O2% Readings based on the vessel temp!

Attached is the look up table for those interested.
 

Similar Topics

I am using Studio 5000 Version 30 and Compactlogix. I have a recipe created in a UDT structure, with a string value called name. There are 50...
Replies
7
Views
5,508
Hi, When installing new PC, how do I find what EDS file that is used for a device in an existing project. Without access to Studio 5000 on the...
Replies
3
Views
5,494
Hi Everyone. Not posted on here for a long time, but I am hoping someone can help me. I am doing a differential pressure calculation in a L27ERM...
Replies
15
Views
291
Hi, how do I convert 2x Integer registers to a Real? The two integers are from Modbus registers that contain a floating point value, I need to...
Replies
2
Views
123
What is the best way to extract the hour and minute from the register that comes from Yaskawa VFD. In studio 5000 I have a register saved as INT...
Replies
3
Views
127
Back
Top Bottom