TwinCAT and RStudio Communication

Hello everyone...
I recently started to work with TwinCAT 3 and as first project I am working on a communication protocol between TwinCAT as a server and RStudio as client in order to transfer a binary message. I am going to use IDE and IEC 61131-3. I would be so thankful for any help.