Omron PLC Floating Point Divide doesn't work

1 - A float occupies 32bit, that's two consecutive D registers, if you pass for example D250 to a instruction that takes a float then you are passing D250 and D251 also at same time.

2 - There are not implicit conversions, example if you have 50 as a 16bit integer saved in D100 and then you would to use it in a instruction that takes a float then you need to convert first D100 to a float, save it in two consecutive D and then pass the result of conversion to the float instruction.
 
Last edited:
Gents,

I've solved the problem by adding a FLT instruction with the same source and destination which is D250.
See the attachment.

Thanks!

Jack
 
Even though you have it sorted the correct way, from the code you posted:
Rung #31 has a Binary multiply, that puts the result into your D250, as a unsigned Integer
That is then used as the 1st Multiplicand word in rung #33 with an unsigned constant for the 2nd multiplicand.
Depending on the size of these values, the result would of never been calculated & therefore displayed within CX-P, or any other software.

All Omron instructions require the source to be give to them in the correct format.
CX-P does not care how they are declared, it only uses them for display
(even though it is still good practice to declare them as their type).

The original code would never of worked with that example..
 

Similar Topics

Hi all, I'm not able to multiply decimal values in OMRON PLC CP1E-N20 I would like multiply one constant (+0.125)(multiplier) and one variable...
Replies
5
Views
4,794
Our plant manger/my boss wants each line to display the takt time above the line. I am trying to research the cheapest way to do this. Our plant...
Replies
3
Views
166
I have PLC Omron CJ2M with OD211 module. I want to use the pulse output and PWM output and this module. But i confuse how to activated this, i...
Replies
0
Views
75
I have a project to control the speed of motor DC using PWM Output on PLC and when im on working i have a several trouble and of of them is the...
Replies
6
Views
168
Hello everyone, I am trying to change the IP address of the Omron PLC (NJ30-1200) and HMI (NB7W-TW01B) to fetch the network on our network...
Replies
7
Views
256
Back
Top Bottom