I have 20 years experience in PLC programming. Your question is too general for specific answers.

The answer needs to start with the manufacture of PLC in question.

If you are still looking...