Sign in to follow this  
Followers 0
Difool

RSRCH function

6 posts in this topic

Hello, I want to find a value in ten words (D7000-D7009). For that, I use the RSRCH= function. Here is the values of the control word : - D6000 : 10 (#000A) - D6001 : 1 (#0001) - D6002 : 0 (#0000) - D6003 : 0 (#0000) - D6004 : 0 (#0000) - D6005 : 0 (#0000) Here is the values of the data table (for testing) : - D7000 : 1 (#0001) - D7001 : 2 (#0002) - D7002 : 3 (#0003) - D7003 : 4 (#0004) - D7004 : 5 (#0005) - D7005 : 6 (#0006) - D7006 : 7 (#0007) - D7007 : 8 (#0008) - D7008 : 9 (#0009) - D7009 : 10 (#000A) But in the following code, the P_EQ flag stay at OFF state (and also TestFound bit). Why ? What is Wrong ? I work with a CJ2M CPU. Thanks

Share this post


Link to post
Share on other sites
Did you test this in Simulation mode or on the actual PLC? The instruction appears to not work in Simulation mode, but I plugged your example into a CJ2H PLC and it worked just fine.

Share this post


Link to post
Share on other sites
Remember me when i lost an evening at home trying to figure out what was wrong, I was testing something in PID instruction in the simulator.

Share this post


Link to post
Share on other sites
I was testing in simulation mode ... Thanks for the reply ! Does it have a list of known instructions that does not work correctly in the simulator ? Edited by Difool

Share this post


Link to post
Share on other sites
Yes, but it does not list by instruction name in all cases. It lists the compatibility by function group. You can find the instruction group by going to help in CX-Programmer and choosing Instruction Reference for CS/CJ. The manual is installed with CX-One and can be found here: From Section 1-6 in the manual, I found the image below (I clipped out non-relevant info). It shows that the Tracking instructions (RSRCH= is a tracking instruction) are not executed. It just so happens that PID is right next to the tracking instruction field, so I posted it as well due to pfort's previous experience with this issue.

Share this post


Link to post
Share on other sites
Thank you very much ! I would be nice that the instructions not executed in simulation mode are marked (with different color).

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
Sign in to follow this  
Followers 0