So if the S:FS is in a subroutine, and the subroutine is called from a JSR in the main routine on the first scan, then the subroutine is called on the first scan so an S:FS in the subroutine would be effective 1 time on startup.
Each
PROGRAM has it's own S:FS bit, not
TASK as has been suggested. Each
Program's S:FS bit is set for the first scan of that
program.
Usually, all
Programs within a
Task are executed according to the
Program Schedule in the
Task Properties, so all the S:FS bits for all
Programs are synonymous, but it is possible to disable/enable programs, either manually, or under program control.
If you execute a subroutine with a S:FS bit from the MainRoutne, you don't need any S:FS bits in that subroutine, it will only get called once, and once only, when the processor goes into RUN mode.
If you introduce any delay (with a timer for intialisation, perhaps), then try and call the subroutine, the S:FS bit will have long gone off, so the JSR will fail.
I am a little confused with synchronous and non synchronous, etc. For example, does the plc register the JSR on the first scan, and then jump to the subroutine on the second scan?
Synchronous and Non-Synchronous has nothing to do with the S:FS bit. Usually the terms are applied to the method of I/O update. In nearly all previous A-B controllers, I/O updating took place at the beginning and end of logic scan, respectively (Synchronous). In Logix5000 systems the I/O is updated on a scheduled basis, during the logic scan, during a period called the "System Overhead Time-Slice" (Asynchronous). In certain cases, asynchronous I/O can be problematic, and most people buffer the I/O with mapping routines, that re-synchronises the data seen by the logic to the application scan.