Sign in to follow this  
Followers 0
ParaffinPower

Protocol Macro

18 posts in this topic

Hi guys Using PMCR with #Fxyz as the first operand, i.e. select a free port. If I have two PMCRs and execute them at the same time (well, in the same scan) using this method, does the PLC know that it's used Logical Port 0 immediately. I think I might be getting a clash and the port used flag hasn't refreshed yet causing the second PMCR to use logical port 0 too. The next question is when does the 'executing' flag refresh? What I'm seeing is both executing flags come on, the PMCR does its thing, but either one of the executing flags stays high They are both on the same SCU. Thanks, Pp

Share this post


Link to post
Share on other sites
I have wandered the same about the PMCR flags, I would think that it is updated at the end / beginning of the scan, when it does it's periphal servicing function. In relation to the logical ports, on a site that I am using both ports of the SCU, I am using logical port 0 for physical port 1, & logical port 1 for physical port 2. BUT, I think this is actuall related to the port that you specify in the PMCR control word. I have attached the configuration that I have working, it states what bits of the first control word provide what function, you probably know this though. Not sure if this will help or not? PMCRex.cxp

Share this post


Link to post
Share on other sites
Thanks for the reply, Scott. On this job, i have - wait for it - 14 serial devices, or I'd just assign a fixed logical port to each device. I'm deep in manual W340, and discovered that A218 contains the assigned logical port number (0-7). I'm hoping this is populated straight after the PMCR, and I'll write an FB to manage logical port assignment myself. I agree with you about the CIO being refreshed. I guess it's done at the beginning of the scan. After PMCR executing, it must take 'some time' for the command to get to the SCU, and after this starts executing, it will turn on the 'executing' flag. It must be the next scan before this is refreshed in the process input image (CIO) - possibly 3 or 4 scans after executing the PMCR. Who knows? Edited by ParaffinPower

Share this post


Link to post
Share on other sites
Possibly related to the response time of the remote device?

Share this post


Link to post
Share on other sites
Yep, i agree...14 serial devices... they couldn't talk RS485 and be assigned an address.... That way you could of had one port and have one execution for the protocol which would auto cycle through the available addresses to get the info from each,

Share this post


Link to post
Share on other sites
Hi Scott Can you post the CX-Protocol file - I am interested in what you have done.

Share this post


Link to post
Share on other sites
No problem Bob, I have removed the comms for port 1. The file has the Modbus RTU for 31 Danfoss VSD's I have also attached a snippet of the code that calls the cx-protocol sequences. I was trying to do the same thing with the CQM1H on the current project, but not working the same way for some reason. I have this one working now, is a minor issue with the reading of the actual frequency and hours which is bugging me, but I have control which is the main thing. Not letting me attach the cx-protocol file, I will email it through to you Bob. Danfoss_Modbus_RTU.cxp

Share this post


Link to post
Share on other sites
Just came across this thread, I'm working with a similar setup at the moment, I'm fairly new to Omron and haven't used serial comms very much. To Scott or Bob, would it be possible to to have a look at the Cx-protocol file for this project? Thanks

Share this post


Link to post
Share on other sites
Send me your email address and I will send you a file with several Modbus RTU reads from 2 SCUs.

Share this post


Link to post
Share on other sites
What protocol are you using? If Modbus RTU, then PMCR's Easy Modbus also works well for this.. All depends on what you are doing & what information you require though, sometimes is easier to create the protocol yourself, especially for large data reads.. We can provide mode information if you need.

Share this post


Link to post
Share on other sites
I will be communicating with 15 danfoss drives/softstarters, a 3 vlt5000's 6 fc302's and 4 mcd500's using modbus RTU. I was hoping to poll the drives status/control words continually, then other operating data such as power(kw's), motor thermal(%) at a longer interval. The vlt5000's have a max baud of 9600 whereas the newer models can go to 19200 so I may need to seperate the vlt's onto a seperate SCU or turn the newer models down to 9600. The plc is a cj2m-cpu33 with 1 cj1w-scu31.

Share this post


Link to post
Share on other sites
I have done the MCD's before, but VLT & FC302 I have. I can send through some example code later today if you want?

Share this post


Link to post
Share on other sites
Example code would be a great help. I have not had to do any PMCR stuff yet so It's all new to me. Would it be best to use both SCU ports or would it be ok all off the 1 channel?

Share this post


Link to post
Share on other sites
Did you get what I sent you Chris? There appears to be a problem at Gmail - I received notification that the mail had been 'delayed'?

Share this post


Link to post
Share on other sites
Hi Bob, No I haven't received anything as yet? I think you have 1 of my other email address's you could try. If not I'll send it through to you anyway. Thanks

Share this post


Link to post
Share on other sites
Attached is a basic example for CX-Protocol & CX-Programmer. Are you familiar with the Modbus protocol? In the CX-Protocol file there are 2x commands configured, 1 for the VLT, the other for the FC302. In reality though, they are using the same parameter sets so could be the same. This method requires less ladder to get it working & is therefore easier to maintain, all you need to do is call the sequence from the ladder program. Sorry for the quick description, in a hurry to get something else done. I should be able to answer questions/provide more assistance later today/tonight if required. Feel free to PM me as well. Danfoss Modbus Examples.zip

Share this post


Link to post
Share on other sites
Thanks lostcontrol and BobB for the sample code, i'm working through it 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
Sign in to follow this  
Followers 0