System-level, mixed signal hardware description language (HDL) and software (editor, simulator)?
PLC communication is defined in volumes of IEC standards developed over the last 40 yrs of evolution at every level of the ISO model in great detail including; standardized graphic consolidation of different systems; software, hardware, security and error handling. 

Start reading from;

https://en.wikipedia.org/wiki/IEC_61131
http://www.plcopen.org/pages/tc4_communication/

Then look for the answers you seek.  Like most communication standards, the related documents could fill a room.