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,446
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,465
Hi guys , I'm new with Allen Bradley, but I have experience with Tia portal (s7 1200 ,s7 1500) I want to convert my project from Tia portal to...
Replies
1
Views
56
Hi everyone, I have an issue with installation of Studio 5000 33.00.02 DVD Media disc 2 with View Designer on Windows 11. After installation...
Replies
0
Views
68
Anyone have problems/solutions with Rehosting Studio 5000 to a new computer. Our IT department successfully Rehosted 2 laptops, but the other 2...
Replies
1
Views
118
Back
Top Bottom