How to use boolean flag in Omron cx-one?

themaster

Member
Join Date
May 2018
Location
Samara
Posts
4
Try to write simplest program for PLC CP1L, Omron. Use CX-One, CX-programmer. I want to connect a button to PLC and set a boolean flag on press.
I realized how to connect a button, made a symbol with type BOOL and address W0.00 (first word of work area, zero bit).
Then in program section connect a instruction MOV to my button. Point "Source" argument - digit "1", "Destination" argument - my boolean symbol name.
Try to compile - and get a error, Operand 2 out of range. Why it do not want to use my bool symbol?
Tried to make my symbol, for example, INT - compile OK.
How should I set boolean flag correctly? Where can I read about it? I barely can realize how to make a search request for google...
 
Of course I did it

I read beginners's guide. It explained me how to define a button connected to PLC, but there is no information about symbols - it is too simple.
I read instruction reference about MOV instruction. It says that source can be constant, and destination area begins from W0. But I have Operand 2 out of range, and operand 2 is destination, my boolean symbol.
May be compiler tries to put hexadecimal one to binary variable? So how can I say to compiler that one is binary, not hex?
Or maybe my problem is completely different?
 
Post what I can

I do not know how to insert program code of ladder diagram, but I can place screenshots on my Google drive:
Main program screen:
https://drive.google.com/open?id=1k0_o5_Ku_Gd9qKtUBgQNDXX2wLiTBjTU


Symbols window:
https://drive.google.com/open?id=1uVqwC2w62alSZDa_Na6OLsBMGu3CgGSY


Error message:

https://drive.google.com/open?id=1ssq6g-A8JO56vgZ9ZdGQEUoSEzEd2-xg




Compiler output:
Code:
Compiling...
[PLC/Program Name : ØÀÓ/MainProgram]
[Ladder Section Name : MainSection]
ERROR: Operand 2, ManualModeVar, out of range at rung 0 ( 6, 0 ). 
[Ladder Section Name : END]

MainProgram - 1 error, 0 warnings.
The programs have been checked with the program check option set to Unit Ver.1.0.


I hope it will be useful...
 
Thank moggie for useful answer!
So, I should replace MOV instruction by "coil" symbol, and point it to my boolean symbol. After that program will compile without errors (right), and also will run as intended - if I press button connected to my PLC, boolean flag "ManualModeVar" will be set, is it?

Yes as you have programmed it is better and the "coil" will turn on as long as the input is on - BUT be careful with your terminology "SET" means something else. Look here http://www.plcs.net/chapters/latch14.htm for details about SET & RESET (Or latch/unlatch)
 

Similar Topics

Hi. I haven't touched an Allen Bradley PLC for more than 10 years and I'm kind of rusty. I want to do something really simple in a FBD section...
Replies
5
Views
846
All, i nto fully get it. I read trough some froums but not finaly make it running. so I try to ask. Hopefully anybody has the kindness to answers...
Replies
7
Views
1,189
Example: Take this boolean algebraic expression: note: I'm using a single quote to denote negation as I can't place a bar over the letter. (CA +...
Replies
9
Views
2,830
I was just curious if there is a way to search for a description of a boolean contained within a DINT/INT. For instance, I have a DINT[1] named...
Replies
6
Views
2,258
I have a pump with ON off status in PLC micrologix 1400 my question is how I can calculate working hours base on ON/off status How I can use the...
Replies
5
Views
2,413
Back
Top Bottom