Studio 5000 fifo array

Breadman

Member
Join Date
Aug 2019
Location
Home
Posts
16
Hi All
I am using a 42 dint array for a project. Im using a FSC instruction so if any values in the 42 dint array are lower then 32000 it will initiate a fll instruction and fill the array with a variable. This is so if for some reason there is a number lower then the machine can handle in the array it will move this higher number into the array.
The problem i have however is that dint(41) in the array is always 0.
I beleive this is because it is unloading that bit.
Is there a way to not have a 0 in the last dint of this array?
Thank you for your help.
 
A few things to think about when dealing with arrays
Years ago I got in the habit when I create an array I make I larger than I need. This helps prevent index overrun that will crash the processor. This is almost impossible to troubleshoot because when the processor is restarted the index is reset to 0.
When using a FSC function the FSC will start the search at index 0 and work it’s way up until the search expression is true. On the first true search expression the search stops the .FD bit is set. At that point your code will then place the desired number (36000) in the in indexed element.
The search will not continue until it is restarted (the Rung goes false to true again) so if you have more that one element in the array that is less than your desired value only the first one found will be changed.
You must restart the FSC or I believe you can just reset the .FD bit to allow the FSC to continue to next true expression or the .DN (done) is set
Another way to do what you want would be to setup an index loop using the expression and look at each element in the array and if it’s true then fill the element with the value
For X 0 to 42
If Tag(X) < 36000 then Tag(X) = 36000
next X
this would look at every element without stopping
 
All fixed
My Error came about by me not unlatching the FSCControl.IN tag.
Where i beleived the FSCControl.FD was high due to a 0 still in the array it actually was just that i was not reseting it properly.
Thank you GaryS. What you explained seems like a simpler way then what i have done.
Im still learning and really appreciate all the help.
Breadman.
 

Similar Topics

Hi Everyone. Not posted on here for a long time, but I am hoping someone can help me. I am doing a differential pressure calculation in a L27ERM...
Replies
15
Views
267
Hi, how do I convert 2x Integer registers to a Real? The two integers are from Modbus registers that contain a floating point value, I need to...
Replies
2
Views
121
What is the best way to extract the hour and minute from the register that comes from Yaskawa VFD. In studio 5000 I have a register saved as INT...
Replies
3
Views
125
I have an Allen Bradley temperature switch that I am trying to use in studio 5000. I am getting the message "Unable to interpret the IODD file"...
Replies
0
Views
76
Hi all. I want to ask what may seem a stupid question, as I have a project to send live data to a Yeacode line printer which will print meterage...
Replies
10
Views
200
Back
Top Bottom