Make FSC Instruction Length dynamic. Logix5000

Dirtleg

Member
Join Date
Dec 2014
Location
Virginia
Posts
25
Maybe this is just not possible, or maybe I am doing something wrong.

Background;
I have a data array of over 1500 products. For sorting I have to first scan this array to verify the barcode is read and it matches 1 of the product numbers.

Then I compare the detected height (I have a sensor to read this) to the product height in the database.

If either of these fails it gets rejected. If it passes I then have to determine which of 33 potential pallet locations to send it to.

Each pallet can have up to 32 individual products on it, but most at any given time will have only 1.

Certain selected pallets will "collect" unassigned skews. This means they passed the database check but do not have a known collection point.

So, each time a case is scanned, I have to check it against potentially 34 databases. Using the FSC instruction I am worried about scan times as my first divert point is maybe 2 seconds of processing time from the scanner. Rate is 60+ per minute.

I'd prefer to only search an array for it's known length which may only be 1 item, than scroll through all 32 array levels in each array. Also the number of items in an array can change dynamically so it would be nice to be able to update the FSC Length.

The FSC instruction Length is identified as a DINT but I cannot get it to take a tag that can be changed dynamically. Would effectively solve my issue if that were possible.

I have since conceived a different concept that I think I can make work with a single array, but still thought I'd ask the question bout the FSC instruction Length.

Thanks.
 
Roll your own FSC using FOR NEXT for which you can set the terminating value of the Loop.
 
As usual, I'm risking the ire of the AB enthusiasts by suggesting that you do the work in ST. It is a language that is designed to loop. FSC and related instructions are difficult to implement and they raise a host of questions on this forum. If someone doesn't understand ST then they probably don't understand many of the complexities of Ladder either.

The 1131 languages are there for a reason - use the best language for each task.
 
The FSC instruction Length is identified as a DINT but I cannot get it to take a tag that can be changed dynamically. Would effectively solve my issue if that were possible.


Does


MOV len_var FSC_Control_Structure.LEN

not work?


You should probably also ensure the FSC_Control_Structure.POS attribute does not exceed the length.
 
Does


MOV len_var FSC_Control_Structure.LEN

not work?


You should probably also ensure the FSC_Control_Structure.POS attribute does not exceed the length.

Yes, if you mess with the FSC LEN attribute, make sure you do proper bound checks. Easy way to fault the processor.

Did Rockwell dispense with Numerical mode? Once upon a time you could spread the FSC operation across scans. It's still in the HELP, but doesn't appear as an option in editor. Would be curious what would happen if you changed the LEN to less than POS in that case.
 
Does


MOV len_var FSC_Control_Structure.LEN

not work?


You should probably also ensure the FSC_Control_Structure.POS attribute does not exceed the length.

Yes, if you mess with the FSC LEN attribute, make sure you do proper bound checks. Easy way to fault the processor.

Did Rockwell dispense with Numerical mode? Once upon a time you could spread the FSC operation across scans. It's still in the HELP, but doesn't appear as an option in editor. Would be curious what would happen if you changed the LEN to less than POS in that case.

I didn't think about messing with .LEN. Don't know why. I mess with that stuff enough in messaging file paths so it makes sense.

Thanks.

I only have about 2 seconds to do all the decision making and executing a divert operation downstream. Numerical mode, if available, probably would take too long.

Anyway, I have since rethought what I am doing and have narrowed it down to a single array scan that does everything I need including assigning pallet locations in 1 scan. Also sends case to reject in the event the .POS = .LEN and .FD is an XIO.

Not worried about .POS as I have left space in the array. Never know when the customer will want to add products.

But knowing we can manipulate the .LEN in the FSC answers my original question.

So thank you.
 

Similar Topics

I have a FSC instruction that won't enable. I check tags and data type and can't find the problem. I'm trying to pull index numbers for data...
Replies
4
Views
731
Hello Please Help, I want to use a FSC instruction that will scan 20 DINT arrays. If the arrays are greater than 1000 display the value. How do I...
Replies
4
Views
1,766
Hello, I'm brand new to the forum and I have a frustrating problem at work that I've been trying to find a solution to. I have scanned the...
Replies
7
Views
11,215
I have been using the FSC instruction in a couple of application successfully. I am now trying to use it in a new application, and I feel that I...
Replies
4
Views
2,561
I've been beating my head :bonkhead: in all day trying to figure out why the FSC instruction isn't working in my Program. I Created a 1500 Recipe...
Replies
13
Views
7,016
Back
Top Bottom