Skip to content
PDF

First Steps with CODESYS and the MFN 100#

This chapter will give you an introduction on how to start working with the integrated soft PLC in the MFN 100. First, some configuration and installation of files and libraries are required.

Note

  • Please download the CODESYS Development System V3 from store.codesys.com for this chapter.
    We recommend version 3.5 SP14 (32 bit) or newer.
  • Please connect your workstation to the console port (P1) of the MFN 100.

Installing the Device Descriptions#

After you have downloaded and installed the CODESYS Development System on your workstation, you have to install the device description of the MFN 100 in the CODESYS Development System. The device description has the following filename:

  • Nerve_MFN_100_V3.5.XX.X.devdesc.xml

Note

XX.X stands for the current version of the CODESYS Development System

The device description of the MFN 100 has been sent as part of the delivery. Please remember where you have saved the device description for the following steps.

  1. Start the CODESYS Development System.
  2. Go to Tools > Device Repository.

    !Device repository

  3. Click Install.

    !Install device description

  4. Go to the directory of the previously downloaded device description.

  5. Select the device description of the MFN 100.

    The device description will look like this: Nerve_MFN_100_V3.5.XX.X.devdesc.xml

  6. Click Open.

When the installation was successful, the MFN 100 will appear in the list of device descriptions in the middle of the window and you can close the window.

!Device description installed

After installing the device description you can start working with the CODESYS Development System. However, libraries and device descriptions of generic devices might be missing so that the CODESYS Development System can work properly. The following chapters will walk you through the download process.

Note

If you have worked with the MFN 100 and the CODESYS Development System before, you might need to update the device description:

  1. Follow the steps above to install the newest device description.
  2. Right-click Device (Nerve_MFN_100) on the left side.
  3. Select Update Device....
  4. Select the current device description in the new window.
  5. Click Update Device in the lower-right.

Downloading Missing Libraries#

The error message for missing libraries might appear when you open or create a CODESYS project. The CODESYS Development System identifies the missing libraries automatically but you may have to repeat the following process a few times.

!Missing libraries error message

  1. Open or create a CODESYS project.
  2. If the error message about missing libraries appears, click OK.
  3. Double-click Library Manager in the tree view on the left.
  4. Click Download missing libraries.

    !Library Manager

  5. Click Download in the new window.

    !Downloading libraries

  6. Click Close when the download is finished.

  7. Repeat steps 3 to 5 until no more libraries appear in the download window.

Downloading Missing Device Descriptions#

Apart from the device description for the MFN 100 that you have installed manually before, device descriptions of generic devices may be missing for the CODESYS Development System to function as intended. The CODESYS Development System will identify the missing device descriptions automatically but this time it will not generate an error message unless you try to load a CODESYS application into the MFN 100.

  1. Click Tools > Device Repository.
  2. Click Download missing descriptions.

    !Missing device descriptions

    Note

    If no device descriptions of generic devices are missing, the button for downloading missing descriptions will not appear.

  3. Click Download in the new window.

  4. Click Close when the download is finished.

Connecting to the MFN 100#

Before you can download CODESYS applications to the MFN 100, please make sure that the device description of the MFN 100 is installed in the CODESYS Development System.

  1. Open or create a CODESYS project.
  2. Double-click Device (Nerve_MFN_100) in the tree view on the left.
  3. Go to Communication Settings > Scan network....

    !Scan network

  4. Select the MFN 100 (here nerve-rtvm [XXXX.XXXX]) in this window.

    !nerve-rtvm

    Note

    When more than one network is active on your workstation, it sometimes happens that the MFN 100 cannot be found. Please continue reading if the MFN 100 does not appear in this window.

  5. Click OK.

Typically the MFN 100 will be found automatically. If the MFN 100 cannot be found, you have to enter the IP address and port of the CODESYS runtime manually.

  1. Double-click Device (Nerve_MFN_100) in the tree view on the left.
  2. Go to Communication Settings in the middle of the window.
  3. Enter 172.20.2.2:11740 in the text box under the device on the right.

    !Connecting manually

  4. Press Enter.

The CODESYS Development System is now connected to the MFN 100 and you can download applications into the CODESYS runtime.

Downloading an Application to the MFN 100#

You can load CODESYS applications directly into the MFN 100. However, before you can download an application into the MFN 100 it needs to be free of errors.

The process of downloading an application is slightly different if you are downloading an entirely new application into the MFN 100 or if you are updating an application that has already been downloaded into the MFN 100. If you are updating an application that you have downloaded to the MFN 100 before, please continue with Downloading an Updated Application to the MFN 100 further down below.

Downloading a New Application to the MFN 100#

Once you have created a project and you are finished with programming, you can download the CODESYS application to the MFN 100 directly.

  1. Open the CODESYS project you want to load into the MFN 100.
  2. Click the Login symbol in the CODESYS menu bar.

    !Login symbol

  3. Click Yes in the pop-up window.

    !Confirm application download

  4. The application is stopped now. Click the Play symbol in the CODESYS menu bar.

    !Play symbol

The application is now loaded to the MFN 100.

Downloading an Updated Application to the MFN 100#

If you update an application after you have loaded it into the MFN 100, you need to download it into the MFN 100 again. The download process is slightly different from downloading a new application into the MFN 100.

  1. Stop the CODESYS application that you have loaded into the MFN 100 through the local UI.
  2. Click the Logout button in the CODESYS toolbar.

    !Logout button

  3. Expand Device (Nerve_MFN_100) > PLC Logic > Application.

  4. Double-click PLC_Program (PRG).
  5. Perform your changes.
  6. Click the Login symbol in the CODESYS menu bar.

    !Login symbol

  7. In the pop-up window, select one of the options.

    !Pop-up window options

    Item Description
    Login with online change. The updated application will be loaded into the MFN 100. Variable values will not be reset. If the application was running before, it will be running after the download.
    Login with download. The updated application will be loaded into the MFN 100. Variable values will be reset. The application is stopped.
    Login without any change. The updated application will not be loaded into the MFN 100 but the code will keep your changes.
  8. Click OK.

The application is now loaded to the MFN 100.

Note

For more help with programming PLC applications in the CODESYS Development System go to help.codesys.com.