|
| 1 | +--- |
| 2 | +title: "If PLC IDE isn't working with your device" |
| 3 | +id: 8824551178780 |
| 4 | +--- |
| 5 | + |
| 6 | +Learn what to do if you experience an issue using your Opta or Portenta Machine Control with PLC IDE. |
| 7 | + |
| 8 | +> ![TIP] |
| 9 | +> If you're just getting started with PLC IDE, see [Arduino® PLC IDE Setup & Device License Activation](https://docs.arduino.cc/software/plc-ide/tutorials/plc-ide-setup-license/). |
| 10 | +
|
| 11 | +In this article: |
| 12 | + |
| 13 | +- [If you can't find the serial port for your device](#if-you-cant-find-the-serial-port-for-your-device) |
| 14 | +- [If there's an issue when you install the runtime](#if-theres-an-issue-when-you-install-the-runtime) |
| 15 | +- [If there's an issue when you connect to the device](#if-theres-an-issue-when-you-connect-to-the-device) |
| 16 | +- [If you see an error when programming the device](#if-you-see-an-error-when-programming-the-device) |
| 17 | +- [If there is an issue activating the license](#if-there-is-an-issue-activating-the-license) |
| 18 | + |
| 19 | +--- |
| 20 | + |
| 21 | +## If you can't find the serial port for your device |
| 22 | + |
| 23 | +In this section: |
| 24 | + |
| 25 | +- [About serial ports in PLC IDE](#about-serial-ports-in-plc-ide) |
| 26 | +- [If you don't know which port to use](#if-you-dont-know-which-port-to-use) |
| 27 | +- [If your device does not appear on any port](#if-your-device-does-not-appear-on-any-port) |
| 28 | + |
| 29 | +### About serial ports in PLC IDE |
| 30 | + |
| 31 | +There are two contexts where you need to specify a serial port target. |
| 32 | + |
| 33 | +- _When installing the runtime._ |
| 34 | +- _When configuring the Modbus protocol in 'Set up communication'._ |
| 35 | + |
| 36 | +When the runtime has been installed, two serial ports may appear. The choice of port during installation doesn't doesn't matter. However, when configuring the Modbus protocol, it is generally recommended to select the **lower-numbered** port as the target, although in some cases, the port numbering may not follow this order. |
| 37 | + |
| 38 | +### If you don't know which port to use |
| 39 | + |
| 40 | +In some cases, it may be challenging to determine which serial port belongs to your PLC device. This is especially true if other devices or interfaces have ports open on your computer. |
| 41 | + |
| 42 | +1. If two ports are open, and they are numbered COM<N> and COM<N+1> (for example, COM20 and COM21), it's likely that both are created by your PLC device. Choose the **lower-numbered port** when configuring PLC IDE. |
| 43 | +2. If many ports are available, try disconnecting other USB devices that may be using serial communication and select **Project > Refresh current target** to refresh the list of ports. |
| 44 | +3. If you're still unsure what port to choose, see [Identify the serial port of your PLC device](https://support.arduino.cc/hc/en-us/articles/16724283965596). |
| 45 | + |
| 46 | +### If your device does not appear on any port |
| 47 | + |
| 48 | +Try these steps in order. Refresh the list of ports after each step by selecting **Project > Refresh current target** in the menu bar. |
| 49 | + |
| 50 | +1. Disconnect and reconnect your PLC device. |
| 51 | +1. Check for any system notifications that may prompt you to grant USB device permissions, and allow them if they appear. |
| 52 | +1. Ensure your device is connected using a working data USB cable. Connect your board with a data USB cable, not a charging-only cable. Confirm the cable is working by testing it with another device or trying a different cable. |
| 53 | +1. Connect the board directly to your computer instead of through a USB hub. |
| 54 | +1. If the board is still not detected, try a different USB port on your computer. |
| 55 | +1. Press the `RESET` button twice to put it into Bootloader mode and try to [install the runtime](https://docs.arduino.cc/software/plc-ide/tutorials/plc-ide-setup-license/#3-download-the-runtime). |
| 56 | + - On the Opta, the button is located in a small hole, similar to those on a router, so you'll need a pointed object. |
| 57 | + - When installing the runtime, select the **Automatic (Bootloader)** target. |
| 58 | + |
| 59 | +--- |
| 60 | + |
| 61 | +## If there's an issue when you install the runtime |
| 62 | + |
| 63 | +In this section: |
| 64 | + |
| 65 | +- [If there is an error when installing the runtime](#if-there-is-an-error-when-installing-the-runtime) |
| 66 | +- [If nothing happens when downloading the runtime](#if-nothing-happens-when-downloading-the-runtime) |
| 67 | + |
| 68 | +### If there is an error when installing the runtime |
| 69 | + |
| 70 | +See the [If you see an error when programming the device](#if-you-see-an-error-when-programming-the-device) section. |
| 71 | + |
| 72 | +### If nothing happens when downloading the runtime |
| 73 | + |
| 74 | +Follow these steps: |
| 75 | + |
| 76 | +1. Under the Output panel, select the **Resources** tab. |
| 77 | + |
| 78 | +1. Follow the linked instructions if you see any of these errors: |
| 79 | + - [Cannot generate profile file error message: Error: Path not found](#cannot-generate-profile-file-error-message-error-path-not-found) |
| 80 | + - [Error: invalid path creating config dir](#error-invalid-path-creating-config-dir) |
| 81 | + - If you see a different error, see the [If you see an error when downloading](#if-you-see-an-error-when-downloading) section. |
| 82 | + |
| 83 | +1. Restart PLC IDE. |
| 84 | + |
| 85 | +1. Ensure you've installed the latest version of the Arduino PLC IDE software from the Arduino Software page. |
| 86 | + |
| 87 | +--- |
| 88 | + |
| 89 | +## If there's an issue when you connect to the device |
| 90 | + |
| 91 | +Learn what to do if you are unable to connect to the device. |
| 92 | + |
| 93 | +In this section: |
| 94 | + |
| 95 | +- [If the "On-Line > Set up communications" and "On-line > Connect" options are disabled](#if-the-on-line--set-up-communications-and-on-line--connect-options-are-disabled) |
| 96 | +- [Error: “Unable to start the communication”](#error-unable-to-start-the-communication) |
| 97 | +- [If PLC IDE becomes unresponsive when connecting to the device](#if-plc-ide-becomes-unresponsive-when-connecting-to-the-device) |
| 98 | + |
| 99 | +### If the "On-Line > Set up communications" and "On-line > Connect" options are disabled |
| 100 | + |
| 101 | +These options are only available when a project is open. Select **File > New Project** to create a new project. |
| 102 | + |
| 103 | +### Error: “Unable to start the communication” |
| 104 | + |
| 105 | +When choosing **On-line > Set up communications** you may get this error message: |
| 106 | + |
| 107 | +``` |
| 108 | +Unable to start the communication |
| 109 | +Choose 'On-line / Set up communication' to configure it |
| 110 | +``` |
| 111 | + |
| 112 | +Follow these steps: |
| 113 | + |
| 114 | +1. Ensure the correct port is configured for the Modbus protocol: |
| 115 | + 1. Select **On-line > Set up communication**. |
| 116 | + 1. Click on **Properties** to open the Modbus configuration. |
| 117 | + 1. Under Communication, ensure the right **Port** is selected. |
| 118 | + 1. See the [If you can't find the serial port for your device](#if-you-cant-find-the-serial-port-for-your-device) section for help finding the right port. |
| 119 | +1. Close other applications that may be using the port of your PLC device, such as the Serial Monitor in Arduino IDE. |
| 120 | +1. Restart your computer. |
| 121 | + |
| 122 | +### If PLC IDE becomes unresponsive when connecting to the device |
| 123 | + |
| 124 | +PLC IDE may become unresponsive if there isn't a response on the targeted port. |
| 125 | + |
| 126 | +Follow these steps: |
| 127 | + |
| 128 | +1. Ensure the correct port is configured for the Modbus protocol: |
| 129 | + 1. Select **On-line > Set up communication**. |
| 130 | + 1. Click on **Properties** to open the Modbus configuration. |
| 131 | + 1. Under Communication, ensure the right **Port** is selected. |
| 132 | + 1. See the [If you can't find the serial port for your device](#if-you-cant-find-the-serial-port-for-your-device) section for help finding the right port. |
| 133 | +1. Close other applications that may be using the port of your PLC device, such as the Serial Monitor in Arduino IDE. |
| 134 | +1. Restart your computer. |
| 135 | + |
| 136 | +--- |
| 137 | + |
| 138 | +## If you see an error when programming the device |
| 139 | + |
| 140 | +When there is an issue installing the runtime or downloading your code to the device, error messages may appear in the **Resources** tab of the **Output** console. |
| 141 | + |
| 142 | +In this section: |
| 143 | + |
| 144 | +- [Error: "Cannot download sketch file error code: 1"](#error-cannot-download-sketch-file-error-code-1) |
| 145 | +- [Cannot generate profile file error message: Error: Path not found](#cannot-generate-profile-file-error-message-error-path-not-found) |
| 146 | +- [Error: invalid path creating config dir](#error-invalid-path-creating-config-dir) |
| 147 | +- [“Error” in the bottom right corner on first use of the board](#error-in-the-bottom-right-corner-on-first-use-of-the-board) |
| 148 | + |
| 149 | +> [!NOTE] |
| 150 | +> If you see a **dfu-util** warning or error that's not in this list, see [dfu-util errors when uploading (exit status 74)](https://support.arduino.cc/hc/en-us/articles/11011849739804-dfu-util-errors-when-uploading-exit-status-74). |
| 151 | +
|
| 152 | +### Error pop-up: "Cannot download sketch file (error code: 1)" |
| 153 | + |
| 154 | +This error may occur when attempting to download the runtime sketch. |
| 155 | + |
| 156 | +Solutions: |
| 157 | + |
| 158 | +1. [Verify that the correct port is selected in the manual sketch download widget.](https://support.arduino.cc/hc/en-us/articles/16724283965596) |
| 159 | + |
| 160 | +1. Double-tap the device’s reset button to put it in bootloader mode. First, try selecting the correct COM port. If that doesn’t work, set the Port to “Automatic (BootLoader)” and attempt to download the sketch again. |
| 161 | + |
| 162 | +1. Close any applications blocking the port, such as the Arduino IDE serial monitor. |
| 163 | + |
| 164 | +1. [Reformat the QSPI flash memory](https://support.arduino.cc/hc/en-us/articles/16206977438748-Reset-the-flash-memory-on-STM32H747-based-devices) |
| 165 | + |
| 166 | +1. Create a new project and attempt to download the runtime again. |
| 167 | + |
| 168 | +### Cannot generate profile file (error message: Error: Path not found) |
| 169 | + |
| 170 | +If you see this error, it means that the `sketch.yaml` file is missing from `C:\Users\USERNAME\AppData\Local\T\sketch.yaml`. |
| 171 | + |
| 172 | +When installing PLC IDE, a **User Account Control** prompt will ask for administrator privileges. Some files that are used by PLC IDE will be created in the `C:\Users\ADMIN-USERNAME\AppData\Local\T` directory for that admin account. |
| 173 | + |
| 174 | +Do one of the following: |
| 175 | + |
| 176 | +- If your account has admin privileges, you can simply reinstall PLC IDE to create the missing files for your user. |
| 177 | +- Run PLC IDE using the same admin account that installed it: |
| 178 | + 1. Close PLC IDE. |
| 179 | + 2. Right-click PLC IDE and select **Run as administrator**. |
| 180 | + 3. Continue using the same admin credentials that were used when installing PLC IDE. |
| 181 | +- Copy the files to configure a non-admin user for PLC IDE: |
| 182 | + 1. Sign in as an admin. |
| 183 | + 2. Copy the `C:\Users\ADMIN-USERNAME\AppData\Local\T` folder. |
| 184 | + 3. Paste the folder into the `C:\Users\REGULAR-USERNAME\AppData\Local\T` directory. |
| 185 | + 4. Open the `C:\Users\REGULAR-USERNAME\AppData\Local\T\arduino-cli.yaml` file in a text editor. |
| 186 | + 5. Replace `ADMIN-USERNAME` with `REGULAR-USERNAME` in all file paths inside the file. |
| 187 | + 6. Save the changes to `arduino-cli.yaml`. |
| 188 | + |
| 189 | +### Error: invalid path creating config dir |
| 190 | + |
| 191 | +You may see this error: |
| 192 | + |
| 193 | +`Error: invalid path creating config dir: C:\Users\USERNAME\AppData\Local\T\A error: mkdir C:\Users\<User>\AppData: Cannot create a file when that file already exists.` |
| 194 | + |
| 195 | +This error can occur when the `arduino-cli.yaml` file is copied from another user. |
| 196 | + |
| 197 | +Do one of the following: |
| 198 | + |
| 199 | +- Open `arduino-cli.yaml` in a text editor and change all paths to use your own user folder. |
| 200 | + 1. Open the `C:\Users\USERNAME\AppData\Local\T\arduino-cli.yaml` file in a text editor. |
| 201 | + 2. Replace `OTHER-USERNAME` with `USERNAME` in all file paths inside the file. |
| 202 | + 3. Save the changes to `arduino-cli.yaml`. |
| 203 | +- Run PLC IDE using the same admin account that installed it: |
| 204 | + 1. Close PLC IDE. |
| 205 | + 2. Right-click PLC IDE and select **Run as administrator**. |
| 206 | + 3. Continue using the same admin credentials that were used when installing PLC IDE. |
| 207 | + |
| 208 | +### “Error” in the bottom right corner on first use of the board |
| 209 | + |
| 210 | +Follow these steps: |
| 211 | + |
| 212 | +1. In the Output panel, open the **Resources** tab and check for error messages. |
| 213 | +2. [Reformat the QSPI flash memory](https://support.arduino.cc/hc/en-us/articles/16206977438748-Reset-the-flash-memory-on-STM32H747-based-devices). |
| 214 | +3. Reinstall the runtime and try again. |
| 215 | + |
| 216 | +--- |
| 217 | + |
| 218 | +## If there is an issue activating the license |
| 219 | + |
| 220 | +When activating the license you may see one of these errors: |
| 221 | + |
| 222 | +- `Could not activate licenses for the following products: AIPC_Arduino_Opta` |
| 223 | +- `Error #29 activating AlPLC_Arduino_PMC: Generic parameters error` |
| 224 | +- `Could not activate licenses for the following products: AIPC_Arduino_PMC` |
| 225 | + |
| 226 | +Try the following: |
| 227 | + |
| 228 | +- [Reformat the QSPI flash memory](https://support.arduino.cc/hc/en-us/articles/16206977438748-Reset-the-flash-memory-on-STM32H747-based-devices). Then, try to activate the license again. |
| 229 | +- If you are using a company-owned computer, please follow these steps: |
| 230 | + 1. Temporarily disable any antivirus software running on your system. |
| 231 | + 1. Temporarily disable the firewall on your computer. |
| 232 | + 1. Attempt the license activation process again. |
| 233 | + |
| 234 | +> [!NOTE] |
| 235 | +> Corporate networks and security programs may interfere with license activation. Disabling these temporarily can help complete the process. |
| 236 | +
|
| 237 | +<!-- markdownlint-disable-file HC001 --> |
0 commit comments