fg71
I do not always update OpenPLC to current version if I do not have any problem.
But this time I did and there is something very strange how it behave.
 
First problem was that the core key for Arduino Nano Esp32 was wrong. It doesn't match the platform key.
The reason to use Espressif board package of Nano Esp32 is the core is version 3 and Arduino fork use version 2.
Other reason is I find Espressif board package are more stable.
 
So I update the hals.json again 😉
"Arduino Nano ESP32": {
    "core": "esp32:esp32",
    "default_ain": "A0, A1, A2, A3, A4, A5",
    "default_aout": "9, 10, 11",
    "default_din": "2, 3, 4, 5, 6",
    "default_dout": "7, 8, 12, 13",
    "define": "BOARD_PORTENTA",
    "last_update": 1736206136.6408718,
    "platform": "esp32:esp32:nano_nora",
    "source": "esp32.cpp",
    "version": "3.1.0"
  },
 
Now I could upload plc program to the board.
 
The strange thing is, every time I upload a plc program to the board OpenPLC uninstall the board package (Espressif) and install it again. I could see there is some new script in this build but it looks to me there are something wrong here.
 
I have used 'Use Build Cashe' is this the reason it will uninstall the board package and install it again.
Reply 0 0
thiagoralves
What exactly is wrong with the core key for the Arduino Nano? I don’t remember touching on that.
 
As for reinstalling the stuff, this was actually one of the major things done in this update. If you select “use build cache” it should actually *NOT* install anything and use whatever you already have installed in your system, making the compilation process much faster. Could you please paste here your compilation logs so I can take a look and try to understand why it is not operating like that in your system?
Reply 0 0
fg71
Arduino board package key core use arduino:esp32 and Espressif board package key core use esp32:esp32
The first value before the colon in key core will also be the first value before colon in key platform.
Example of key platform for Arduino is arduino:esp32:nano_nora and for Espressif its esp32:esp32:nano_nora
 
You could think the key core as how the board package are installed and they exclude the folder hardware in the name and use colon in between.
And the platform key use the core key + platform name
 
I will do other test tomorrow and send you the log when I have it ready.
Reply 0 0
fg71
Here is the part of the log that start to uninstall esp32 package and the last line in the log start to download the esp32 package and begin install
I also see from the log that some of json index is download and I do not have those board installed.
 
ex.
esp8266
stmicroelectronics
ControllinoHardware
controllino_rp2
rp2040
productivity-P1AM_200-boardmanagermodule
productivity-P1AM-boardmanagermodule
 
I do not use whose boards so I'm not sure why this show in the log

