Abdul Wajid Posted March 8, 2022 Report Posted March 8, 2022 (edited) Hi Folks..... In Maths instructions (divisor, multiplier word.....so on), Is there any way to directly enter the Floating point no. without any register unlike Integers? Have to avoid entering any error value in the float register if PLC switch OFF for more than required time without battery. Thanks Edited March 8, 2022 by Abdul Wajid Quote
suresh_ Posted March 8, 2022 Report Posted March 8, 2022 Hello Abdul, I am not sure if this is working for you, anyway you may try to manually imput your FP data into a dummy integer usinf FIX or FIXL , after that you discard the dummy and keep your actual Data for FP math, it is not elegant but it works. Quote
Abdul Wajid Posted March 9, 2022 Author Report Posted March 9, 2022 Thanks Mr. Suresh for the info.... But it seems little bit different than sysmac studio which we can directly enter the floating no. by typing REAL#50.00 and so on.... in the function & FB. Quote
chelton Posted March 9, 2022 Report Posted March 9, 2022 Floating point is entered directly by using the +/- character. See screenshot Quote
BobB Posted March 9, 2022 Report Posted March 9, 2022 I think I know where you are coming from. All numbers have to be converted to floating point before you can us them for floating point maths. Integers do not work. Use FLT or FLTL to do the conversion. Quote
suresh_ Posted March 10, 2022 Report Posted March 10, 2022 (edited) 10 hours ago, BobB said: I think I know where you are coming from. All numbers have to be converted to floating point before you can us them for floating point maths. Integers do not work. Use FLT or FLTL to do the conversion. OMRON PLC ladder programming is quite loose about variable declaration, so you can take an integer, convert to FP and manipulate it as required letting the SW to manage the variable type behind the scenes. Edited March 10, 2022 by suresh_ Quote
Abdul Wajid Posted March 10, 2022 Author Report Posted March 10, 2022 (edited) Thanks Mr. Chelton, that was my silly mistake which i wasn 't aware of.... 2 hours ago, suresh_ said: OMRON PLC ladder programming is quite loose about variable declaration, so you can take an integer, convert to FP and manipulate it as required letting the SW to manage the variable type behind the scenes. This seems little bit complex, takes quite more time to understand & re-program for new omron programmer Edited March 10, 2022 by Abdul Wajid Quote
suresh_ Posted March 10, 2022 Report Posted March 10, 2022 Dear Abdul, as chelton pointed out, you may input a FP value directly and consume it on the spot if the consumer function allows a FP because not all functions do. Otherwise, when you write a FP value into a register to be manipulated later on, you cannot simply use MOV because MOV is not meant for FP assignment, so you have to find some turnaround to do this as I showed before. Otherwise you need to use ASCII string to FP that can be very tricky indeed. Bottom line, since OMRON is loose about data type ( bcs they are very concerned about backward compatibility ), there is no need to stress too much about data type, simply enter a FP and let the SW do the work for you. Quote
Abdul Wajid Posted March 10, 2022 Author Report Posted March 10, 2022 Thanks for the further info Mr. Suresh... Quote
suresh_ Posted March 11, 2022 Report Posted March 11, 2022 (edited) Dear Abdul, let me add another info for you. If you decide to use variables, you can use MOV to input a FP as you do for Integers. To do that you need to generate your Variable ( eg TEST) in the symbol section, specify REAL type and associate to a register (D100 eg). After that you can recall TEST variable in your ladder with MOV instruction and manually input your FP or associate it to an AI as you wish. In this way you can input your FP for later on use usingf MOV. According to PLC set up and register you selected ( HR, DR,..) , TEST variable may be or may be not saved once you switch OFF and ON your PLC. I hope this clarifies. Edited March 11, 2022 by suresh_ 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.