Jairus

need help on compare instruction value changes

4 posts in this topic

Posted (edited)

Hello Omron programmers, have a nice day to you all.

I just need your help in this, i hope you have explanation. 

I added a few sequence to the machine with compare instruction D2255 and D2259 as memory data. I really wonder what’s going on. D2255 a decimal value of 9, when it transferred to compared instruction it’s 9, but when D2255 become 10 or above, when it transferred to compared instruction it will become 16 or above, there is an additional of 6 to the decimal value when it more than 9. I attached the photos of it for more details. Can somebody please help me? Thank you.

pn1.jpg.a73edab421f20bf0078e28cebd09ac90pn3.jpg.55370e3995d0eb36de5ebd68ae5f791d

 

 

 

 

 

 

Edited by Jairus

Share this post


Link to post
Share on other sites

The +B Sets D2255 to a BCD value. Decimal to BCD 10=16. Hope that helps.

 

opop.PNG

Capt.PNG

1 person likes this

Share this post


Link to post
Share on other sites

Your value is being added, +B (404), in BCD format. Decimal &16 is the same as BCD #10.

You just need to view it correctly. From the Menu, click View > Monitoring Data Type > Monitor in Hex.

2 people like this

Share this post


Link to post
Share on other sites

thank you, got it.   now i need to replace my math instruction to + instead of +B. 

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