[2025-01-07T01:52:53.302]
[2025-01-07T01:52:53.303]
[/CODE]nbsp;C:\Users\fgustafsson_user\Applications\OpenPLC_Editor\editor\arduino\bin\arduino-cli-w64.exe --no-color core update-index
[2025-01-07T01:52:57.364]
[2025-01-07T01:52:57.399] Downloading index: package_index.tar.bz2 0 B / 74.45 KiB    0.00%
[2025-01-07T01:52:57.430] Downloading index: package_index.tar.bz2 downloaded
[2025-01-07T01:52:57.985]
[2025-01-07T01:52:58.014] Downloading index: package_esp8266com_index.json 0 B / ?    0.00%
[2025-01-07T01:52:58.046] Downloading index: package_esp8266com_index.json downloaded
[2025-01-07T01:52:58.538]
[2025-01-07T01:52:58.566] Downloading index: package_esp32_index.json 0 B / ?    0.00%
[2025-01-07T01:52:58.598] Downloading index: package_esp32_index.json downloaded
[2025-01-07T01:52:59.131]
[2025-01-07T01:52:59.162] Downloading index: package_stmicroelectronics_index.json 0 B / ?    0.00%
[2025-01-07T01:52:59.192] Downloading index: package_stmicroelectronics_index.json downloaded
[2025-01-07T01:52:59.391]
[2025-01-07T01:52:59.427] Downloading index: package_ControllinoHardware_index.json 0 B / ?    0.00%
[2025-01-07T01:52:59.458] Downloading index: package_ControllinoHardware_index.json downloaded
[2025-01-07T01:53:00.400]
[2025-01-07T01:53:00.436] Downloading index: package_controllino_rp2_index.json 0 B / 57.91 KiB    0.00%
[2025-01-07T01:53:00.467] Downloading index: package_controllino_rp2_index.json downloaded
[2025-01-07T01:53:01.376]
[2025-01-07T01:53:01.407] Downloading index: package_rp2040_index.json 0 B / 850.86 KiB    0.00%
[2025-01-07T01:53:01.439] Downloading index: package_rp2040_index.json downloaded
[2025-01-07T01:53:02.230]
[2025-01-07T01:53:02.262] Downloading index: package_productivity-P1AM_200-boardmanagermodule_index.json 0 B / 16.55 KiB    0.00%
[2025-01-07T01:53:02.294] Downloading index: package_productivity-P1AM_200-boardmanagermodule_index.json downloaded
[2025-01-07T01:53:02.483]
[2025-01-07T01:53:02.514] Downloading index: package_productivity-P1AM-boardmanagermodule_index.json 0 B / ?    0.00%
[2025-01-07T01:53:02.545] Downloading index: package_productivity-P1AM-boardmanagermodule_index.json downloaded
[2025-01-07T01:53:02.735]
[2025-01-07T01:53:02.764] Downloading index: package_vea_index.json 0 B / ?    0.00%
[2025-01-07T01:53:02.795] Downloading index: package_vea_index.json downloaded
[2025-01-07T01:53:02.796] $? = 0
[2025-01-07T01:53:04.536] [CODE]
nbsp;C:\Users\fgustafsson_user\Applications\OpenPLC_Editor\editor\arduino\bin\arduino-cli-w64.exe --no-color cache clean
[2025-01-07T01:52:55.337] $? = 0
[2025-01-07T01:52:55.337]
[/CODE]nbsp;C:\Users\fgustafsson_user\Applications\OpenPLC_Editor\editor\arduino\bin\iec2c.exe -v
[2025-01-07T01:52:53.320] matiec version 0.1
[2025-01-07T01:52:53.356] changeset id:
[2025-01-07T01:52:53.356] $? = 0
[2025-01-07T01:52:53.357] [CODE]
nbsp;C:\Users\fgustafsson_user\Applications\OpenPLC_Editor\editor\arduino\bin\arduino-cli-w64.exe --no-color version
[2025-01-07T01:52:53.403] arduino-cli  Version: 1.0.3 Commit: 8b6ad258 Date: 2024-07-23T08:45:25Z
[2025-01-07T01:52:53.443] $? = 0
[2025-01-07T01:52:53.444] Checking Core and Board installation...
[2025-01-07T01:52:55.175] Core esp32:esp32 is installed
[2025-01-07T01:52:55.175] Cleaning download cache...
[2025-01-07T01:52:55.175]
[/CODE]nbsp;C:\Users\fgustafsson_user\Applications\OpenPLC_Editor\editor\arduino\bin\arduino-cli-w64.exe --no-color config init
[2025-01-07T01:52:55.383] Config file already exists, use --overwrite to discard the existing one.
[2025-01-07T01:52:55.416] $? = 1
[2025-01-07T01:52:55.417] [CODE]
nbsp;C:\Users\fgustafsson_user\Applications\OpenPLC_Editor\editor\arduino\bin\arduino-cli-w64.exe --no-color core uninstall esp32:esp32
[2025-01-07T01:53:07.915] Uninstalling esp32:esp32@3.1.0...
[2025-01-07T01:53:07.948] Skipping pre_uninstall script....
[2025-01-07T01:53:08.173] Platform esp32:esp32@3.1.0 uninstalled
[2025-01-07T01:53:08.208] Uninstalling esp32:esp32-arduino-libs@idf-release_v5.3-083aad99-v2, tool is no more required...
[2025-01-07T01:53:08.239] Skipping pre_uninstall script....
[2025-01-07T01:53:11.823] Tool esp32:esp32-arduino-libs@idf-release_v5.3-083aad99-v2 uninstalled
[2025-01-07T01:53:11.850] Uninstalling esp32:esp-x32@2405, tool is no more required...
[2025-01-07T01:53:11.881] Skipping pre_uninstall script....
[2025-01-07T01:53:12.062] Tool esp32:esp-x32@2405 uninstalled
[2025-01-07T01:53:12.097] Uninstalling esp32:xtensa-esp-elf-gdb@14.2_20240403, tool is no more required...
[2025-01-07T01:53:12.127] Skipping pre_uninstall script....
[2025-01-07T01:53:12.158] Tool esp32:xtensa-esp-elf-gdb@14.2_20240403 uninstalled
[2025-01-07T01:53:12.189] Uninstalling esp32:esp-rv32@2405, tool is no more required...
[2025-01-07T01:53:12.219] Skipping pre_uninstall script....
[2025-01-07T01:53:12.331] Tool esp32:esp-rv32@2405 uninstalled
[2025-01-07T01:53:12.358] Uninstalling esp32:riscv32-esp-elf-gdb@14.2_20240403, tool is no more required...
[2025-01-07T01:53:12.388] Skipping pre_uninstall script....
[2025-01-07T01:53:12.418] Tool esp32:riscv32-esp-elf-gdb@14.2_20240403 uninstalled
[2025-01-07T01:53:12.449] Uninstalling esp32:openocd-esp32@v0.12.0-esp32-20241016, tool is no more required...
[2025-01-07T01:53:12.480] Skipping pre_uninstall script....
[2025-01-07T01:53:12.510] Tool esp32:openocd-esp32@v0.12.0-esp32-20241016 uninstalled
[2025-01-07T01:53:12.542] Uninstalling esp32:esptool_py@4.9.dev3, tool is no more required...
[2025-01-07T01:53:12.572] Skipping pre_uninstall script....
[2025-01-07T01:53:12.604] Tool esp32:esptool_py@4.9.dev3 uninstalled
[2025-01-07T01:53:12.635] Uninstalling esp32:mkspiffs@0.2.3, tool is no more required...
[2025-01-07T01:53:12.666] Skipping pre_uninstall script....
[2025-01-07T01:53:12.697] Tool esp32:mkspiffs@0.2.3 uninstalled
[2025-01-07T01:53:12.728] Uninstalling esp32:mklittlefs@3.0.0-gnu12-dc7f933, tool is no more required...
[2025-01-07T01:53:12.759] Skipping pre_uninstall script....
[2025-01-07T01:53:12.790] Tool esp32:mklittlefs@3.0.0-gnu12-dc7f933 uninstalled
[2025-01-07T01:53:12.821] Uninstalling arduino:dfu-util@0.11.0-arduino5, tool is no more required...
[2025-01-07T01:53:12.851] Skipping pre_uninstall script....
[2025-01-07T01:53:12.882] Tool arduino:dfu-util@0.11.0-arduino5 uninstalled
[2025-01-07T01:53:14.000] $? = 0
[2025-01-07T01:53:14.000] [CODE][/CODE]nbsp;C:\Users\fgustafsson_user\Applications\OpenPLC_Editor\editor\arduino\bin\arduino-cli-w64.exe --no-color core install esp32:esp32
[2025-01-07T01:53:16.911] Downloading packages...
 
