thiagoralves / openplc_editor Goto Github PK
View Code? Open in Web Editor NEWOpenPLC Editor - IDE capable of creating programs for the OpenPLC Runtime
License: GNU General Public License v2.0
OpenPLC Editor - IDE capable of creating programs for the OpenPLC Runtime
License: GNU General Public License v2.0
From the install.sh, it seems like this tries to install python 2.7, which was (finally) deprecated this year, and is being removed from most linux distributions.
On the newer systems the old Python 2 is now completely gone, so installing the current OpenPLC Editor is a hassle.
I propose a Docker image as a workaround until the editor is ported to Python 3:
FROM debian:buster
RUN apt-get update && \
apt-get install -y \
sudo curl python-pip apt-utils coreutils vim-gtk dbus-x11 bash-completion \
build-essential pkg-config bison flex autoconf automake libtool make git \
libssl-dev python2 python-wxgtk3.0 python2-dev libpng-dev libfreetype6-dev
# password = user
RUN mkdir -p /etc/skel/.local/share/applications && \
mkdir -p /root/.local/share/applications && \
useradd user --uid 1000 -p aaBrLCcg4bKmQ --groups sudo --create-home
RUN git clone --depth 1 --single-branch https://github.com/thiagoralves/OpenPLC_Editor.git && \
cd OpenPLC_Editor && \
./install.sh && \
mv openplc_editor.sh /usr/local/bin/openplc-editor
USER user
ENV HOME=/home/user
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/user/.local/bin
ENV LANG=en_US.utf8
WORKDIR /home/user
CMD openplc-editor
Build it with:
docker build -t openplc .
And run with:
#!/bin/bash
mkdir -p data # this is where projects can be saved
docker run \
--env="DISPLAY" \
--volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
--volume="$(pwd)/data:/home/user/data" \
openplc
when running install.sh, on Raspberry Pi 4, I get a lot of compiler warnings like:
array_range_check.cc:202:36: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
STAGE3_ERROR(0, symbol, symbol, "Subrange has lower limit (%"PRId64") larger than upper limit (%"PRId64").", GET_CVALUE( int64, symbol->lower_limit), GET_CVALUE( int64, symbol->upper_limit));
^
array_range_check.cc:202:71: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
STAGE3_ERROR(0, symbol, symbol, "Subrange has lower limit (%"PRId64") larger than upper limit (%"PRId64").", GET_CVALUE( int64, symbol->lower_limit), GET_CVALUE( int64, symbol->upper_limit));
^
array_range_check.cc:212:36: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
STAGE3_ERROR(0, symbol, symbol, "Subrange has lower limit (%"PRIu64") larger than upper limit (%"PRIu64").", GET_CVALUE(uint64, symbol->lower_limit), GET_CVALUE(uint64, symbol->upper_limit));
^
array_range_check.cc:212:71: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
STAGE3_ERROR(0, symbol, symbol, "Subrange has lower limit (%"PRIu64") larger than upper limit (%"PRIu64").", GET_CVALUE(uint64, symbol->lower_limit), GET_CVALUE(uint64, symbol->upper_limit));
^
ar: `u' modifier ignored since `D' is the default (see `U')
Making all in stage4
Making all in generate_c
In file included from generate_c.cc:525:
generate_c_il.cc: In member function �virtual void* generate_c_il_c::visit(il_function_call_c*)�:
generate_c_il.cc:957:11: warning: this �if� clause does not guard... [-Wmisleading-indentation]
if (nb_param > 0)
^~
generate_c_il.cc:959:13: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the �if�
if (param_value == NULL) {
^~
ar: `u' modifier ignored since `D' is the default (see `U')
Making all in generate_iec
ar: `u' modifier ignored since `D' is the default (see `U')
config.status: creating config/config.h
config.status: config/config.h is unchanged
When I try to run OpenPLC Editor I get:
No module named 'lxml'
Hi all, when trying to run the PLC simulation, I get this error on the console.
Exception while connecting to 'LOCAL://': DLL load failed: The parameter is incorrect.
Connection failed to LOCAL://!
Any idea what the bug is? Thanks
Hi @thiagoralves , I've made changes to the editor which adds a useful feature to simulate the softPLC runtime generated by the editor in a more realistic setup before deploying to the real OpenPLC v3 runtime. However, the ticks rate are kept to real-time (1000000) and incremented based on the minimum scan cycle configure on the editor (res0)
The changes are available in this commit: Matheus-Garbelini@8e09167
In short, once a simulation starts, an external python script (model) is executed every scan cycle. The user-supplied external script can then read all PLC outputs and modify the PLC inputs according to an automation model of choice. The simulation running an example script is shown in the Figure below:
It's also possible to run the simulation in a standalone setup, i.e., you can start the model with the PLC logic without using the IDE. This is useful if the user only wants to test the model with a realistic PLC logic. In this case, it's necessary the addition of a helper class that initializes the PLCObject.py, thus executing the user-supplied model:
On the user side. The external script can be really simple and mimics the Arduino convention by using setup and loop:
# Setup is called before the PLC program starts
def setup(PLC, args):
# Initialize sample rate for a standalone model
Stage1.Sample_rate = 60.0
# Sets the Initial water level on PLC.
PLC.LIT101.value = Stage1.LIT101
# model is called each PLC scan time (configured on IDE)
# Receive all variables from PLC program and return the altered variables
def loop(PLC, args):
# Read PLC outputs
MV101 = PLC.MV101.value
P101 = PLC.P101.value
# Execute process model (stage 1)
LIT101 = Stage1.process(MV101, P101)
# Update PLC input
PLC.LIT101.value = LIT101
The question
As of now, the simulation time is fixed to the PLC scan cycle, this means that if the user wants to speed up the simulation (run faster than real-time), he needs to manually reduce the PLC scan cycle and adjust timing behavior of the model. It would be useful if the PLCController.py could somewhat increase the rate on which the PLC ticks are incremented on the softPLC so the simulation could accelerate. Is there a viable way to change the PLCcontroller.py generated .c code to change the tick rate based on user setting? As I understand, the current reference for the ticks are 1000000 (1ms)
Thanks a lot for this editor and best regards.
function wx.stc.StyledTextCtrl.StartStyling()
only receives one parameter, but there are two in the program. May it be caused by different versions of wxPython?
python3-dev
Windows10, wxpython4, python3.9
when I clicked build button, it occured:
SystemError: <class 'wx._core.MouseEvent'> returned a result with an error set
Traceback (most recent call last):
File "D:\Program Files\Python39\lib\site-packages\wx\core.py", line 3407, in <lambda>
lambda event: event.callable(*event.args, **event.kw) )
File "D:\code\OpenPLC_Editor\editor\LogPseudoFile.py", line 76, in _write
self.output.StartStyling(self.output.GetLength(), 0xff)
TypeError: StyledTextCtrl.StartStyling(): too many arguments
Hello, founder, I want to know where are the executable programs . For example , I upload a file "Hello_world.st" , would it create a program "Hello_world" and where it would locate?
There was something wrong when I signed up on https://openplc.discussion.community, so I report the issue here.
OpenPLC_Editor Branch: dev-python3
OS: Ubuntu 18.04.6 LTS
Python 3.6.9
pip 21.3.1
When installing OpenPLC_Editor of dev-python3 by running install.sh on terminal, a lot of warnings arose, saying invalid suffix on literal. Here are the full console log:
~/workspace/OpenPLC_Editor$ ./install.sh
Installing OpenPLC Editor
Please be patient. This may take a couple minutes...
[INSTALLING DEPENDENCIES]
All packages are up to date.
python3 is already the newest version (3.6.7-1~18.04).
python3 set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
python3-pip is already the newest version (9.0.1-2.3~ubuntu1.18.04.8).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
The following additional packages will be installed:
libwxbase3.0-0v5 libwxgtk3.0-gtk3-0v5 python3-sip
Suggested packages:
wx3.0-doc
The following NEW packages will be installed:
libwxbase3.0-0v5 libwxgtk3.0-gtk3-0v5 python3-sip python3-wxgtk4.0
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 11.6 MB of archives.
After this operation, 59.8 MB of additional disk space will be used.
Selecting previously unselected package libwxbase3.0-0v5:amd64.
(Reading database ... 197598 files and directories currently installed.)
Preparing to unpack .../libwxbase3.0-0v5_3.0.4+dfsg-3_amd64.deb ...
Unpacking libwxbase3.0-0v5:amd64 (3.0.4+dfsg-3) ...
Selecting previously unselected package libwxgtk3.0-gtk3-0v5:amd64.
Preparing to unpack .../libwxgtk3.0-gtk3-0v5_3.0.4+dfsg-3_amd64.deb ...
Unpacking libwxgtk3.0-gtk3-0v5:amd64 (3.0.4+dfsg-3) ...
Selecting previously unselected package python3-sip.
Preparing to unpack .../python3-sip_4.19.7+dfsg-1ubuntu0.1_amd64.deb ...
Unpacking python3-sip (4.19.7+dfsg-1ubuntu0.1) ...
Selecting previously unselected package python3-wxgtk4.0.
Preparing to unpack .../python3-wxgtk4.0_4.0.1+dfsg-2_amd64.deb ...
Unpacking python3-wxgtk4.0 (4.0.1+dfsg-2) ...
Setting up libwxbase3.0-0v5:amd64 (3.0.4+dfsg-3) ...
Setting up python3-sip (4.19.7+dfsg-1ubuntu0.1) ...
Setting up libwxgtk3.0-gtk3-0v5:amd64 (3.0.4+dfsg-3) ...
Setting up python3-wxgtk4.0 (4.0.1+dfsg-2) ...
Processing triggers for libc-bin (2.27-3ubuntu1.6) ...
build-essential is already the newest version (12.4ubuntu1).
The following additional packages will be installed:
automake libbison-dev libfl-dev libfl2 libsigsegv2 m4
Suggested packages:
autoconf-archive gnu-standards autoconf-doc bison-doc flex-doc m4-doc
The following NEW packages will be installed:
autoconf automake bison flex libbison-dev libfl-dev libfl2 libsigsegv2 m4
0 upgraded, 9 newly installed, 0 to remove and 0 not upgraded.
Need to get 1,981 kB of archives.
After this operation, 6,757 kB of additional disk space will be used.
Selecting previously unselected package libsigsegv2:amd64.
(Reading database ... 198231 files and directories currently installed.)
Preparing to unpack .../0-libsigsegv2_2.12-1_amd64.deb ...
Unpacking libsigsegv2:amd64 (2.12-1) ...
Selecting previously unselected package m4.
Preparing to unpack .../1-m4_1.4.18-1_amd64.deb ...
Unpacking m4 (1.4.18-1) ...
Selecting previously unselected package flex.
Preparing to unpack .../2-flex_2.6.4-6_amd64.deb ...
Unpacking flex (2.6.4-6) ...
Selecting previously unselected package autoconf.
Preparing to unpack .../3-autoconf_2.69-11_all.deb ...
Unpacking autoconf (2.69-11) ...
Selecting previously unselected package automake.
Preparing to unpack .../4-automake_1%3a1.15.1-3ubuntu2_all.deb ...
Unpacking automake (1:1.15.1-3ubuntu2) ...
Selecting previously unselected package libbison-dev:amd64.
Preparing to unpack .../5-libbison-dev_2%3a3.0.4.dfsg-1build1_amd64.deb ...
Unpacking libbison-dev:amd64 (2:3.0.4.dfsg-1build1) ...
Selecting previously unselected package bison.
Preparing to unpack .../6-bison_2%3a3.0.4.dfsg-1build1_amd64.deb ...
Unpacking bison (2:3.0.4.dfsg-1build1) ...
Selecting previously unselected package libfl2:amd64.
Preparing to unpack .../7-libfl2_2.6.4-6_amd64.deb ...
Unpacking libfl2:amd64 (2.6.4-6) ...
Selecting previously unselected package libfl-dev:amd64.
Preparing to unpack .../8-libfl-dev_2.6.4-6_amd64.deb ...
Unpacking libfl-dev:amd64 (2.6.4-6) ...
Setting up libsigsegv2:amd64 (2.12-1) ...
Setting up m4 (1.4.18-1) ...
Setting up libbison-dev:amd64 (2:3.0.4.dfsg-1build1) ...
Setting up libfl2:amd64 (2.6.4-6) ...
Setting up bison (2:3.0.4.dfsg-1build1) ...
update-alternatives: using /usr/bin/bison.yacc to provide /usr/bin/yacc (yacc) in auto mode
Setting up flex (2.6.4-6) ...
Setting up autoconf (2.69-11) ...
Setting up libfl-dev:amd64 (2.6.4-6) ...
Setting up automake (1:1.15.1-3ubuntu2) ...
update-alternatives: using /usr/bin/automake-1.15 to provide /usr/bin/automake (automake) in auto mode
Processing triggers for install-info (6.5.0.dfsg.1-2) ...
Processing triggers for libc-bin (2.27-3ubuntu1.6) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Collecting lxml
Downloading lxml-4.9.3-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (6.5 MB)
|████████████████████████████████| 6.5 MB 66 kB/s
Collecting matplotlib
Downloading matplotlib-3.3.4-cp36-cp36m-manylinux1_x86_64.whl (11.5 MB)
|████████████████████████████████| 11.5 MB 60 kB/s
Collecting zeroconf
Downloading zeroconf-0.38.4-py3-none-any.whl (106 kB)
|████████████████████████████████| 106 kB 32 kB/s
Collecting pyserial
Downloading pyserial-3.5-py2.py3-none-any.whl (90 kB)
|████████████████████████████████| 90 kB 28 kB/s
Collecting gnosis
Downloading Gnosis-0.1.1.tar.gz (103 kB)
|████████████████████████████████| 103 kB 84 kB/s
Preparing metadata (setup.py) ... done
Collecting simplejson
Downloading simplejson-3.19.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (125 kB)
|████████████████████████████████| 125 kB 46 kB/s
Collecting nevow
Downloading Nevow-0.14.5.tar.gz (550 kB)
|████████████████████████████████| 550 kB 56 kB/s
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Collecting cycler>=0.10
Downloading cycler-0.11.0-py3-none-any.whl (6.4 kB)
Collecting pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.3
Downloading pyparsing-3.1.0-py3-none-any.whl (102 kB)
|████████████████████████████████| 102 kB 64 kB/s
Collecting python-dateutil>=2.1
Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
|████████████████████████████████| 247 kB 89 kB/s
Collecting numpy>=1.15
Downloading numpy-1.19.5-cp36-cp36m-manylinux2010_x86_64.whl (14.8 MB)
|████████████████████████████████| 14.8 MB 80 kB/s
Collecting pillow>=6.2.0
Downloading Pillow-8.4.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1 MB)
|████████████████████████████████| 3.1 MB 64 kB/s
Collecting kiwisolver>=1.0.1
Downloading kiwisolver-1.3.1-cp36-cp36m-manylinux1_x86_64.whl (1.1 MB)
|████████████████████████████████| 1.1 MB 54 kB/s
Collecting ifaddr>=0.1.7
Downloading ifaddr-0.2.0-py3-none-any.whl (12 kB)
Collecting twisted>=16.3
Downloading Twisted-22.4.0-py3-none-any.whl (3.1 MB)
|████████████████████████████████| 3.1 MB 49 kB/s
Collecting six>=1.5
Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting typing-extensions>=3.6.5
Using cached typing_extensions-4.1.1-py3-none-any.whl (26 kB)
Collecting hyperlink>=17.1.1
Downloading hyperlink-21.0.0-py2.py3-none-any.whl (74 kB)
|████████████████████████████████| 74 kB 66 kB/s
Collecting attrs>=19.2.0
Downloading attrs-22.2.0-py3-none-any.whl (60 kB)
|████████████████████████████████| 60 kB 53 kB/s
Collecting Automat>=0.8.0
Downloading Automat-22.10.0-py2.py3-none-any.whl (26 kB)
Collecting incremental>=21.3.0
Downloading incremental-22.10.0-py2.py3-none-any.whl (16 kB)
Collecting constantly>=15.1
Downloading constantly-15.1.0-py2.py3-none-any.whl (7.9 kB)
Collecting zope.interface>=4.4.2
Downloading zope.interface-5.5.2-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (253 kB)
|████████████████████████████████| 253 kB 74 kB/s
Collecting idna>=2.5
Using cached idna-3.4-py3-none-any.whl (61 kB)
Requirement already satisfied: setuptools in ./venv/lib/python3.6/site-packages (from zope.interface>=4.4.2->twisted>=16.3->nevow) (39.0.1)
Using legacy 'setup.py install' for gnosis, since package 'wheel' is not installed.
Building wheels for collected packages: nevow
Building wheel for nevow (pyproject.toml) ... done
Created wheel for nevow: filename=Nevow-0.14.5-py3-none-any.whl size=451882 sha256=261d87ef5e72d50d669b5ede81c6bbe3dc1164dc44d1a8b698ed03cc682f1cc6
Stored in directory: /home/thk/.cache/pip/wheels/75/e2/2c/d4e916b3e56b6226886dfa602b6d22c4ede50f98f02200b84b
Successfully built nevow
Installing collected packages: six, idna, attrs, zope.interface, typing-extensions, incremental, hyperlink, constantly, Automat, twisted, python-dateutil, pyparsing, pillow, numpy, kiwisolver, ifaddr, cycler, zeroconf, simplejson, pyserial, nevow, matplotlib, lxml, gnosis
Running setup.py install for gnosis ... done
Successfully installed Automat-22.10.0 attrs-22.2.0 constantly-15.1.0 cycler-0.11.0 gnosis-0.1.1 hyperlink-21.0.0 idna-3.4 ifaddr-0.2.0 incremental-22.10.0 kiwisolver-1.3.1 lxml-4.9.3 matplotlib-3.3.4 nevow-0.14.5 numpy-1.19.5 pillow-8.4.0 pyparsing-3.1.0 pyserial-3.5 python-dateutil-2.8.2 simplejson-3.19.1 six-1.16.0 twisted-22.4.0 typing-extensions-4.1.1 zeroconf-0.38.4 zope.interface-5.5.2
[COMPILING MATIEC]
configure.ac:22: installing 'config/compile'
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
/home/thk/workspace/OpenPLC_Editor/matiec/config/missing: Unknown `--is-lightweight' option
Try `/home/thk/workspace/OpenPLC_Editor/matiec/config/missing --help' for more information
configure: WARNING: 'missing' script is too old or missing
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for bison... bison -y
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking for flex... flex
checking lex output file root... lex.yy
checking lex library... -lfl
checking whether yytext is a pointer... yes
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking whether ln -s works... yes
checking whether make sets $(MAKE)... (cached) yes
checking for ranlib... ranlib
checking for gawk... (cached) mawk
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking float.h usability... yes
checking float.h presence... yes
checking for float.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking for stdint.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for strings.h... (cached) yes
checking sys/timeb.h usability... yes
checking sys/timeb.h presence... yes
checking for sys/timeb.h... yes
checking for unistd.h... (cached) yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
checking for inline... inline
checking for int16_t... yes
checking for int32_t... yes
checking for int64_t... yes
checking for int8_t... yes
checking for uint16_t... yes
checking for uint32_t... yes
checking for uint64_t... yes
checking for uint8_t... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking whether time.h and sys/time.h may both be included... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking for alarm... yes
checking for working mktime... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible realloc... yes
checking for clock_gettime... yes
checking for memset... yes
checking for pow... no
checking for strcasecmp... yes
checking for strdup... yes
checking for strtoul... yes
checking for strtoull... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating absyntax/Makefile
config.status: creating absyntax_utils/Makefile
config.status: creating stage1_2/Makefile
config.status: creating stage3/Makefile
config.status: creating stage4/Makefile
config.status: creating stage4/generate_c/Makefile
config.status: creating stage4/generate_json/Makefile
config.status: creating stage4/generate_iec/Makefile
config.status: creating config/config.h
config.status: executing depfiles commands
Making all in absyntax
ar: `u' modifier ignored since `D' is the default (see `U')
Making all in absyntax_utils
debug_ast.cc:59:63: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
if (const_value. _int64.is_valid ()) fprintf(stderr, "%"PRId64"", const_value. _int64.get());
^
debug_ast.cc:64:63: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
if (const_value._uint64.is_valid ()) fprintf(stderr, "%"PRIu64"", const_value._uint64.get());
^
ar: `u' modifier ignored since `D' is the default (see `U')
Making all in stage1_2
updating iec_bison.hh
ar: `u' modifier ignored since `D' is the default (see `U')
Making all in stage3
array_range_check.cc:138:40: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
{STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds (using constant value of %"PRId64", should be >= %"PRId64").", GET_CVALUE( int64, l->get_element(i)), GET_CVALUE( int64, dimension->lower_limit)); continue;}
^
array_range_check.cc:138:101: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
{STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds (using constant value of %"PRId64", should be >= %"PRId64").", GET_CVALUE( int64, l->get_element(i)), GET_CVALUE( int64, dimension->lower_limit)); continue;}
^
array_range_check.cc:142:40: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
{STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds (using constant value of %"PRId64", should be >= %"PRIu64").", GET_CVALUE( int64, l->get_element(i)), GET_CVALUE(uint64, dimension->lower_limit)); continue;}
^
array_range_check.cc:142:101: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
{STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds (using constant value of %"PRId64", should be >= %"PRIu64").", GET_CVALUE( int64, l->get_element(i)), GET_CVALUE(uint64, dimension->lower_limit)); continue;}
^
array_range_check.cc:146:40: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
{STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds (using constant value of %"PRIu64", should be >= %"PRIu64").", GET_CVALUE(uint64, l->get_element(i)), GET_CVALUE(uint64, dimension->lower_limit)); continue;}
^
array_range_check.cc:146:101: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
{STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds (using constant value of %"PRIu64", should be >= %"PRIu64").", GET_CVALUE(uint64, l->get_element(i)), GET_CVALUE(uint64, dimension->lower_limit)); continue;}
^
array_range_check.cc:150:40: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
{STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds (using constant value of %"PRIu64", should be >= %"PRId64").", GET_CVALUE(uint64, l->get_element(i)), GET_CVALUE( int64, dimension->lower_limit)); continue;}
^
array_range_check.cc:150:101: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
{STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds (using constant value of %"PRIu64", should be >= %"PRId64").", GET_CVALUE(uint64, l->get_element(i)), GET_CVALUE( int64, dimension->lower_limit)); continue;}
^
array_range_check.cc:155:40: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
{STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds (using constant value of %"PRId64", should be <= %"PRId64").", GET_CVALUE( int64, l->get_element(i)), GET_CVALUE( int64, dimension->upper_limit)); continue;}
^
array_range_check.cc:155:101: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
{STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds (using constant value of %"PRId64", should be <= %"PRId64").", GET_CVALUE( int64, l->get_element(i)), GET_CVALUE( int64, dimension->upper_limit)); continue;}
^
array_range_check.cc:159:40: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
{STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds (using constant value of %"PRId64", should be <= %"PRIu64").", GET_CVALUE( int64, l->get_element(i)), GET_CVALUE(uint64, dimension->upper_limit)); continue;}
^
array_range_check.cc:159:101: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
{STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds (using constant value of %"PRId64", should be <= %"PRIu64").", GET_CVALUE( int64, l->get_element(i)), GET_CVALUE(uint64, dimension->upper_limit)); continue;}
^
array_range_check.cc:163:40: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
{STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds (using constant value of %"PRIu64", should be <= %"PRIu64").", GET_CVALUE(uint64, l->get_element(i)), GET_CVALUE(uint64, dimension->upper_limit)); continue;}
^
array_range_check.cc:163:101: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
{STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds (using constant value of %"PRIu64", should be <= %"PRIu64").", GET_CVALUE(uint64, l->get_element(i)), GET_CVALUE(uint64, dimension->upper_limit)); continue;}
^
array_range_check.cc:167:40: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
{STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds (using constant value of %"PRIu64", should be <= %"PRId64").", GET_CVALUE(uint64, l->get_element(i)), GET_CVALUE( int64, dimension->upper_limit)); continue;}
^
array_range_check.cc:167:101: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
{STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds (using constant value of %"PRIu64", should be <= %"PRId64").", GET_CVALUE(uint64, l->get_element(i)), GET_CVALUE( int64, dimension->upper_limit)); continue;}
^
array_range_check.cc:202:36: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
STAGE3_ERROR(0, symbol, symbol, "Subrange has lower limit (%"PRId64") larger than upper limit (%"PRId64").", GET_CVALUE( int64, symbol->lower_limit), GET_CVALUE( int64, symbol->upper_limit));
^
array_range_check.cc:202:71: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
STAGE3_ERROR(0, symbol, symbol, "Subrange has lower limit (%"PRId64") larger than upper limit (%"PRId64").", GET_CVALUE( int64, symbol->lower_limit), GET_CVALUE( int64, symbol->upper_limit));
^
array_range_check.cc:212:36: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
STAGE3_ERROR(0, symbol, symbol, "Subrange has lower limit (%"PRIu64") larger than upper limit (%"PRIu64").", GET_CVALUE(uint64, symbol->lower_limit), GET_CVALUE(uint64, symbol->upper_limit));
^
array_range_check.cc:212:71: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
STAGE3_ERROR(0, symbol, symbol, "Subrange has lower limit (%"PRIu64") larger than upper limit (%"PRIu64").", GET_CVALUE(uint64, symbol->lower_limit), GET_CVALUE(uint64, symbol->upper_limit));
^
ar: `u' modifier ignored since `D' is the default (see `U')
Making all in stage4
Making all in generate_c
ar: `u' modifier ignored since `D' is the default (see `U')
Making all in generate_iec
ar: `u' modifier ignored since `D' is the default (see `U')
Making all in generate_json
ar: `u' modifier ignored since `D' is the default (see `U')
[FINALIZING]
Then I started OpenPLC_Editor, an error jumped out. A bug report was saved at /tmp/beremiz/bug_report_2023_07_21__15-32-30.txt. Here is its content.
app-title:
beremiz
app-version:
3.0 beta
Release: 2023-07-17 dev-python3
cwd:
/home/thk/workspace/OpenPLC_Editor
date:
Fri Jul 21 15:32:30 2023
e-type:
<class 'ModuleNotFoundError'>
e-value:
No module named 'numpy'
locals:
__name__: 'controls.DebugVariablePanel.DebugVariablePanel'
__doc__: None
__package__: 'controls.DebugVariablePanel'
__loader__: <_frozen_importlib_external.SourceFileLoader object at 0x7fd3f85e3ac8>
__spec__: ModuleSpec(name='controls.DebugVariablePanel.DebugVariablePanel', loader=<_frozen_importlib_external.SourceFileLoader object at 0x7fd3f85e3ac8>, origin='/home/thk/workspace/OpenPLC_Editor/editor/controls/DebugVariablePanel/DebugVariablePanel.py')
__file__: '/home/thk/workspace/OpenPLC_Editor/editor/controls/DebugVariablePanel/DebugVariablePanel.py'
__cached__: '/home/thk/workspace/OpenPLC_Editor/editor/controls/DebugVariablePanel/__pycache__/DebugVariablePanel.cpython-36.pyc'
__builtins__: {'__name__': 'builtins', '__doc__': "Built-in functions, exceptions, and other objects.\n\nNoteworthy: None is the `nil' object; Ellipsis represents `...' in slices.", '__package__': '', '__loader__': <class '_frozen_importlib.BuiltinImporter'>, '__spec__': ModuleSpec(name='builtins', loader=<class '_frozen_importlib.BuiltinImporter'>), '__build_class__': <built-in function __build_class__>, '__import__': <built-in function __import__>, 'abs': <built-in function abs>, 'all': <built-in function all>, 'any': <built-in function any>, 'ascii': <built-in function ascii>, 'bin': <built-in function bin>, 'callable': <built-in function callable>, 'chr': <built-in function chr>, 'compile': <built-in function compile>, 'delattr': <built-in function delattr>, 'dir': <built-in function dir>, 'divmod': <built-in function divmod>, 'eval': <built-in function eval>, 'exec': <built-in function exec>, 'format': <built-in function format>, 'getattr': <built-in function getattr>, 'globals': <built-in function globals>, 'hasattr': <built-in function hasattr>, 'hash': <built-in function hash>, 'hex': <built-in function hex>, 'id': <built-in function id>, 'input': <built-in function input>, 'isinstance': <built-in function isinstance>, 'issubclass': <built-in function issubclass>, 'iter': <built-in function iter>, 'len': <built-in function len>, 'locals': <built-in function locals>, 'max': <built-in function max>, 'min': <built-in function min>, 'next': <built-in function next>, 'oct': <built-in function oct>, 'ord': <built-in function ord>, 'pow': <built-in function pow>, 'print': <built-in function print>, 'repr': <built-in function repr>, 'round': <built-in function round>, 'setattr': <built-in function setattr>, 'sorted': <built-in function sorted>, 'sum': <built-in function sum>, 'vars': <built-in function vars>, 'None': None, 'Ellipsis': Ellipsis, 'NotImplemented': NotImplemented, 'False': False, 'True': True, 'bool': <class 'bool'>, 'memoryview': <class 'memoryview'>, 'bytearray': <class 'bytearray'>, 'bytes': <class 'bytes'>, 'classmethod': <class 'classmethod'>, 'complex': <class 'complex'>, 'dict': <class 'dict'>, 'enumerate': <class 'enumerate'>, 'filter': <class 'filter'>, 'float': <class 'float'>, 'frozenset': <class 'frozenset'>, 'property': <class 'property'>, 'int': <class 'int'>, 'list': <class 'list'>, 'map': <class 'map'>, 'object': <class 'object'>, 'range': <class 'range'>, 'reversed': <class 'reversed'>, 'set': <class 'set'>, 'slice': <class 'slice'>, 'staticmethod': <class 'staticmethod'>, 'str': <class 'str'>, 'super': <class 'super'>, 'tuple': <class 'tuple'>, 'type': <class 'type'>, 'zip': <class 'zip'>, '__debug__': True, 'BaseException': <class 'BaseException'>, 'Exception': <class 'Exception'>, 'TypeError': <class 'TypeError'>, 'StopAsyncIteration': <class 'StopAsyncIteration'>, 'StopIteration': <class 'StopIteration'>, 'GeneratorExit': <class 'GeneratorExit'>, 'SystemExit': <class 'SystemExit'>, 'KeyboardInterrupt': <class 'KeyboardInterrupt'>, 'ImportError': <class 'ImportError'>, 'ModuleNotFoundError': <class 'ModuleNotFoundError'>, 'OSError': <class 'OSError'>, 'EnvironmentError': <class 'OSError'>, 'IOError': <class 'OSError'>, 'EOFError': <class 'EOFError'>, 'RuntimeError': <class 'RuntimeError'>, 'RecursionError': <class 'RecursionError'>, 'NotImplementedError': <class 'NotImplementedError'>, 'NameError': <class 'NameError'>, 'UnboundLocalError': <class 'UnboundLocalError'>, 'AttributeError': <class 'AttributeError'>, 'SyntaxError': <class 'SyntaxError'>, 'IndentationError': <class 'IndentationError'>, 'TabError': <class 'TabError'>, 'LookupError': <class 'LookupError'>, 'IndexError': <class 'IndexError'>, 'KeyError': <class 'KeyError'>, 'ValueError': <class 'ValueError'>, 'UnicodeError': <class 'UnicodeError'>, 'UnicodeEncodeError': <class 'UnicodeEncodeError'>, 'UnicodeDecodeError': <class 'UnicodeDecodeError'>, 'UnicodeTranslateError': <class 'UnicodeTranslateError'>, 'AssertionError': <class 'AssertionError'>, 'ArithmeticError': <class 'ArithmeticError'>, 'FloatingPointError': <class 'FloatingPointError'>, 'OverflowError': <class 'OverflowError'>, 'ZeroDivisionError': <class 'ZeroDivisionError'>, 'SystemError': <class 'SystemError'>, 'ReferenceError': <class 'ReferenceError'>, 'BufferError': <class 'BufferError'>, 'MemoryError': <class 'MemoryError'>, 'Warning': <class 'Warning'>, 'UserWarning': <class 'UserWarning'>, 'DeprecationWarning': <class 'DeprecationWarning'>, 'PendingDeprecationWarning': <class 'PendingDeprecationWarning'>, 'SyntaxWarning': <class 'SyntaxWarning'>, 'RuntimeWarning': <class 'RuntimeWarning'>, 'FutureWarning': <class 'FutureWarning'>, 'ImportWarning': <class 'ImportWarning'>, 'UnicodeWarning': <class 'UnicodeWarning'>, 'BytesWarning': <class 'BytesWarning'>, 'ResourceWarning': <class 'ResourceWarning'>, 'ConnectionError': <class 'ConnectionError'>, 'BlockingIOError': <class 'BlockingIOError'>, 'BrokenPipeError': <class 'BrokenPipeError'>, 'ChildProcessError': <class 'ChildProcessError'>, 'ConnectionAbortedError': <class 'ConnectionAbortedError'>, 'ConnectionRefusedError': <class 'ConnectionRefusedError'>, 'ConnectionResetError': <class 'ConnectionResetError'>, 'FileExistsError': <class 'FileExistsError'>, 'FileNotFoundError': <class 'FileNotFoundError'>, 'IsADirectoryError': <class 'IsADirectoryError'>, 'NotADirectoryError': <class 'NotADirectoryError'>, 'InterruptedError': <class 'InterruptedError'>, 'PermissionError': <class 'PermissionError'>, 'ProcessLookupError': <class 'ProcessLookupError'>, 'TimeoutError': <class 'TimeoutError'>, 'open': <built-in function open>, 'quit': Use quit() or Ctrl-D (i.e. EOF) to exit, 'exit': Use exit() or Ctrl-D (i.e. EOF) to exit, 'copyright': Copyright (c) 2001-2019 Python Software Foundation.
All Rights Reserved.
Copyright (c) 2000 BeOpen.com.
All Rights Reserved.
Copyright (c) 1995-2001 Corporation for National Research Initiatives.
All Rights Reserved.
Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam.
All Rights Reserved., 'credits': Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands
for supporting Python development. See www.python.org for more information., 'license': Type license() to see the full license text, 'help': Type help() for interactive help, or help(object) for help about object., '_': <built-in function GetTranslation>}
reduce: <built-in function reduce>
platform:
Linux-5.4.0-150-generic-x86_64-with-Ubuntu-18.04-bionic
python-version:
3.6.9
traceback:
File "./editor/Beremiz.py", line 204, in AppStart
self.BackgroundInitialization()
File "./editor/Beremiz.py", line 137, in BackgroundInitialization
self.ImportModules()
File "./editor/Beremiz.py", line 180, in ImportModules
mod = __import__(modname)
File "/home/thk/workspace/OpenPLC_Editor/editor/BeremizIDE.py", line 42, in <module>
from editors.EditorPanel import EditorPanel
File "/home/thk/workspace/OpenPLC_Editor/editor/editors/EditorPanel.py", line 29, in <module>
from controls import VariablePanel
File "/home/thk/workspace/OpenPLC_Editor/editor/controls/__init__.py", line 34, in <module>
from controls.DebugVariablePanel import DebugVariablePanel
File "/home/thk/workspace/OpenPLC_Editor/editor/controls/DebugVariablePanel/__init__.py", line 26, in <module>
from controls.DebugVariablePanel.DebugVariablePanel import DebugVariablePanel
File "/home/thk/workspace/OpenPLC_Editor/editor/controls/DebugVariablePanel/DebugVariablePanel.py", line 29, in <module>
import numpy as np
<class 'ModuleNotFoundError'>: No module named 'numpy'
wx-platform:
__WXGTK__
wx-version:
4.0.1
I'm currently working on adding a new feature to OpenPLC.
The problem is when I edit the source code I can't test my changes and view them without reinstalling the editor all over again.
Is there a quick way for developers to view changes before compiling?
We are working on a project that requires EtherCAT and Modbus for the softPLC, how do I use these in OpenPLC_editor?
Should be pretty self explanatory, those warn or raise exceptions on python3.10 + python3-wxgtk4.0.
Thought about setting up a PLC Tool on a ChromeBook for a relative, did not expect this kinda troubles.
Doesn't help that the links to github are rather hidden on the website.
diff --git a/editor/BeremizIDE.py b/editor/BeremizIDE.py
index c053adc..e7fa1fe 100644
--- a/editor/BeremizIDE.py
+++ b/editor/BeremizIDE.py
@@ -122,7 +122,7 @@ class Beremiz(IDEFrame):
kind=wx.ITEM_NORMAL, text=_(u'Open') + '\tCTRL+O')
parent.AppendSubMenu(self.RecentProjectsMenu, _("&Recent Projects"))
parent.AppendSeparator()
- parent.AppendMenu(wx.ID_ANY, _("&Tutorials and Examples"), self.TutorialsProjectsMenu)
+ parent.Append(wx.ID_ANY, _("&Tutorials and Examples"), self.TutorialsProjectsMenu)
examples_dir = Bpath("examples")
project_list = sorted(os.listdir(examples_dir))
diff --git a/editor/Beremiz_service.py b/editor/Beremiz_service.py
index 475c2b6..5d45748 100755
--- a/editor/Beremiz_service.py
+++ b/editor/Beremiz_service.py
@@ -341,7 +341,7 @@ if enablewx:
_servicename = self.pyroserver.servicename
_servicename = '' if _servicename is None else _servicename
dlg = ParamsEntryDialog(None, _("Enter a name "), defaultValue=_servicename)
- dlg.SetTests([(lambda name: len(name) is not 0, _("Name must not be null!"))])
+ dlg.SetTests([(lambda name: len(name) != 0, _("Name must not be null!"))])
if dlg.ShowModal() == wx.ID_OK:
self.pyroserver.servicename = dlg.GetValue()
self.pyroserver.Restart()
diff --git a/editor/controls/ProjectPropertiesPanel.py b/editor/controls/ProjectPropertiesPanel.py
index bf10fe6..a14f811 100644
--- a/editor/controls/ProjectPropertiesPanel.py
+++ b/editor/controls/ProjectPropertiesPanel.py
@@ -256,8 +256,8 @@ class ProjectPropertiesPanel(wx.Notebook):
elif item == "scaling":
for language, (x, y) in value.items():
if language in self.Scalings:
- self.Scalings[language][0].SetValue(x)
- self.Scalings[language][1].SetValue(y)
+ self.Scalings[language][0].SetValue(int(x))
+ self.Scalings[language][1].SetValue(int(y))
else:
tc = getattr(self, item, None)
if tc is not None:
Hello,
I tried to install OpenPLC editor on my Ubuntu 18.04 desktop but when the install.sh script finishes and try to load the editor the Error window shows up and tells me to report you the bug that occurred.
Hello All,
Running Description: Ubuntu 20.04.6 LTS
OpenPLC Editor 2.01 Release On 2023-08-03
I am a newbie trying OpenPLC for the first time.
While trying to Generate a Program for OpenPLC runtime or transfer program to PLC (in my case barebone arduino nano) you got an error related to the newly added file jaguar.txt file.
Iniciar la construcción en /home/user/folder/PLC-Examples/PLC-Example-NanoBoard/build
Generando el código ST/IL/SFC IEC-61131 para el SoftPLC...
Collecting data types
Collecting POUs
Generate POU PLC_Example_Nano
Generate Config(s)
Compilando el programa IEC en código C...
"/home/user/Documentos/Diario/Referencia/Software/OpenPLC/OpenPLC_Editor/matiec/iec2c" -f -l -p -I "/home/user/Documentos/Diario/Referencia/Software/OpenPLC/OpenPLC_Editor/matiec/lib" -T "/home/user/folder/Diario/2023/PLC-Examples/PLC-Example-NanoBoard/build" "/home/user/PLC-Examples/PLC-Example-NanoBoard/build/plc.st"
Terminado con estatus 1 (pid 26548)
Error opening included file jaguar.txt
Error: El compilador de IEC a C retorno 1
I got this error for every provided example like blink or hello world.
The jaguar.txt file is located here:
/OpenPLC/OpenPLC_Editor/matiec/lib
And here:
/OpenPLC/OpenPLC_Editor/editor/arduino/src/lib
May you please double check?
Thanks a lot.
Best Regards
Whenever I upload a runtime I keep getting messages on every terminal like:
Broadcast message from root@HOSTNAME (somewhere) (Tue Oct 25 21:
Warning communications lost with UPS HOSTNAME
Broadcast message from root@HOSTNAME (somewhere) (Tue Oct 25 21:
Communications restored with UPS HOSTNAME
Broadcast message from root@HOSTNAME (somewhere) (Tue Oct 25 21:
Warning communications lost with UPS HOSTNAME
Broadcast message from root@HOSTNAME (somewhere) (Tue Oct 25 21:
Communications restored with UPS HOSTNAME
My UPS in on /dev/ttyS0 and I/m uploading on /dev/ttyUSBX. I guess OpenPLC is finding which port are available to populate the dropdown but it shouldn't cause my apcupsd to complain.
System is Linux Fedora36.
'python-wxgtk3.0' is missing in newer Buntus and 'python-wxgtk4.0' that does not work with openplc editor
Need requirements.txt
When I use the release version of the official website and use the emulation feature. I received a startup error from WAMP indicating that I was missing packages such as autobahn, twisted, etc. I didn't know exactly what version of autobahn and twisted I should use, and I encountered other errors from Twisted packages when I selected and installed Twisted (20.3) and autobahn (19.11.2).
I was trying to upload a program into a microcontroller and ran into this error:
Some directories in my system have non-ASCII characters in them, since my computer is in Spanish. I also see some Spanish text in the logs. I managed to make it work by doing the following change in editor/arduino/builder.py
line 410.
-compiler_logs += stdout
+compiler_logs += repr(stdout)
Then I restarted the editor and tried to upload again, and it worked.
I don't know if this is the best solution, and whether these is the only place in the code where this is a problem (probably not). It would be worth looking into it.
Photo:
https://d28lcup14p4e72.cloudfront.net/203128/8001436/path.png
When I run OpenPLC Editor I get an error "The system cannot find the path specified.".
OS : Windows 10.
Would like to see that when declaration of an External Variable that the Document Field is automatically populated into the local variable.
Which version of Linux it developing on each branch
Could write inside the README
So we no need to guess when using distrobox/toolbox like things.
Beremiz_service: 1.0
Traceback (most recent call last):
Release: 2021-02-22
File "/home/marlin/opt/OpenPLC_Editor/editor/Beremiz_service.py", line 221, in
class ParamsEntryDialog(wx.TextEntryDialog):
File "/home/marlin/opt/OpenPLC_Editor/editor/Beremiz_service.py", line 223, in ParamsEntryDialog
def init(self, parent, message, caption=_("Please enter text"), defaultValue="",
File "/home/marlin/opt/OpenPLC_Editor/editor/Beremiz_service.py", line 189, in unicode_translation
return wx.GetTranslation(message).encode(default_locale)
TypeError: encode() argument 1 must be string, not None
"/usr/bin/python2.7" "/home/marlin/opt/OpenPLC_Editor/editor/Beremiz_service.py" -p 61546 -i localhost -x 1 /tmp/tmpDa09xe
exited with status 1 (pid 50110)
PYRO connecting to URI : PYROLOC://127.0.0.1:61546
Exception while connecting to 'LOCAL://': connection failed
Connection failed to LOCAL://!
When modbus RTU is enabled as a slave, and applied to a running system. When we restart or boot the device, serial buffer overflow may occur..
this is the code i changed in my repository
cant install/run in my machine, I'm using Manjaro linux latest (KDE plasma)
it showing error because of python incompatibility.
E: Impossibile trovare il pacchetto python-wxgtk3.0
E: Impossibile trovare alcun pacchetto tramite il glob "python-wxgtk3.0"
E: Impossibile trovare alcun pacchetto tramite l'espressione regolare "python-wxgtk3.0"
Having a global DATE or DT variable causes the following error when the debugger compiles the C code:
Start build in /home/pi/Documents/minimal_case/build
Generating SoftPLC IEC-61131 ST/IL/SFC code...
Compiling IEC Program into C code...
Extracting Located Variables...
C code generated successfully.
PLC :
[CC] plc_main.c -> plc_main.o
[CC] plc_debugger.c -> plc_debugger.o
py_ext :
[CC] py_ext.c -> py_ext.o
PLC :
[CC] Config0.c -> Config0.o
[CC] Res0.c -> Res0.o
In file included from /home/pi/Documents/OpenPLC_Editor/matiec/lib/C/iec_std_FB.h:35,
from /home/pi/Documents/OpenPLC_Editor/matiec/lib/C/iec_std_lib.h:753,
from /home/pi/Documents/minimal_case/build/Res0.c:6:
/home/pi/Documents/minimal_case/build/Res0.c: In function ‘RES0_init__’:
/home/pi/Documents/minimal_case/build/Res0.c:27:48: error: initializer element is not constant
__INIT_GLOBAL(DATE,LOCALVAR0,__INITIAL_VALUE(__date_to_timespec(1, 1, 1970)),retain)
^~~~~~~~~~~~~~~~~~
/home/pi/Documents/OpenPLC_Editor/matiec/lib/C/accessor.h:60:31: note: in definition of macro ‘__INIT_GLOBAL’
static const type temp = initial;\
^~~~~~~
/home/pi/Documents/minimal_case/build/Res0.c:27:32: note: in expansion of macro ‘__INITIAL_VALUE’
__INIT_GLOBAL(DATE,LOCALVAR0,__INITIAL_VALUE(__date_to_timespec(1, 1, 1970)),retain)
^~~~~~~~~~~~~~~
"gcc" -c "/home/pi/Documents/minimal_case/build/Res0.c" -o "/home/pi/Documents/minimal_case/build/Res0.o" -O2 -fPIC "-I/home/pi/Documents/OpenPLC_Editor/matiec/lib/C" -Wno-unused-function
exited with status 1 (pid 14167)
C compilation of Res0.c failed.
C Build failed.
This doesn't happen for local variables or when the generated st file is uploaded to the runtime.
I put together a minimal test case to diagnose the issue:
minimal_case.tar.gz
Since python2 is deprecated already for 3 years, it is not longer available in most of modern systems.. Thus I trying dev-python3 branch, but it seems to using some deprecated libraries too.
It can not start up, because it tries to import private (!!) function from matplotlib (_convert_agg_to_wx_bitmap). I do not know in which exact version they removed this private function, but in 3.6.2 it's already not available. By google I can see some archived docs for version 3.0.0 (https://matplotlib.org/3.0.0/_modules/matplotlib/backends/backend_wxagg.html) where this function is still present.
Because I do not know what it should do, I can not provide proper FIX and PR for it :(
Traceback (most recent call last):
File "/home/petrkr/svn/OpenPLC_Editor/editor/Beremiz.py", line 204, in AppStart
self.BackgroundInitialization()
File "/home/petrkr/svn/OpenPLC_Editor/editor/Beremiz.py", line 137, in BackgroundInitialization
self.ImportModules()
File "/home/petrkr/svn/OpenPLC_Editor/editor/Beremiz.py", line 180, in ImportModules
mod = __import__(modname)
File "/home/petrkr/svn/OpenPLC_Editor/editor/BeremizIDE.py", line 42, in <module>
from editors.EditorPanel import EditorPanel
File "/home/petrkr/svn/OpenPLC_Editor/editor/editors/EditorPanel.py", line 29, in <module>
from controls import VariablePanel
File "/home/petrkr/svn/OpenPLC_Editor/editor/controls/__init__.py", line 34, in <module>
from controls.DebugVariablePanel import DebugVariablePanel
File "/home/petrkr/svn/OpenPLC_Editor/editor/controls/DebugVariablePanel/__init__.py", line 26, in <module>
from controls.DebugVariablePanel.DebugVariablePanel import DebugVariablePanel
File "/home/petrkr/svn/OpenPLC_Editor/editor/controls/DebugVariablePanel/DebugVariablePanel.py", line 44, in <module>
from controls.DebugVariablePanel.DebugVariableTextViewer import DebugVariableTextViewer
File "/home/petrkr/svn/OpenPLC_Editor/editor/controls/DebugVariablePanel/DebugVariableTextViewer.py", line 31, in <module>
from controls.DebugVariablePanel.DebugVariableViewer import DebugVariableViewer
File "/home/petrkr/svn/OpenPLC_Editor/editor/controls/DebugVariablePanel/DebugVariableViewer.py", line 32, in <module>
from matplotlib.backends.backend_wxagg import _convert_agg_to_wx_bitmap
ImportError: cannot import name '_convert_agg_to_wx_bitmap' from 'matplotlib.backends.backend_wxagg' (/usr/lib/python3.10/site-packages/matplotlib/backends/backend_wxagg.py)
I have a structure tSYS that has a FirstScan member. I have defined in resource a global called SYS of type tSYS.
I would like to be able to select SYS.FirstScan as the Single for a interrupt task. When I click on the Single of the interrupt, nothing is displayed because it is not accessing my SYS global.
The current version downloaded from the website detects a new version, but fails to download (?) and install (?) in Windows (10).
ANy ideas where to patch?
OpenPLC Editor 2.01, branch master
Ubuntu 22.04
Python 3.10.6
in python virtural environment
When updating OpenPLC Editor from its menu file, a bug poped up. The bug report is shown here.
app-title:
beremiz
app-version:
2.01
Release: 2023-05-13
cwd:
/home/nuc/workspace/OpenPLC_Editor
date:
Sat Jul 22 14:44:46 2023
e-type:
<class 'urllib2.URLError'>
e-value:
<urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:733)>
locals:
err: SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:733)')
h: <httplib.HTTPSConnection instance at 0x7f55246cc1e0>
self: <urllib2.HTTPSHandler instance at 0x7f55246bbe60>
req: <urllib2.Request instance at 0x7f55246bdcd0>
headers: {'Host': 'raw.githubusercontent.com', 'Connection': 'close', 'User-Agent': 'Python-urllib/2.7'}
host: 'raw.githubusercontent.com'
http_class: <class httplib.HTTPSConnection at 0x7f553ff829f0>
http_conn_args: {'context': None}
platform:
Linux-5.19.0-46-generic-x86_64-with-Kylin-V10-kylin
python-version:
2.7.18
self:
_debuglevel: 0
_context: None
parent: <urllib2.OpenerDirector instance at 0x7f5524b62140>
traceback:
File "/home/nuc/workspace/OpenPLC_Editor/editor/util/ExceptionHandler.py", line 153, in run_with_except_hook
run_old(*args, **kw)
File "/usr/lib/python2.7/threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "/home/nuc/workspace/OpenPLC_Editor/editor/dialogs/EditorUpdateDialog.py", line 123, in updater
cloud_file = urllib2.urlopen('https://github.com/thiagoralves/OpenPLC_Editor/blob/master/revision?raw=true')
File "/usr/lib/python2.7/urllib2.py", line 154, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 435, in open
response = meth(req, response)
File "/usr/lib/python2.7/urllib2.py", line 548, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python2.7/urllib2.py", line 467, in error
result = self._call_chain(*args)
File "/usr/lib/python2.7/urllib2.py", line 407, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 654, in http_error_302
return self.parent.open(new, timeout=req.timeout)
File "/usr/lib/python2.7/urllib2.py", line 435, in open
response = meth(req, response)
File "/usr/lib/python2.7/urllib2.py", line 548, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python2.7/urllib2.py", line 467, in error
result = self._call_chain(*args)
File "/usr/lib/python2.7/urllib2.py", line 407, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 654, in http_error_302
return self.parent.open(new, timeout=req.timeout)
File "/usr/lib/python2.7/urllib2.py", line 429, in open
response = self._open(req, data)
File "/usr/lib/python2.7/urllib2.py", line 447, in _open
'_open', req)
File "/usr/lib/python2.7/urllib2.py", line 407, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 1248, in https_open
context=self._context)
File "/usr/lib/python2.7/urllib2.py", line 1205, in do_open
raise URLError(err)
<class 'urllib2.URLError'>: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:733)>
wx-platform:
__WXGTK__
wx-version:
3.0.2.0
Hi,
I noticed that when you visualize the print preview via File>Preview with the "landscape"/"horizontal" page set in File>Page settings, you get a cropped version of your diagram even if it would fit in the page, and you can't see the remaining part in the following pages, it is simply not visualizable.
The version I'm referring to is the 1.0 .
Thank you.
Hello,
I'm learning to use OpenPLC and I'm using as my operational system the Ubuntu 20.04. I have installed it by the last update in the github repository. The installation seemed to be okay.
My problem is that the console and PLC Log does not show readable texts. Please, see the figure below:
Any help to solve this problem?
Thanks in advance.
./install.sh installs a Python2.7 on Linux, even if Python 3 is available.
would be nicer with Python 3, especially when using ESP-IDF.
make the declaration area of structures resizable via mouse drag, like the declaration area in functions/funtion blocks/programms.
Is OpenPLC_Editor an update of the PLCOpen_Editor you used to host in your website? Are both based on beremiz? Can you tell me the main differences between them?
During using of OpenPLC_Editor, we found that Modbus and EtherCAT support is missing. However, this functionality is available in beremiz. What should we do to make OpenPLC_Editor support this?
Since the PLCopen XML schema format became an IEC standard (IEC 61131-10) it would be nice if the OpenPLC editor would save its code in this latest version of the standard. As far as I can tell, the changes between PLCopen tc6_0201 and IEC 61131-10 are minor. (e.g. The first letter of an element is now capitalized, and a few additional XML attributes. This would make it easier in the future to exchange code with other engineering tools that support IEC 61131-10.
Installation complete without errors but starting OpenPLC Editor I get:
_This will install OpenPLC Editor dependencies in your system:
Would you like to continue?_
When importing a single rung network without connection elements for the connector routing, the auto routing connects to the connectionPointIn of the incoming element to the connectionPointIn of the outgoing element instead of the connectionPointOut.
To reproduce, create a single rung network with a contact and coil and save. Edit PLC.xml by removing sub-elements in connection collection. Open project again.
Also, if the positions of the elements is removed, only the LeftPower rail is drawn and errors are reported if additional elements are added to the network.
In some cases, when something goes wrong during the compiling procedure, the editor crashes and the compiler gets stuck in the middle of something.
This behaviour occurs, for instance, when you have typos in SFC transitions (e.g. a ANDb instead of a AND b). The returned windows error is "file \xe8 is already used by another process".
Not sure this report helps, but it may be something worth checking (the only fix I find is to reboot the system, which may be very annoying when you are trying to track down the bug).
new distros use python-wxgtk4.x... t
Traceback (most recent call last):
File "Beremiz.py", line 33, in
import wx
ImportError: No module named wx
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.