gorichan

# and & symbol in CX-Programmer

7 posts in this topic

Hey guys. I just want to know what is the meaning of these following symbols # = ? & = ? Is it Binary, Hex, BCD, Decimal or what? Those symbols are assigned in CX-Programmer for CMP(20) instruction purpose.Im using PLC CQM1H type. And Im comparing analog input with certain constant value. Cheers

Share this post


Link to post
Share on other sites
Hello gorichan, # represents a Hex value, & represents a Decimal value. I.e. #10 = &16. Hope this helps Regards anonymous

Share this post


Link to post
Share on other sites
Hello anonymous Thanks. Of course that helps!! Thanks again.

Share this post


Link to post
Share on other sites
# is also used for BCD. If your #-constant is interpreted as hex or BCD is context-dependant - basically, some instructions interpret their parameters as hex, some as BCD, and some work with both as long as you stick to one type(example: CMP). There's no difference how hex vs BCD is stored in the PLC memory, so the only way to know the content of the word is from the symbols and/or the code.

Share this post


Link to post
Share on other sites
ohh. I see. But my constant, I set it with & because the analog input that CMP(20) reads (as default) as &. Its range from &0 up to &2047. How I want to make CMP(20) reads the analog input as # instead?

Share this post


Link to post
Share on other sites
use BCD instruction of course

Share this post


Link to post
Share on other sites
Do something like this in ladder BCD (ANALOG INPUT ADRESS) D100 The analog input is now stored on D100 as a BCD value. If you ant to convert that input fot a value in BCD, but with another scale do as the follow: MOV &0 D200 MOV #0 D201 MOV &2047 D202 MOV #500 D203 SCL (Analog input adress) D200 D300 The analog input is now stored as a BCD value coming from 0 to 500

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