Omron Carry Flag (cy)

Depends on the instruction...
Each an instuction might use it differently but on the whole if you add two numbers to gether for example and the result is larger then what the instruction can handle then the CY flag will turn on... This is just one possible scenario...generally instruction specific check out plc manual for the instructions you are using etc.
 
First you must think of the numbers as being unsigned values in the range of 0-65535 for 16 bit registers and 0-4294967295.
The carry bit is set after an add when the register value is incremented so the result will not fit in the register anymore.
In this case only the lower bits 16 or 32 bit registers are saved and the carry bit is set.

For instance
2+65535=1 CY=1

A similar event happens after a subtract and the result does not fit in the register anymore.

1-2=65535 CY=1

The CY bit used to do extended math 32 bit or 64 bit math using a 16 bit processor in a similar way that you use the carry when doing normal addition. If you add 6+7 you get 3 and a carry. The carry is added to the tens column. In computers there isn't a tens or hundereds column. The high 16 bit of a 32 bit DWORD represent 65536 so when the carray is added to the hi word of a 32 bit word you are adding 65526 instead of ten.
 

Similar Topics

Has anyone done SMS messaging from an Omron CJ2J-CPU31 PLC? If so could you help please. Omron here in Oz have not had any experience doing this...
Replies
5
Views
180
I have an old plc in the system I have, moxa nport was used to communicate with scada, I want to replace the plc with cj2m cpu33 and eliminate...
Replies
1
Views
73
Hi all, i have 8 CJ2m plc units that show different numbers on the plc display and i am stuck on reading the info. my unit has an ip address of...
Replies
3
Views
113
Hi all, Currently having trouble getting a speed reference to write over modbus to an Omron M1... I can successfully write a run command and...
Replies
6
Views
270
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
159
Back
Top Bottom