AB ControlLogix 5000 FSC instruction

mike J

Member
Join Date
Oct 2013
Location
King of Prussia,PA
Posts
3
I have a boolean array 10 elements long, and would like to be able to trigger an event when any three of these elements equals 1. I have not had any luck with the FSC instruction; it stops at the first found element. Am I using the correct instruction? or does someone have a better suggestion? Thanks...
 
How bout using a FOR NEXT loop to go though each index of the array and count the 1's found.
 
Or if you are an old school ladder guy, you could do this is in about 11 rungs of code.
 
The FSC instruction sounds like it is doing what it is suppose to do. It executes until if finds a match, and returns the position. Read up on the .IN bit. You may need to clear this down to continue the search.

IF .FD, add one to a counter, clear down the .IN bit to re-start the FSC, if .FD again add one to the counter. Once the .DN bit is set the FSC completed, clear down the counter and FSC and restart. IF at anytime your counter is >= 3 trigger your event and resume the scanning.

You could do a FOR - Next loop, a little overkill since you require a dedicated subroutine to scan, but certainly an option. You use jmp/lbl instructions to create a basic indexing loop, so you scan through each element using an index, if it is = 1 add 1 to your counter, if your counter is >= 3 trigger your event. Reset the counter after each completed scan.

Or you can do the manual program by force method too.

How simple or complex you wish to make it is probably the question of the hour.
 
From what the OP is describing, it would seem the FBC instruction is better suited to the task (just look for a non-zero 3rd element in the result array).
 

Similar Topics

I'm attempting to read tags from a 1756L81E(FactoryTalk Logix Echo) controller using the PLC4J api. I have one read and one write bool setup in...
Replies
10
Views
2,286
Hey All, I'm currently building a control system for a large building in a industrial setting. Doing lighting, vent, roof control, door access...
Replies
12
Views
3,498
I know there's the DTOS Function, but I have a value of "35" that is really "0035", and that's how I want it converted. Looks like the function...
Replies
2
Views
1,521
I am an Electric Engineer working as a maintenance engineer and manage some technician on the production hall now but in the past, I mostly focus...
Replies
12
Views
3,545
I'm not a PLC programmer, so bear with me here ... I was making an AOI with a bunch of BOOL inputs and realized some of them were actually...
Replies
6
Views
1,808
Back
Top Bottom