Serial Communications

Introduction

The Syscom Library has several built-in functions to support communications.

This example project utilizes the Sycom Library to create a serial communications configuration to pass data such as ASCII character strings.

System Requirements and Installation

This section requires the following:
  • P2CDS-622 CPU

  • P2000 Base (any variant)

  • P2000 PowerSupply (any variant)

  • Latest version of CODESYS installed on Host PC

Recommendation for Data Protection

In order to minimize the risk of data security breaches, we recommend the following organizational and technical measures for the system that will run your applications:

  • Whenever possible, avoid exposing PLCs and controller networks to public networks and Internet.

  • Use additional data link layers for protection, such as a VPN for remote access, and install firewall mechanisms.

  • Restrict access to authorized persons only, and change any existing default passwords during the initial commissioning, and change them regularly.

If you want to publish a web visualization, then we strongly recommend utilizing HTTPS and assigning a simple password protection to prevent access to the functionality of your PLC over the Internet.

Help

Help is provided in the Help menu, as well as the context-sensitive <F1> key when in the IDE whether a project is open or not.

Currently, the web-based online help opens by default. This can be disabled in the CODESYS options so that the offline help (CHM format) is used.

Caution

To do this project, the steps outlined in the previous section Preparation have to be completed successfully.

Import the Archived Project

Download the example project here- Serial Communications

Start CODESYS and Import the Project

Start CODESYS

(1). Start CODESYS from the Start menu by default, the path is Programs > CODESYS (version).

You can also click the CODESYS icon that is located on the desktop after installation.

Import the project

(2). With CODESYS IDE launched, click File > Project Archive > Extract Archive. Select all options in pop-up. Click “yes” on next pop-ups.

Update everything (including Library’s) to latest revisions. You also may need to add a Library, e.g. Basic OSCAT.

The example project here will be named Demo_SerialPassthrough

Project Notes

  • Functions are pulled from the Syscom library.

  • Includes both the Transmit and Receive functions so you can do a loop-back test.

  • All documentation is included in the Syscom library files.