2/1/2016 11:23 AM | |
Joined: 1/17/2007 Last visit: 7/29/2024 Posts: 1544 Rating: (534) |
I produced some code to make a 3D interpolation (look-up) table in thos thread:-
I hope it helps, Smiffy. |
Programming today is the race between software engineers building bigger and better idiot proof programs, and the universe producing bigger and better idiots. |
|
This contribution was helpful to1 thankful Users |
2/14/2016 8:55 PM | |
Joined: 6/26/2013 Last visit: 6/15/2024 Posts: 17 Rating: (0) |
Dear @Smiffy and @Duris_I thanks for your attention the code that you provided in your message is for 2D lookup table but my need is 3D lookup table. after a while and with hard attempt I have wrote a cod for 3D look up table. I make a FC for my code body and also make a DB for store the arrays. you can see the code bellow: FOR #i := 1 TO 22 DO IF #in_1 >="Data_block_2".DataRange[#i] AND #in_1 <="Data_block_2".DataRange[#i + 1] THEN #j := #i; IF #in_1 = "Data_block_2".DataRange[23] THEN #j := 23; END_IF; END_IF; END_FOR; FOR #i := 1 TO 50 DO IF #fWr >= "Data_block_2".RotSpRange[#i] AND #in_2 <= "Data_block_2".RotSpRange[#i + 1] THEN #j1 := #i; IF #in_2 = "Data_block_2".RotSpRange[17] THEN #j1 := 17; END_IF; END_IF; END_FOR; IF #j >= 1 AND #j <= 22 AND #j1 >= 1 AND #j1 <= 16 THEN // first formula END_IF; IF #j = 23 AND #j1 <> 17 THEN OutPut= DataValue[i,j] //first Formula END_IF; IF #j <> 23 AND #j1 = 17 THEN OutPut= DataValue[i,j] // Second Formula END_IF; IF #j1 = 17 AND #j = 23 THEN OutPut= DataValue[i,j] //Third formula END_IF; the value stored in DB is in attachment. I have compiled the cod and every thing was ok, when downloaded to plcsim and switched RUN-P the SF indicator turned on!!! I checked it in online diagnostic I figured out the error is: " Differences were found between the loaded configuration and the offline project.The online and offline module configuration data are different. " and I couldn't solve its problem till now!!! please help me how to fix this problem.... AttachmentDB.txt (186 Downloads) |
Last edited by: Auto.eng at: 2/14/2016 8:56:15 PM |
|
Follow us on