8/5/2010 4:12 PM  
Posts: 35 Rating: (0) 
Hello friends, I need to create a look up table in S7 STEP software. Basically, I've got 10 ''temperature'' values and their corresponding ''pressure'' values. For each of the temperature value, I've to pick the corresponding pressure value from the table and use it for further calculations. Any suggestions are welcome about to how to create the table. Thanks. 
8/6/2010 6:48 AM  
Posts: 2348 Rating: (263) 
My suggestion^) UDT1: Temperature: REAL, Pressure : REAL DB: Array [1..10] OF UDT1 Algorithm depends on what task you have to implement  your temperature would differ from values in lookup table  i mean you have 10 and 20 degrees in lookup table  what should your algo produce if temperature is between  for example 15 degrees? 
Last edited by: Aret at: 8/6/2010 6:50 AM 

8/6/2010 4:28 PM  
Posts: 35 Rating: (0) 
Thanks Aret. There won't be temperature values outside the table. Whatever is in the table is the only needed data. Basically, I am trying to index through a table of values. Thanks. 
8/9/2010 9:32 AM  
Posts: 2348 Rating: (263) 
well, in my exaple 15 degrees is inside table range, but between 2 points  10 and 20. Still as for your question: UDT1: Temperature: REAL, Pressure : REAL DB: Table: Array [1..10] OF UDT1SCL code: FOR i:=1 TO 10 DO IF Current_temp = Table[i].Temperature THEN Output :=Table[i].Pressure; END_IF; END_FOR; But please mention that comparing REAL1=REAL2 is not correct way  you can have 1.0 (as setpoint) and 0.99999999999 (as result of calculation) and they will not be equal. 
Follow us on