raber

Compare 2 memory registers

4 posts in this topic

I would like to compare the content of 2 registers of D memory on my CJ1M PLC.

I'm trying instruction = (equal) and D30 and D50 memory registers to compare data and activate an output, but I don't understand why it shows the same direction (&98 on the image).

 

img8.PNG

Share this post


Link to post
Share on other sites

You are not monitoring in the Memory (inset) window.

In the third row of icons from the top, click on the icon all the way to the right.

This will turn on monitoring in that window.

gtsuport

Share this post


Link to post
Share on other sites

I answered part of the question in the other post. I missed that you are not Monitoring, as gtsupport has pointed out.

Also, the '=' instruction will only compare a single (16 bit) register. If you want to compare an entire String, then you'll need to the '=$'. This will compare consecutive registers up to the end of the String. Compare up to the first null character (00).

Share this post


Link to post
Share on other sites

Thank you very much for your answers, it is working now!

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