The leader in industrial automation and control solutions

Set up CODESYS and Device

Note that if you are using the cMT-CTRL01, please refer to the cMT-CTRL01 User Manual for instructions on getting started with CODESYS specific to that model.

Create a CODESYS account and download CODESYS v3.5.10.

Download the Weintek package file and install the package in CODESYS.

  • Select Tools -> Package Manager:
Package Manager option from the Tools menu in CODESYS software.  This is where we will go to install the Weintek package file.
  • Click Install and select the Weintek package file:
CODESYS Package Manager dialog window.  Click the Install button (highlighted) and select the Weintek Package file you downloaded.  Once successful, the Weintek CODESYS and Remote IO package will be shown in the "currently installed packages" viewing area.

Activate CODESYS on your cMT device by connecting it to the internet, opening the HMI system settings menu, unlocking it, select the Network tab and ensure Obtain an IP Address Automatically is enabled. Then open the CODESYS tab and enter the CODESYS Activation Code and click Active.

Creating a CODESYS Project

Create a new project in CODESYS using the Weintek Built-in CODESYS device.

Instructions: Creating a CODESYS Project
  1. Create New Standard Project

    Select File -> New Project, then select Standard Project from the menu:
    Creating a CODESYS Project. Select New Project from the File menu and designate your new project as a "standard project".
  2. Select the Weintek Built-in CODESYS Device

    In the Standard Project menu, select the Weintek Built-in CODESYS (Weintek Labs., Inc.) device:
    In the standard project menu, select the Weintek Built-in CODESYS device.
  3. Success

    A new Device is created, and should be available in the Devices pane.

Scan for the newly Activated HMI and connect to it

Once the new project has been created you need to attach an HMI to it; here’s how:

Instructions: Scan for the newly Activated HMI and connect to it
  1. Double-click “Device”

    Double click on the Device in the Devices pane
    This is the Weintek Built-in CODESYS device you created above
    Scan for the newly Activated HMI and connect to it. Double-click the Weintek Device in the Devices pane.
  2. Select the cMT device

    Click Scan Network and select the cMT-X device.
    Note that the last two IP address octets are converted to hex and used the identifier in square brackets seen here as cMT-1E10 [000E]. This makes the IP address of this cMT device xxx.xxx.0.14:
    When scanning the network you can see the cMT device.
  3. Connection Made

    Now you should see the connection from PC to cMT-X in the Scan Network tab:
    The PC connection to the cMT X Series unit should now be visible in the 'scan network' tab.
  4. Optional: Search by cMT IP address

    It is also possible to simply type the IP address of the cMT-X device into the Scan Network tab device section:
    Alternately, you can type the IP address of the cMT X Series device into the "Device" section of the scan network tab.

Connect CODESYS to EasyBuilder Pro

Create three tags in the CODESYS project.

These instructions will demonstrate how to add tags in the CODESYS project.

Instructions: Create three tags in the CODESYS project.
  1. Double click PLC_PRG(PRG)

    Double click on PLC_PRG(PRG) in the Devices pane
    PLC_PRG is the name of the PLC Program that you are creating in the CODESYS software.
    PLC-PRG is the soft PLC Program that you will be adding the tags to.
  2. Create the three variables.

    Add ST code to create three tags.
    Adding Structured Text code to create three tags. In this example we are creating two boolean tags and one integer tag.
  3. Add Symbol Config

    Right click on Application in the Devices pane and select Add Object -> Symbol Configuration
    Add Object -> Symbol Configuration, using the default values. This is from the Application entry within the Devices pane on the left.
  4. Use Defaults

    Use the default values in the Add Symbol Configuration dialog.
    Keep the default values in the Symbol Configuration dialog.
  5. Project Build Complete.

    Note, when done, the project automatically builds
  6. Build Errors may occur:

    If there are build errors, they display in the bottom left corner.
    Clicking on this will open the errors and warnings.
    Messages display in the bottom left corner of the window. Build errors, warnings, and messages will show here.
  7. Open an error

    If there are any errors, and this is the first CODESYS project created, build errors are likely due to missing libraries. Open the errors and double click one to open the Library Manager:
    Double click an error to open the Library Manager. Library manager opens when the error is due to a missing library.
  8. Download Missing Libraries

    To fix this, simply click the Download Missing Libraries button, then with all libraries selected, click Download
    click the Download Missing Libraries button, then with all libraries selected, click Download

Export the CODESYS tags to an XML file

Now that the tags are created successfully, here’s how to export them:

Instructions: Export the CODESYS tags to an XML file
  1. Select the tags by selecting the program

    With the new Symbol Configuration selected in the Devices pane, check the PLC_PRG box to add all the new tags to export:
    With the new Symbol Configuration selected in the Devices pane, check the PLC_PRG box to add all the new tags to export:
  2. Create the XML tag file

    Select Build -> Generate Code to generate the XML file, which can be found in the project directory.
    Select Build -> Generate Code to generate the XML file

Add a Weintek Built-in CODESYS device to your EasyBuilder Pro project and import the XML file of CODESYS tags

Instructions: Add a Weintek Built-in CODESYS device to your EasyBuilder Pro project and import the XML file of CODESYS tags
  1. Add a CODESYS device in EBPro

    Add a Weintek Built-in CODESYS device to your project. Device tab, System Parameter settings menu.
    Device tab of System Parameters menu - Adding a Weintek Built-in CODESYS device
  2. Click ‘Import tags’

    Click the Import Tags button and navigate to the XML tag export file created for the CODESYS project previously. It will be in the CODESYS project directory.
    Import Tag button opens a dialog where you can navigate to your XML tag file.
  3. Success

    You can now access all tags from your CODESYS project in EBPro.