Setting Up a Boolean Flag in Omron CX-One: A Step-by-Step Guide

Question:

Create a simple program for the Omron CP1L PLC using CX-One and CX-Programmer software. I am looking to implement a button connection to the PLC and set a boolean flag when the button is pressed. I've successfully connected the button and created a boolean symbol with the type BOOL and assigned it the address W0.00 (the first word of the work area, specifically the zero bit). In the programming section, I utilized the MOV instruction for my button. I set the "Source" argument to the digit "1" and the "Destination" argument to the name of my boolean symbol. However, upon compiling, I encountered an error stating, "Operand 2 out of range." I'm unsure why my boolean symbol isn’t working. Interestingly, when I created a symbol of type INT, the compilation was successful. Could someone guide me on the correct method to set a boolean flag? Additionally, where is the best place to find resources or documentation on this topic? I'm struggling to formulate an effective search query for Google.

Top Replies

For those seeking assistance, you may find the following link beneficial: [CX- Programmer Introduction Guide](http://forums.mrplc.com/index.php?/topic/19617-beginners-guide-to-cx-programmer/). This resource is an excellent starting point for beginners, featuring practical examples and comprehensive instructions on utilizing the CX-Programmer software effectively. Best regards!

Consider downloading the W451 instruction reference manual from Omron for comprehensive guidance. Access the manual here: [W451 CP1H/CP1L Programming Manual](https://www.myomron.com//downloads/1.Manuals/PLCs/CPUs/CP1/W451-E1-03_0420%20CP1H_CP1L%20Programming%20Manual.pdf). This resource is essential for understanding the programming of CP1H and CP1L PLCs.

Absolutely, I took the time to read the beginner's guide, which provided insights into defining a button linked to a PLC (Programmable Logic Controller). However, it lacked adequate information regarding symbols, which I found to be overly simplistic. Additionally, I reviewed the instruction reference for the MOV command. It mentions that the source can be a constant and that the destination area starts from W0. Unfortunately, I'm encountering an "Operand 2 out of range" error, with Operand 2 representing my Boolean symbol. Is it possible that the compiler is mistakenly interpreting a hexadecimal value for a binary variable? How can I instruct the compiler to recognize this variable as binary instead of hexadecimal? Alternatively, could there be an entirely different issue at play here?

Explore the following resources for more information: Check out this informative video on YouTube: [Watch Here](https://www.youtube.com/watch?v=Ei4_HqzUFBs) or visit this comprehensive guide at [PLC Basics](http://www.plcs.net/chapters/basic9.htm).

Share your code with us, and we'll be happy to review it. It seems like you're dealing with a straightforward application that may be more complex than necessary, or perhaps there’s some confusion.

More Replies →

Streamline Your Asset Management
See How Oxmaint Works!!

✅   Work Order Management

✅   Asset Tracking

✅   Preventive Maintenance

✅   Inspection Report

We have received your information. We will share Schedule Demo details on your Mail Id.

You must be a registered user to add a comment. If you've already registered,
sign in. Otherwise, register and sign in.

Frequently Asked Questions (FAQ)

Ready to Simplify Maintenance?

Join hundreds of satisfied customers who have transformed their maintenance processes.
Sign up today and start optimizing your workflow.

Request Demo  â†’