Reply 0 0
fg71
To you find the error I have made temporal solution to the problem I have by commit out the step the build sequence.
 
# Main build sequence
    build_phases = [
        setup_environment,
        verify_prerequisites,
        ## handle_board_installation,
        check_required_libraries,
        update_libraries,
        compile_st_file,
        provide_hal_data,
        write_arduino_sketch,
        write_definitions_file,
        generate_glue_code,
        patch_generated_files,
        build_project,
        upload_if_needed,
        cleanup_build
    ]
 
Reply 0 0
fg71
[2025-01-07T01:52:55.175] Core esp32:esp32 is installed
You could also see from the log that I have esp32 package installed but later insists to reinstall it.
Reply 0 0
thiagoralves
It seems that the behavior you are describing is actually following the"Mr. Proper" build, not the "use build cache" one... Can you show a screenshot of your upload dialog? Have you tried other options under that compile menu? Do all of them have this same "install everything again" behavior?
Reply 0 0
fg71
The upload dialog is the default configuration, but I also see the save button is missing so I'm not sure the settingsDefaults.json is used at all but it return a error if I move it (only to test if load it). It looks like its same for the first 3 build settings. The other I have not tested...
Reply 0 0
fg71
Question rise to me, do we really need OpenPLC to be able to install package when the normal way is thru Arduino IDE ??
Reply 0 0
thiagoralves
Question rise to me, do we really need OpenPLC to be able to install package when the normal way is thru Arduino IDE ??
Yes, because there are some users that don't use Arduino IDE at all. OpenPLC needs to ensure that there is an environment set up for the project to compile. I will test this better on my Windows machine, but so far on macOS, I don't see any of that happening. Every time I build with the "use build cache" selected, the compilation process is super quick and does not download anything. It just uses whatever is there in the environment.
 
