Pregunta

What does the "@" sign means in ladder programming? Documentation explains the @ specifies an indirect DM address in binary mode ... offset an memory area: what does that mean actually?

Consider the following image from the documentation:

enter image description here

How can the content of a the address (a 16 bits or decimal 32767) becomes the word address? For example, if adress CIO 0 has content of 000000001000000: adding the @ sign the CIO 0 changes to 000000001000000? What exactly is moving in the above instruction?

¿Fue útil?

Solución

This works for DM (Data Memory) only. There are many memory areas of an Omron PLC. CIO is usually used for input/output bits only. W (work) is used to store working memory bits (think RAM), H (hold) is used to store bits whose values must be retained if power is lost (think Hard Drive, bit data). DM and EM are used primarily for holding WORD data, also stored if power is lost. There are no hard and fast rules about this, of course - in a lot of circumstances you can use CIO bits in place of W bits, for example, if you want to, but each has certain unique features that differentiate them and make them more suitable for certain purposes.

In this case the @ symbol works like a pointer. If I used the instruction [MOV #1 D300] I would move the hex data [x0001] to memory location D300. To be clear, #1 (the second argument) is a hexadecimal (symbol #) constant of value x0001. If, as in the above example, D300 contained the value [x0100] (=256 decimal) and if I used the instruction [MOV #1 @D300] I would not move the value [x0001] to D300 but I would move it to the address contained in D300 - in this case D256.

Note that the @ symbol is used for pointers in binary/hex format. If D300 = [x0100] then a MOV instruction to @D300 will move data to D256 (hex 0100). You can also use the * modifier to do [MOV #1 *D300] and this will treat the 0100 stored in D300 as a BCD value - in other words, instead of pointing to D256 it will point to D100!

Using pointers allows you to not have to modify your MOV instruction, for example, if you want to direct a value to a series of different places in different conditions. If you wanted to redirect the memory movement to a different address you would just update the address value stored in D300.

Note that the @ symbol can mean other things with mnemonics - @LD, for example, means a differential UP contact!

Otros consejos

The @ sign in a function in Omron PLC means it operates only on a leading edge. For example, With the older PLCs @INC or with the newer PLCs @++ means increment a channel by 1 on a leading edge. The ++ function in the newer PLCs is binary while the INC function in the older PLCs is BCD.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top