Abdul Wajid

Math Floating Point numbers without Registers

10 posts in this topic

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 by Abdul Wajid

Share this post


Link to post
Share on other sites

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.  

immagine_2022-03-08_140606.png

immagine_2022-03-08_141645.png

Share this post


Link to post
Share on other sites

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.

 

Share this post


Link to post
Share on other sites

Floating point is entered directly by using the +/- character. See screenshot

 

aaa.png.ffaf25439db2abf909e5bbf876868ac8

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
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.

SAMPLE02.jpg

Edited by suresh_

Share this post


Link to post
Share on other sites

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 by Abdul Wajid

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.  

immagine_2022-03-11_083704.png

MOV.jpg

S3.jpg

Edited by suresh_
1 person likes this

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now