Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Contact Us
  • Home
  • Products
  • Automation Systems
  • Programmable Logic Controllers (PLC)

Indirect addressing DM in CX-Programmer

Written by Arlo D'Cruz

Updated at March 18th, 2025

Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Products
    Automation Systems Control Components Motion & Drives Quality control & Inspection Robotics Safety Sensing Services Software Switching Components
  • Amplify e-Store
    e-Store public
  • Public CSC
+ More

Indirect Addressing in CX-Programmer: *D vs. @D

In CX-Programmer, indirect addressing allows accessing data dynamically using an address stored in another memory location. The *D and @D operators determine how the address is interpreted.


1. Key Difference Between *D and @D

Operator Address Format Explanation
*D BCD (Binary-Coded Decimal) The value in the pointer register is treated as a BCD number, meaning it can only store values 0-9999.
@D Binary The value in the pointer register is treated as a binary number, allowing full 16-bit addressing (0-65535).

2. Using *D (BCD Indirect Addressing)

*D treats the pointer value as BCD, meaning only valid BCD values (0–9999) can be used. If a non-BCD value is in the pointer, it may cause errors.

Example: Indirect MOV Using *D

If:

  • D0 contains #0200 (BCD format, meaning 200 decimal).
  • D200 holds #1234.

Then:

MOV *D0 D10

What Happens?

  • D0 contains #200 (BCD).
  • *D0 means access D200.
  • The value in D200 (#1234) is moved to D10.

✅ Correct Usage: D0 contains a valid BCD address (e.g., #0200).
❌ Incorrect Usage Example: If D0 contains 021A, this is not a valid BCD value because A is not a decimal digit. This would cause an error or unexpected behavior.


3. Using @D (Binary Indirect Addressing)

@D treats the pointer as a binary value, allowing a full range of addresses (0–65535). This is generally more flexible and avoids BCD limitations.

Example: Indirect MOV Using @D

If:

  • D0 contains &200 (binary).
  • D200 holds &5678.

Then:

MOV @D0 D20

What Happens?

  • D0 contains &200 (binary).
  • @D0 means access D200.
  • The value in D200 (&5678) is moved to D20.

✅ Advantage: @D allows full 16-bit addressing, unlike *D which is limited to BCD.
✅ More Common Use Case: Most PLC programmers prefer @D for flexibility.


4. When to Use *D vs. @D

Operator Use Case
*D (BCD Indirect) When working with BCD-encoded data (legacy systems, HMI settings, etc.).
@D (Binary Indirect) When working with normal binary memory addressing (recommended in most cases).

5. Summary

  • *D is for BCD-formatted addresses (0-9999), which may cause errors if non-BCD values are used.
  • @D is for binary-formatted addresses (0-65535) and is generally more versatile.

Recommendation

Unless working with BCD-encoded data, @D is preferred because it avoids BCD conversion issues.

 

 

cp cj pointer

Was this article helpful?

Yes
No
Give feedback about this article

Related Articles

  • Troubleshooting - Monitor Connected/Disconnected Ethernet/IP Units through CX-Programmer
  • How to Backup and Restore a Sysmac Project to a SD card
  • Error codes in Sysmac Studio

Definition by Author

0
0
Expand