Sign in to follow this  
Followers 0
MuttsNutts

IR words

32 posts in this topic

Yes, performing a for / next loop in the PLC 200 times per scan will slow things down somewhat. The PLC will scan the ladder code inside the for / next loop 200 times. If this slows the processor down too much, you can certainly do 50 loops per scan, and spread the 200 loops out over 4 scans. Where you locate the code in the program will not affect the performance.

Share this post


Link to post
Share on other sites
thanx PMCR, actually i do need that loop around 1000 times. I was wondering if you have used that for / next loop actually in your program for door control. also i tried same logic using DR,IR instruction pointing to one door at a time. it works for one door but problem with that is if more then one door are opened at a time.

Share this post


Link to post
Share on other sites
I don't quite understand what you mean by 'if more than 1 door is opened at a time'. The example code that I posted uses individual timers for each door, and they run independently of each other. I have not used this specifically for door control, but for many other similar applications. If you are looping 1000 times, I would consider breaking that up into multiple PLC scans.

Share this post


Link to post
Share on other sites
In my understanding when you say break it down to multiple scan means instead of running for / next loop 1000 times, break it down to 10 for / next loop of 100 time each. Please correct me if i am wrong. I was just wondering in same section of program if i have one loop 1000 times, or if i have 10 loops 100 times how would the scan cycle and scan time be different. what i want to do is keep DR0 as offselt value. if door 100 is selected fire output 100 using timer T0100. and if door 101 is slected fire output 101 using timer T0101.

Share this post


Link to post
Share on other sites
I would not recommend the added complication of using DRs. They certainly would work, but I don't think that you need them. I did a test on a CJ1G-CPU45H. Running iterations of the for / next loop per PLC scan yields a scan time of ~0.6 ms, with no other PLC code running. Same PLC, with 1000 iterations of the loop running per scan yields a scan time of ~ 3.1 ms. So, there is a tradeoff. If you have a 3 ms scan time, you are servicing all doors every scan. This means that every 3 ms you have updated the doors. If you want a 0.6 ms scan time, it takes 100 scans (10 iterations of the for / next loop per scan) to service all 100 doors. 100 scans @ 0.6 ms = 60 ms to service all the doors. Either way is fast. If you have a lot of other code and the scan time is getting longer, switch to 50 or 100 loops per scan. Here is a working example of multiple scans to scan all 1000 doors. Door_Opening_Example.cxp

Share this post


Link to post
Share on other sites
I want to work around indirect addressing and I downloaded IR Monitor, I installed FINSgateway from CxOne3.0 I started cx simulator and monitor shows timeouts as in attachment. There is no manual how to setup Finsgateway to work with IR Monitor . Could you describe the procedure to working IR monitor - any suggestions? thanks Pawel

Share this post


Link to post
Share on other sites
You actually need a lot more than what comes with CX One. You need a full installation of FINS Gateway, which is purchased seperately. I added the online functions for a specific project that I was doing, not for 'normal' use. Alternately, you can use CX Programmer to monitor the IRs, and then convert from the RAW addresses to actual memory using the conversion part of the IR Monitor.

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