ChZeman (Customer) asked a question.

FSC Instruction Equivalent in Productivity

I'm attempting to convert an A-B PLC5 program to a P1000. I *sort of* understand what A-B's FSC instruction does but not enough to translate it in to Productivity logic.

 

The program is triggering sound effects, so safety is of no concern here.

 

MWSnap 2024-08-27, 08_48_37MWSnap 2024-08-27, 08_49_22MWSnap 2024-08-27, 09_23_57


  • Todd Dice (Customer)

    Just a hunch but it's an array search and compare so maybe do a math compare within a For/Next loop?

    Selected as Best
  • Todd Dice (Customer)

    Just a hunch but it's an array search and compare so maybe do a math compare within a For/Next loop?

    Selected as Best
    • ChZeman (Customer)

      That's the part that confused me (array search), but I think I get it now. If I'm correct, #N9:0 includes N9:0, N9:1, N9:2, and so on.

  • OkiePC (Customer)

    The FSC in RSLogix 5 has a mode setting and I had not seen Mode "10" before so I looked it up. Usually the mode is 1 or All. All mode means it does the search of the whole LENgth of the file in one scan which can produce a spike in the scan time of an old slow controller.

     

    In your example, in a single PLC scan with the rung-in condition true, it will perform the compare expression on ten elements. If the expression is true (N7:14 <> N9:x where x is 0 through 30, ten elements per PLC scan) the FD bit is set and the search stops. The # symbol indicates the address is indexed to the control word POS element. In your case the left side of the compare is not indexed, just N7:14.

     

    Typically, somewhere the control word FD bit is checked and if set, the value at N9:[R6:0.POS] is copied or compared being the one that was FounD to satisfy in the inequality expression of the search.

     

    EDIT: Further study of your screenshots tells me that the big picture purpose is the trigger the "Bird" output at a certain time based on the entries in the N9 file matching up with the time value stored in N7:14.

    Expand Post