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,577
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,531
Hello everyone, I'm new here, I hope someone can help me. I've been trying to install EDS files to my Studio 5000 with the EDS tool installer but...
Replies
3
Views
122
Hi Everyone, I am facing an issue while installing the STUDIO 5000 in my windows 10 PC. During installation I am getting an error that " Error...
Replies
4
Views
188
I am connecting to a remote device. When attempting to upload I receive an error that states: Error: Auto_Functions: The Import was aborted due...
Replies
3
Views
194
Back
Top Bottom