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

Hello, We are now working on a software to collet the configuration of different PLC brands ,using a third software to backup all the simens...
Replies
1
Views
69
Hello everyone, I'm new here, I hope someone can help me. I've been trying to install EDS files to my Studio 5000 with the EDS tool installer but...
Replies
3
Views
113
Hi Everyone, I am facing an issue while installing the STUDIO 5000 in my windows 10 PC. During installation I am getting an error that " Error...
Replies
4
Views
181
I am connecting to a remote device. When attempting to upload I receive an error that states: Error: Auto_Functions: The Import was aborted due...
Replies
3
Views
183
Back
Top Bottom