Omron PLC Floating Point Divide doesn't work

nightline

Member
Join Date
Feb 2010
Location
Prinsenbeek
Posts
425
Gents,

We had to replace an CJ1G cpu for an CJ2M to get an Ethernet port on a machine.
I uploaded the PLC program including memory area, and changed the CPU type in the software.
I'm using the trail version of the CX-Programmer.
After replacing the CPU, I downloaded the converted program.
But now the machine will not run because of an F457 ( floating Point Divide ) Function doesn't calculate or gives an error.
The calculation is 32400 divide by 60 and returns with 0.000000 in D256

I had a chat with the Omron helpdesk, emailed the program, and when they do a simulation, everything works fine.
Unfortunately they could not tell me why it isn't working in the PLC program at the machine.

I also tried to replace the F457 with a MOVF where I move 540 into D256.
The strange thing is that this instruction also gives a 0 when monitoring D256.

Anyone an idea?
 
I use /F(457) all the time in CJ's a CP's and never had a problem with it. Is something else writing to either D256 or D257?? The result from /F will be a floating point number which uses two consecutive D words.
 
I double checked for double use, and couldn't find anything.
Again, the complete program has worked for years in the old PLC, and is just copy / past in the new PLC....
 
What happens when you do a simulation?
Can you post your code here for us to look at?
Also, I’ll assume the 32400 & 60 are variables rather than constants?
If they are constants, then why not just start with the result??
I know it worked previously, just saying...
 
I can't do a simulation, it's grayed out in software, maybe it has something to do with the trail version of my software.
The Omron support engineer did a simulation where it worked as it should be.
The 32400 is a variable, the 60 is fixed.
I also tried a MOVF instruction where I move the result in the destination, even here I get a zero in the destination...
 
Change the divisor from &60 to +60.0 and possible declare the D250 variable as a REAL. Currently it is a UINT
 
When declaring D250 as a real, D251 becomes part of the symbol assigned to D250.
You may want to verify that all calculations use the proper type (REAL, INT, etc.) and that proper conversions are done. I do not think you can mix data types in the same instruction
 
When declaring D250 as a real, D251 becomes part of the symbol assigned to D250.
You may want to verify that all calculations use the proper type (REAL, INT, etc.) and that proper conversions are done. I do not think you can mix data types in the same instruction

You might be right, but in the old PLC this program worked perfect.
I changed the old PLC back to verify this...

But off course I'll double check this also.
 

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,827
Hi There, I have couple of Omron PLCs connected on my kepserverex and my intouch reads data from kepserverex. I have been observing that roughly...
Replies
4
Views
85
I am working on a project using a NB screen and NX1P2 PLC. I am having a really hard time getting a real number to properly translate through to...
Replies
3
Views
116
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
184
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
93
Back
Top Bottom