Indirect addressing with Omron

Steve Kemp

Member
Join Date
Nov 2003
Posts
122
I've done a search here which yielded 3 results, so I'm probably not doing it right, but can anyone enlighten me as to the Omron equivalent of AB's: (for example), MOVE N7:[N7:0], N7:1. Is the format common to all instructions? CJ1;CPU11, by the way.

Thanks, Steve.
 
Steve,

There are many methods of moving/transferring/manipulating data in the CJ1 PLCs. Awesome instruction set. Same as the CS1. Please explain what you wish to do.

For example, a straight MOV or MOVL (long) command is often used for setting up parameters for other functions on the first scan flag but is also used for many other things. ANDW is often used to move data with a mask (#00FF for example). MOV is not really indirect addressing.

There are quite a few of use here that are very familiar with Omron and can certainly help but need to know what you wish to do.
 
OK... Say I wish to store an acquired value in a "D" memory location, but want that location's address to be controlled by a job number via the HMI. So, when the operator wants to store some variables for a given job, he'd push the store (teach) button and the data would be stored in location D1 for job 1; D2 for job 2, etc., and retreived in a similar way when recalling the machine's stored data. From the valid data types list in the move function edit screen, it looks like an "@" prefix to the address used in the MOVE function is related to inderection, but I can't work out where the "pointer" value fits into it. I was expecting the format to be something like: MOVE: VALUE in (D memory location number [n]) into destination address. Where [n] is the pointer. Basic recipe stuff, really.
 
"@" is a leading edge trigger. For example, @MOV 120 D5000 will move the contents of channel 120 to D5000 on the leading edge of an input signal only. Very commonly used to increment and decrement channels on a signal input for example.

MOV 120 D5000 will move the value all the time so that if there is a change in the value of channel 120 a continuous update into D5000 will take place.

"#" indicates a BCD data type while "&" indicates a decimal/HEX data type. Ther a heaps of ways to manipulate data.

How about button press writes the job number to D1, @CMP D1 #1 to determine job number, turn on a bit, bit turns on a logic line to store the value into the respective D for the job. Ther are probably different and easier ways but I do not have to do recipe stuff at all. Would be able to assist in a lot of other areas more proficiently.

Have a good look at the isntruction set as there are a heap of instructions that can be used for data moving and manipulation.

I will have a look myself and see if I can see an easier method.
 
Bob,
'@' before the instruction does indicate a rising edge trigger. '@' before an address indicates indirect addressing.
Indirect.jpg

The memory area is dictated by the memory area of the pointer i.e. this is working in D momory.
Pp
 
Last edited:
Correct. I was remembering the old days when * was for indirect addressing.
 

Similar Topics

hi every1, I am using Omron CS-series PLC at working. I would like to know how to use indirect address to refer to a bit. I know what indirect...
Replies
6
Views
3,986
Howdy folks, I am an Allen Bradley guy currently living in an Emerson world. Working with Rx3i on PacSystems Machine Edition v. 9.6? i think...
Replies
3
Views
609
Hello, I'm very new to programming with absolutely zero schooling in this field and pretty hands off training in my new role, it's been fun...
Replies
4
Views
662
Hello Friends, I am trying to index M Bits, however GX Works2 is not allowing it with following message. https://ibb.co/zPcqj6M...
Replies
3
Views
1,371
Hi All, which the best way to do the indirect addressing in an optimize DB? Ccurrently this is my partial code inside an FB...
Replies
7
Views
2,266
Back
Top Bottom