Import Structured Text Code Automatically - MATLAB & Simulink (original) (raw)

Main Content

PLC IDEs for Importing Code Automatically

You can generate and automatically import structured text code to the CODESYS Version 2.3 target PLC IDE.

Generate and Automatically Import Structured Text Code

You can generate and automatically import structured text code. Before you start:

Note

While the automatic import process is in progress, do not use your mouse or keyboard to avoid disrupting the process. When the process is complete, you can resume normal operations.

You must have already installed your target PLC IDE in a default location. The target IDE must use the CODESYS V2.3 IDE. If you installed the target PLC IDE in a nondefault location, open the Configuration Parameters dialog box. In the PLC Coder node, set theTarget IDE Path parameter to the installation folder of your PLC IDE. See Target IDE Path.

  1. If it is not already started, open the Command Window.
  2. Open the plcdemo_simple_subsystem model. To open the model, enter:
    openExample('plcdemo_simple_subsystem');
  3. Select the Subsystem block. Open the app.
  4. Open the tab, clickSettings > Import Code into IDE.
  5. Open the tab and click Generate PLC Code.
  6. The software:
    1. Generates the code.
    2. Starts the target IDE interface.
    3. Creates a project.
    4. Imports the generated code to the target IDE.

If you want to generate, import, and verify the structured text code, see Import and Verify Structured Text Code.

Troubleshoot Automatic Import Issues

Following are guidelines, hints, and tips for questions or issues you might have while using the automatic import capability of the Simulink® PLC Coder™ product.

Supported Target IDEs

The Simulink PLC Coder software supports only the 3S-Smart Software Solutions CODESYS Version 2.3 target IDE for automatic code import and verification.

Note

Some antivirus softwares falsely identifies the executables that implement the automatic import feature as malware. You can ignore this false identification. For more information, see Issues with Anti-Virus Software.

Target IDEs Not Supported For Automatic Import

The following target IDEs do not support automatic import. For these target IDEs, theImport Code into IDE and Verify Code in IDE are disabled.

Possible Automatic Import Issues

When the Simulink PLC Coder software fails to finish automatically importing the generated code for the target IDE, it reports an issue in a message dialog box. To remedy the issue, try the following actions: