mr_electrician

Why does the BCD Indirect not move data for me???

5 posts in this topic

Hi forum. 

I am expanding my programming knowledge by experimenting with different instructions that I typically have not used.  I am following the CX Programming manual for Indirect Referencing of Data Memory in BCD format.  I have written the code to a tee as shown in the manual by using the " * " to signify BCD.  When I try the code it does not transfer a BCD value (actually no value at all) into D20044?

I was able to make the Indirect work for Binary by using the " @ " symbol but the BCD is not playing well. 

Any thoughts?

FYI: I am working with a CP1H XA bench PLC

BCD Reference.jpg

BCD Reference Manual.jpg

Share this post


Link to post
Share on other sites

In the symbol table select the receiving address as BCD.

Share this post


Link to post
Share on other sites
11 hours ago, mr_electrician said:

BHi forum. 

I am expanding my programming knowledge by experimenting with different instructions that I typically have not used.  I am following the CX Programming manual for Indirect Referencing of Data Memory in BCD format.  I have written the code to a tee as shown in the manual by using the " * " to signify BCD.  When I try the code it does not transfer a BCD value (actually no value at all) into D20044?

I was able to make the Indirect work for Binary by using the " @ " symbol but the BCD is not playing well. 

Any thoughts?

FYI: I am working with a CP1H XA bench PLC

BCD Reference.jpg

BCD Reference Manual.jpg

The indirect addressing you are trying to use means the pointer value is in BCD.  You can only use 0-9 numbers in a BCD number.  So, BCD numbers only range from 0 - 9999.  The number that you have in your pointer (when monitored in Hex (or BCD)) is 4E4C, which is not a valid BCD number.  To clarify, 20044 when monitored in HEX / BCD (button with 16 in toolbar) is 4E4C.  When you use the BCD pointer, it limits the range that you can use from 0 - 9999.  Thus limiting the access to D0 - D9999.  There is really no reason to use it except for when converting an old program.  

Share this post


Link to post
Share on other sites

Thanks @Michael Walsh for clarifying.  You mention that there is no reason why I would use this function and agree that I probably won't.  I am just wanting to go through each instruction and feature to help me become more familiar with more advanced programming styles.

Share this post


Link to post
Share on other sites
27 minutes ago, mr_electrician said:

Thanks @Michael Walsh for clarifying.  You mention that there is no reason why I would use this function and agree that I probably won't.  I am just wanting to go through each instruction and feature to help me become more familiar with more advanced programming styles.

I understand, I was just making the statement that he @D function gets you access to everything in the D range and the *D does not.  Good luck!

1 person likes this

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now