Sign in to follow this  
Followers 0
pszczepan

FB + structured text and array question

7 posts in this topic

Hi I need to put values from D area f.e. D110-D117 to array Do I have to prepare 7 input variables as I did below or I can set in FB that values for Array variable are in some memory areas, and it gets values automaticly - it would be useful

Share this post


Link to post
Share on other sites
If you declare your array variable "paleta" with and AT setting of D110 it is not necessary to have an input for each UINT. The disadvantage of this method is that you can only use one instance of the function block in the program. If you want to re-use the FB then you must make a copy of it and change the AT setting. Remember that ANY AT setting is hard-coded inside the FB and cannot be changed.

Share this post


Link to post
Share on other sites
You can also create your own offset to make it more dynamic, and then the FB can be re-used.... Edited by scottmurphy

Share this post


Link to post
Share on other sites
Hi I will use this FB once - so Bits_&_Bytes method will work well, but anyway I would like to know how you - ScotMurphy want to do that more dynamic. Do you have any sample to look into to learn this method. It can be useful someday...

Share this post


Link to post
Share on other sites
Hi, you can define an array as IN/OUT in the FB. (Not possible with old CX-P versions) Edited by Harald_Brueck

Share this post


Link to post
Share on other sites
I have NSJ with 3.0 firmware version - I cannot use IN-OUT variables Edited by pszczepan

Share this post


Link to post
Share on other sites
I know this is an old post, but I found an alternative solution at MyOmron that addresses the issue of "Passing An Array Of Data To A Function Block". This allows the function block to be reused [does not use an "AT" variable] unlike previous examples in this post. For OMRON users the MyOmron site is an additional resource to MrPLC well worth registering for. ArrayPassing.zip

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