Sign in to follow this  
Followers 0
DmitryK

PID in FB

15 posts in this topic

Have so interesting problem. I want to use PID inside function block. PID needs parameters area which contains internal varibales of PID. Indirect addressation in FB is not working (I tryed to write commands like MOV #1 @D0 - compiller not understand it.) Sending each parameter to FB as words is not best solution, because PID have so many parameters. But in this choice I can't make one area of words, FB compiler can make parameters in different places. Have I use internal FB arrays or there are any other solutions for that situation?

Share this post


Link to post
Share on other sites
Hi I am using Arrays for other instructions used in funktionsblocks. I most be the only way to addres to the controlwords. Banker

Share this post


Link to post
Share on other sites
... Banker is correct, the use of arrays allows PID parameters to be set within a function block. See attached PID FB Example. (also includes scaling FB which is used by PID FB) Nibroc PID_FB.zip

Share this post


Link to post
Share on other sites
Hi Nibroc I tryed to open open your Funktion block PID. But my CX-programmer (Ver.5) giving me a Error: ERROR: Item key 'CXProgVer': String attribute not found WARNING: Item key 'CXProgVer': Assigning default string ERROR: Invalid file version. For the scaling funktionblock there is no problem. What can be wrong? Banker

Share this post


Link to post
Share on other sites
Perhaps you require CX-Programmer V6. Upgrade to CX-One, it is worth it.

Share this post


Link to post
Share on other sites
... BobB may be correct, I checked by downloading the files and trying with CX-P V6.0, all OK. I have printed the FB's out as .pdf, so you can re-enter them manually. Nibroc PID.zip Edited by Nibroc

Share this post


Link to post
Share on other sites
Nibroc I can see you are using nesting in you PID funktionblock. I don't think CXP. 5 have this facility. Banker

Share this post


Link to post
Share on other sites
Unfortunately, true. Regards anonymous

Share this post


Link to post
Share on other sites
... You will however, still be able to implement PID within a function block. There are several ways you can perform any scaling if required. eg: 1. Perform scaling outside the FB (with normal ladder or an external FB) and pass the resultants as variables. 2. Perform any scaling with ladder code directly within your PID FB. Nibroc

Share this post


Link to post
Share on other sites
I know this is a little older post but Nibroc I have uploaded the Scale with paramters in the download section. I should have done this earlier, but heh.. The one I uploaded will give the output as an Interger and Real value. Over and Under flag bit are also provided. The input can be clamped if desired also. Scale with Parameters

Share this post


Link to post
Share on other sites
.... Was the updated FB written with CX-P v6.1? It does not load on V6, comes up with a version error in the output box. Wonder when Omron NZ are going to distribute CX-One, 1.1 (downloading off the net is fine, but these files are really too large for many of us, with my internet subscription, this would be over a months traffic allowance !!) Nibroc

Share this post


Link to post
Share on other sites
Originally written with V6.0. Added Write portection with V6.1, mabey thats causing the error. Try this version. Heres the listing in pdf. SCL_Parameters.zip ScalewithParameters.pdf

Share this post


Link to post
Share on other sites
Hi Nibro, I tried to use ur PID block inside my project. Unfortunately, it's not working. Please help. Min Oo. PID test_Minoo.cxp

Share this post


Link to post
Share on other sites
Hi , This PID FB doesn't worked with me also , some on could post an example for using this PID in ladder program.

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