Sign in to follow this  
Followers 0
Olyn

STORING REAL VALUES IN FUNCTION BLOCK RSLOGIX5000

7 posts in this topic

Hi everyone! I am new with RSLogix 5000 I just need some help. Is there a function block in RSLogix5000 that can be use to store real values? I need it for this, when the 1st value comes in it will be saved and when the second value comes in it will only take place the 1st value but will no be erased and so on. Many thanks!

Share this post


Link to post
Share on other sites

Hi Olyn

Firstly welcome to the forum.

It sounds like you want to pass a REAL Data Type into a FIFO (First in First out) does this sound correct? So the newest value is always at the top but old values are kept below.

Take a look at the standard RSLogix5000 Function for FIFO (Load and Unload).

Otherwise I can send you my custom Add-On-Instructions that can hold 5.10 or 20 Values in the REAL data type.

See my attachment that demonstrates operation with the INT data type. If you want a copy of my encapsulated code- just let me know.

 

Regards

Daniel

IMG_3389.PNG

Edited by collinsd70
1 person likes this

Share this post


Link to post
Share on other sites

Thank you for helping! This is correct and I thought there's an instruction for this in function blocks since I have tried the MAVE instruction but that doesn't fit, I have also tried using the FFL instruction that copies the REAL data to the FIFO and it actually recorded the REAL data.

BTW, I have other application for this in the plant. One scenario is, sometimes the charging stopped for a reason, is there a way to make the NEWEST to be the OLDEST? I am thinking of just moving the data based on a condition.

Please send me your custom Add-On-Instructions. Thank you!

Edited by Olyn
lack of info

Share this post


Link to post
Share on other sites
11 hours ago, Olyn said:

Thank you for helping! This is correct and I thought there's an instruction for this in function blocks since I have tried the MAVE instruction but that doesn't fit, I have also tried using the FFL instruction that copies the REAL data to the FIFO and it actually recorded the REAL data.

BTW, I have other application for this in the plant. One scenario is, sometimes the charging stopped for a reason, is there a way to make the NEWEST to be the OLDEST? I am thinking of just moving the data based on a condition.

Please send me your custom Add-On-Instructions. Thank you!

How many REALs do you wish to store in this FIFO?

What version of RSLogix500/Studio5000 are you using?

I will have to customise the AOI to your requirement.

 

 

Regards

 

Daniel

Edited by collinsd70

Share this post


Link to post
Share on other sites
10 hours ago, collinsd70 said:

How many REALs do you wish to store in this FIFO?

What version of RSLogix500/Studio5000 are you using?

I will have to customise the AOI to your requirement.

 

 

Regards

 

Daniel

I need 6 REAL's to store to the FIFO and the NEWEST will always be on TOP. I am using Studio 5000 v30. Thank you!

Share this post


Link to post
Share on other sites

Hi Olyn.

See attached a 6 Element FIFO for the REAL Data Type.

Instructions

1. Import the AOI into your Project.

2. Create an Instance in either Global or Local Memory.

3. Load the AOI into your Selected Routine, Connect the Clearall Boolean and the REAL which will load to the FIFO.(the REAL is loaded when it changes value). Note the Clearall is an IO Parameter so will be passed through the AOI and reset once all buffers are emptied.

4. oFIFO_Pos will tell you the location of the most recent Variable (to be used for an Arrow on a HMI for example)

I have confirmed operation on Emulate5000 and all seems to work correctly.

This AOI will load and store 6 Variables only, do not attempt to change the array sizes, if you do; you may crash the PLC.

 

 

Regards

 

Daniel.

6FIFO_REAL.jpg

AOI_6FIFO_REAL.L5X

Edited by collinsd70

Share this post


Link to post
Share on other sites
On 2/27/2019 at 5:18 PM, collinsd70 said:

Hi Olyn.

See attached a 6 Element FIFO for the REAL Data Type.

Instructions

1. Import the AOI into your Project.

2. Create an Instance in either Global or Local Memory.

3. Load the AOI into your Selected Routine, Connect the Clearall Boolean and the REAL which will load to the FIFO.(the REAL is loaded when it changes value). Note the Clearall is an IO Parameter so will be passed through the AOI and reset once all buffers are emptied.

4. oFIFO_Pos will tell you the location of the most recent Variable (to be used for an Arrow on a HMI for example)

I have confirmed operation on Emulate5000 and all seems to work correctly.

This AOI will load and store 6 Variables only, do not attempt to change the array sizes, if you do; you may crash the PLC.

 

 

Regards

 

Daniel.

6FIFO_REAL.jpg

AOI_6FIFO_REAL.L5X

Thank you!

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