Recently I was asked if it’s possible to access the raw process data of a serial module (e.g., 750-652) using CODESYS 3.5, similar to how it could be done with CODESYS 2.3. The user had written their own function blocks a few years ago in CODESYS 2.3 to control various serial devices through the process data, and they wanted to reuse that code rather than rewrite the function blocks using an I_Port (i.e., Interface object), as is typically done with CODESYS 3.5 and WAGO’s application function blocks.
In this case, the key is to use the I_Port methods to access the raw process data as byte arrays. These arrays can then be used in the PLC program as if they were mapped directly in the I/O configurator—similar to how CODESYS 2.3 maps the data.
The .SetProcessOutData() and .GetProcessInData() methods are then called during each PLC scan to refresh the arrays.
Example: