Sign in to follow this  
Followers 0
lchamarthi

How to use PMCR simultaneously

16 posts in this topic

Hi everybody, I am using 6 PMCRs instruction in Modbus RTU communication in Protocol macro mode. right now i used timing delay for starting next PMCR. This way there is a delay in communication. So i would like to immediately start next PMCR instruction once previous PMCR is finished. Can anybody help me in achieving this? Regards Chamarthi

Share this post


Link to post
Share on other sites
To time multiple macro's use the PMCR sequence flags as described on attatched page. You can use the Excel document to easily generate symbols according to card type and unit number. SCU_symbol_generator.xls Pages_from_W336_E1_08_SYSMAC_CS_CJ_OperManual.pdf

Share this post


Link to post
Share on other sites
Thank you very much PDL for the quick reply and info. I am bit confused to play with this bits/flags in ladder. Mine is SCU, unit number 5. If you have any sample code will enable me to go fast.. Thanks a lot. Edited by lchamarthi

Share this post


Link to post
Share on other sites
Hello Lakshmi, You could use the PMCR execution flag (NC) and the Communications Port enabled flag (NO) before the PMCR instruction, to ensure that only one PMCR can execute at any one time. This would enable rapid changeover from one PMCR instruction to the next.

Share this post


Link to post
Share on other sites
You could use the PMCR execution flag (NC) and the Communications Port enabled flag (NO) before the PMCR instruction, to ensure that only one PMCR can execute at any one time.

Share this post


Link to post
Share on other sites
The advice from anonymous and PDL is right on. Proper use of the PMCR Executing bit and the Logical Port Available bit will work 100%. Please post the PMCR portion of your code if you are still having problems.

Share this post


Link to post
Share on other sites
Please find my sample code. with these timers its working fine for maximum 25 bytes message. If i remove the timers, communication not happening properly even if i have used PMCR execution flag NC and port enable flag NO for the second PMCR execution. I think i have to use some more flags...pl help me 2PMCR.cxp

Share this post


Link to post
Share on other sites
I am not sure but it looks like the PMCR instruction is aborted before it is completed. Can you latch the instruction execution with an NC of the sequence end and a NO of the sequence executing flag? This way it is latched while executing and unlatched when the sequence ends? Not sure if ti will work but worth a try. Also use the P_ER contact on a coil to see if there is an error within the PMCR instruction. Also, copy the symbols generated by the excel document and paste them in the symbol list. This simplifies reading the code.

Share this post


Link to post
Share on other sites
Attached is an example of how this can be done in a sequential manner.3PMCR.cxp If possible, I would make the control word (first parameter) a constant, not a DM. I am concerned that there are errors in the control word that I cannot see. Incorrect construction of the control word will make the PMCRs not work well.

Share this post


Link to post
Share on other sites
Use a FIFO stack to transmit PMCR's. Each event pushes a specific PMCR number onto the stack. The PMCR is then sequentially pulled from the stack and transmitted via the serial port. See attached example. PMCR_messaging_FIFO.zip

Share this post


Link to post
Share on other sites
Hello PMCR, Thanks for editing my sample code and correcting. Its working fine now. Now the communication delay reduced to 1sec. Now my turn is to create an alarm for the slaves which are not physically present but polling is done. Suppose, Max step counter is 5. While step counter is 2 and executing second PMCR. slave #2 is not physically present but slave3 ....4 & 5 are connected. In this case, i am getting an ERC error on the module but based on this I couldn't able to display a message to an operator that Slave # 2 is not present or not working. Any idea or help on this? Thanks Lakshmi

Share this post


Link to post
Share on other sites
This is in the download section. Sometimes pays to check there. http://forums.mrplc.com/index.php?autocom=downloads&showfile=329

Share this post


Link to post
Share on other sites
Bob- Great point. I had not thought of applying that to this application. That multidrop w/ missing nodes is great if you don't need to point out which nodes are missing. It is a mechanism to skip over missing nodes. It sounds like this application requires the missing nodes to be identified, and seperate PMCRs for each node is a better way to handle this. Lakshmi A properly structured Protocol Macro should not cause an ERC. That sounds like you may be trying to execute a second PMCR while one is already running. Please post or send me a private message of the relevant section of ladder code and the PMCR file.

Share this post


Link to post
Share on other sites
Thanks Sample_Ladder.zip Edited by lchamarthi

Share this post


Link to post
Share on other sites
You can use shift register to do that also, attached with an example for your reference. Thank you. PMCR_simultaneously.cxp

Share this post


Link to post
Share on other sites
PMCRReturned.zipThe attached code should fix the ERC and give you feedback for success / failure for each node. Note: I changed the PMCR control word from &61717 (#F115) to #0115. The 'F' indicated automatic allocation of the logical port, but you were using A202.00, not A202.15. A202.15 is the 'port available' bit for automatic allocation. In general, I don't like to use automatic allocation. I also changed the timeout timers in your PMCR from 0.030 seconds to 0.300 seconds. 30ms is a very short time for a timeout. These are only timeout timers. If the node responds, the PMCR finishes immediately, and these timeouts will not slow down the PMCR.

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