One thing to note is that all these configurations are now part of the project, not the editor. That's why you don't see the save button anymore. Those things are automatically saved in the project file, so that if you send the project file somewhere else, the same configurations (board, I/O, compilation parameters, etc) will go with it. Try compiling a project with your settings, save it, then open it again and try compiling again, and check if it is still downloading everything.
Reply 0 0
fg71
I will test to download a new version of OpenPLC Editor but before I do that could you confirm that the latest build is the download version ??
This is to make sure I have exactly the same files as you.
 
I also have a question about Structured text and the version that is used in matiec ?
I believe matiec have not been updated after 2016
 
I have try a few things from CoPilot that do not work in OpenPLC but maybe will work in other PLC IDE
On other hand CoPolit said that the latest standard was publish 2023 and had a reference to documentation from Siemens.
I guess CoPilot AI is no difference from doing a google search, in this case the last one was correct 2013 from IEC website.
Reply 0 0
thiagoralves
The download version is not the latest. It is hard to keep the installer up to date, so the only way to fetch the latest version is always with a file -> check for updates.
 
MatIEC follows version 2 of the standard, which is pretty old. It does implement a few things of the version 3, like pointers, but that's not even implemented in the editor. So we're stuck with IEC 61131-3 version 2 for now.
Reply 0 0
fg71
Okey, I will wait for your respond then, when you have tested it on Windows 11
 
It looks like there are lot of new things in  IEC 61131-3 v3

Enhancements in IEC 61131-3 V3

  1. Object-Oriented Programming (OOP): V3 introduces full support for OOP, including methods, interfaces, classes, and polymorphism, whereas V2 has limited OOP capabilities.
  2. Component-Based Structure: V3 supports a more modular and component-based structure, allowing for easier integration and reuse of components.
  3. Multi-PLC and Multi-Application Support: V3 enhances support for programming multiple PLCs and applications within a single project.
  4. Improved Tool Integration: V3 offers better integration with other tools and systems, such as HMI (Human-Machine Interface) projects and visualization tools.
  5. Enhanced Security: V3 includes additional security features, such as improved encryption and access control.
  6. Support for New OS Versions: V3 supports newer operating systems, providing better compatibility with modern hardware and software environments.
  7. OPC UA Support: V3 includes support for OPC Unified Architecture (OPC UA), which is a modern communication protocol for industrial automation.
Reply 0 0
thiagoralves
This list seems to have been generated using ChatGPT or similar, and looks inaccurate to me. For one instance, the IEC standard does not define compatibility with protocols, like OPC UA. There are indeed many interesting enhancements on v3, but for us to incorporate them, we need matiec to be upgraded to v3, or we need another iec compiler that supports v3. None of the options seem very much possible in the short term unfortunately.
Reply 0 0
fg71
Yest it was CoPilot,
 
I do know in the old days they used OPC (OLE for Process Control) that is Microsoft Technology.
OPC have many limitation and was not made for complex environments in modern world.
 
I believe the OPC UA is a open standard and is developed by OPC Foundation.
Reply 0 0
Write a reply...
Reply