This paper describes a methodology used to test the vulnerability of control algorithms implemented in an industrial Programmable Logic Controller (PLC) environment to cyber attacks. Three stages of testing are discussed. First, we start with a simulation study conducted in MATLAB. Secondly, the calculations are implemented using a PLC simulator. These initial stages enable quick and efficient identification of the types of attacks to which the algorithms implemented in the PLC are susceptible. Finally, a set of practical tests on a physical laboratory process controlled by PLC is done. Various attack scenarios are considered, and the vulnerability of control algorithms is carefully evaluated. Based on the obtained results, we formulate practical suggestions for reducing the vulnerability of PLC-based industrial control systems.