The operation of the PLC system is simple and straightforward. The Process or CPU completes three processes: (1) scans, or reads, from the input devices (2) executes or "solves" the program logic, and (3) updates, or writes, to the output devices.
For the PLC to be useful, it must first have a Program or Logic for the CPU to execute. A system engineer or PLC programmer will first create the program logic in a programming device (these days it is usually software running on a personal computer). This logic can be written in Ladder Logic, Instruction List, Sequential Function Charts, or any of the IEC languages.
The programmer will then download the program to the PLC. This is usually done by temporarily connecting the programmer to the PLC. Once the program is installed or downloaded to the CPU - it is usually not necessary for the PC to remain connected.
Once the program is in the CPU - the PLC is then set to "run", and the PLC executes the application program repeatedly. In addition to executing the program, the CPU regularly reads the status of the input devices, and sends data to the output devices. The Input system senses the status of the real world inputs (a switch, a level, etc.), translates them to values that can be used by the CPU, and writes those values to the Input table. The application program is executed, and writes values to the Output table. The Output system then converts the output value to a real world change (motor turns on, valve opens, etc.)
This process of reading inputs, executing logic, and writing outputs is called the PLC Scan or Sweep.
The CPU continuously Reads Inputs, Solves Logic, and Writes to the outputs (there are other tasks the CPU does - which will be discussed later). It is important to understand the scan because it may dictate how a programmer structures logic.
The control program or application program is stored in memory. As the PLC executes logic, it may also read and store values to memory. The values may also be used and refernced by the application program.