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,535
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,510
I recently did a program conversion from logix 500 to studio 5000 and when machine runs it depends on two ton instructions to keep the machine in...
Replies
17
Views
323
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
16
Views
382
Back
Top Bottom