In a cyclic process, the system starts in a particular state and returns to that state after undergoing a few different processes. The net work involved is the enclosed area on the P-V diagram.
If the cycle goes clockwise, the system does work. This is the case for an engine.
If the cycle goes counter-clockwise, work is done on the system every cycle. An example of such a system is a refrigerator or air conditioner.
Let's say our sample process consists of the following four steps:
We'll show that the system does work in this process. Because the system returns to its initial state there is no change in internal energy after going once around the cycle. The net work done in each cycle must equal the heat added to the system during the cycle.