Posted 27 Mar 2014 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
Posted 27 Mar 2014 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
Posted 27 Mar 2014 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
Posted 28 Mar 2014 (edited) 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 28 Mar 2014 by Difool Share this post Link to post Share on other sites
Posted 28 Mar 2014 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
Posted 28 Mar 2014 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