Re: [Beremiz-devel] Learning BeremizIDE and beremiz-service

classic Classic list List threaded Threaded
1 message Options
skv
Reply | Threaded
Open this post in threaded view
|

Re: [Beremiz-devel] Learning BeremizIDE and beremiz-service

skv
Administrator
Hi Daniel,

On 18-07-04 12:35, Daniel Mirkin wrote:
> Dear Andrey:
>
> I'm learning on BeremizIDE and beremiz-service usage.
> I grabbed all the information available at Beremiz site, and the Smarteh
> manual too.
IMHO the best user manual for Beremiz is user manual from INEUM.
Original version is in Russian, but you can read automatically
translated version here. It's good enough. Keep in mind, that it
contains information about some INEUM specific plugins (protocols and
I/O modules)

https://translate.google.com/translate?hl=ru&sl=auto&tl=en&u=https%3A%2F%2Fsm1820.github.io%2Fberemiz%2F

> However, I cann't found any clear information about running Beremiz as a
> virtualPLC on Linux (runtime?).
> Is that the beremiz-service that
> http://beremiz.readthedocs.io/en/latest/manual/connectors.html
> refers to?

Connectors are transport drivers for communication between runtime and
IDE. They are used to transfer PLC program from IDE (developer
workstation) to PLC (target), control PLC program execution, transfer
debug information and receive current values of variables in executed
program.



> Or virtualPLC runtime for Linux is not available under Beremiz project?
Of course, Beremiz runtime for GNU/Linux is available in Beremiz
project - Beremiz_service.py.
Have you read README.md in https://bitbucket.org/automforge/beremiz?
It contains information how to run PLC runtime (Beremiz_service).

(Probably README should be more specific and explain in more details

Just for information about project design. Beremiz_service.py isn't
*the* only one runtime for Beremiz.
Vendor (PLC developer) may implement own runtime (C-based, Java-based,
...) and he needs only implement corresponding connector for IDE.

 

> Meanwhile, I've decided to try, perhaps doing brute force intents ;-)
> For this, I've wrote a very simple test program (two digital inputs, one
> digital output, and one RS block).
> BeremizIDE succefully compiles this program and generates.st files, too.
> I've declared BeremizRoot URI_location as LOCAL:// in Project > Config
> and launched beremiz-service from terminal:
>
> [daniel@hardwork ~]$ beremiz-service
> /usr/lib/python2.7/site-packages/wx-3.0-gtk3/wx/_core.py:16629:
> UserWarning: wxPython/wxWidgets release number mismatch
>   warnings.warn("wxPython/wxWidgets release number mismatch")
> HTTP interface port : 8009
> Pyro port : 3000
> Current working directory : /home/daniel
> UI thread started successfully.
If you use 'LOCAL:://' temporary instance of Beremiz runtime
(Beremiz_service.py) is launched and you can debug your program on
local machine without any real PLC. This is log from
Beremiz_service.py, that is launched for you.

> Then, I have connected BeremizIDE to virtual PLC and transferred the
> generated program.
> But Beremiz PLC Log complains about various errors, showed in terminal, too:
>
> <code>
> PLCobject : Traceback (most recent call last):
>   File "/usr/share/beremiz/runtime/PLCObject.py", line 269, in _LoadPLC
>     self._PLClibraryHandle = dlopen(self._GetLibFileName())
> OSError: /home/daniel/d792bf5ec10db55c9fdfe5e7071c5b64.so: undefined
> symbol: __IX0_1
> </code>
> Undefined symbol: __IX0_1 ????
>
> But I've declared all input-output variables in my program in IEC 61131-3
> style: %IX0.0 , %IX0.1 , %QX0.0 !!!
As Mario already answered, located IEC addresses are used to bind PLC variables with external
drivers (I/O drivers, communication protocols and so on).
Drivers/Plugins/Modules should be explicitly added to PLC project (in
project tree).
Cell with located IEC address does have small button on right side. If
you click on it, then browse dialog is opened. It will show what IEC
addresses are available in your project. If it's empty, then you don't
have any located addresses available for you.
So you can select one and don't have to write it (%IX1.0.2) by hand.
Because if you write wrong/non-existed address, then runtime will
complain about it (Undefined symbol: __IX0_1), as in your case.


> I'm not able either to start or stop virtual PLC from Beremiz task icon
> contextual menu; http://localhost:8009/ shows PLC IS STOPPED all the time.
> I cann't found where the errors are originated.
>
> I send you, attached to this email, my complete project (zipped), and
> beremiz_service_error.txt containing all logs in PLC Log (including live
> Python shell), and terminal messages too.
> Could you kindly look at these, and tell me what I'm doing wrong?
>
> Or perhaps virtualPLC is a misconcept from me?
>


> Referred to our previous conversation, on Beremiz and Modbus:
> If I can run any kind of virtualPLC on Linux, first I will try to do remote
> control onto a Siemens LOGO! v8, that has Modbus TCP enabled.
> If I can grab some Modbus RTU module from my friends, I will test if is
> possible to remote control them via RS-485 bus (I have USB/RS-485 adapters,
> CH340 and Prolific 2303 based).
Ok, I see. Sorry, I've not done Modbus example yet. But it on my high-priority
TODO list.


> Off topic?
> I'm hardily testing OpenPLC Project runtime for Linux, too (
> http://www.openplcproject.com/getting-started-linux ).
> I've succesfully managed to install it in Arch Linux, and I'm using
> BeremizIDE to generate the program and export to a .st file required by
> this runtime.
>
> The only previous action I need to upload the program to OpenPLC runtime,
> is to change CONFIGURATION config to CONFIGURATION Config0 in
> generated_plc.st file.
> A little question: is possible to edit this configuration name directly in
> BeremizIDE?
If I understand correctly your problem then, all you have to do is
just click on in resources on configuration name 'config' and rename it to 'Config0'.


 
> Soon, I will try to run OpenPLC Project runtime in Raspberry Pi, but on
> Arch Linux ARM, not on Raspbian.
BTW, does Arch have arm cross-toolchain available (arm-none-linux-gnueabi-gcc)?

> I wish to use cheap WELLPRO Modbus RTU interfaces in the future (see
> http://www.shwellpro.com/products.asp ).
>
> Your answers will be welcome!
> Best regards.
>
>
> *Daniel [hidden email] <[hidden email]>*
> *Cel. +54 9 223 524 2171*

>
> Beremiz logs
>
> Start build in /home/daniel/Beremiz/Programs/ld_test2/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
> etherlab_ext :
>    [CC]  etherlab_ext.c -> etherlab_ext.o
Please update Beremiz from my repo,
https://bitbucket.org/skvorl/beremiz/
It does contain some important fixes, related to EtherCAT extension,
that was recently added. They are important even if you don't use
EtherCAT in your project.


> PLC :
>    [CC]  config.c -> config.o
>    [CC]  Res0.c -> Res0.o
> Linking :
>    [CC]  plc_main.o plc_debugger.o py_ext.o etherlab_ext.o config.o Res0.o -> ld_test2.so
> Successfully built.


--
Best regards,
Andrey Skvortsov



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Beremiz-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beremiz-devel

signature.asc (849 bytes) Download Attachment