Codesys Control RTE V3 - Network Adapter configuration for Ethercat real time bus - plc

I am quite new to the Codesys platform and I am experiencing some problems when trying to use the RTE on a Windows IPC as a target device.
I am using an IPC (Windows 7 Embedded) with the following runtime version -> CODESYS Control RTE V3 v3.5.17.0
I run the Codesys Environment in my laptop (Also version v3.5.17.0) and I connect to the IPC runtime without problems, by choosing the right target PLC device (CODESYS Control RTE V3 x64).
I add an "Ethercat Master SoftMotion" device to my project and assign the correspoding IEC task (Bus Cycle Task) in which the stack will run, and select the NIC to be used by the stack without major problems. Just as described in the documentation -> https://help.codesys.com/webapp/_ecat_tutorial;product=core_EtherCAT_Configuration_Editor;version=4.1.0.0
When I Log In and Download the project so that I could start scanning the network to find the different Ethercat Slaves, I get the following messages:
[FATAL ERROR] Unresolved reference: 'SYSETHERNETADAPTERCLOSE'
[FATAL ERROR] Unresolved reference: 'GETNUMBEROFADAPTERS'
[FATAL ERROR] Unresolved reference: 'GETADAPTERINFO'
[FATAL ERROR] Unresolved reference: 'SYSETHERNETADAPTEROPEN'
[FATAL ERROR] Unresolved reference: 'SYSETHERNETETHFRAMESEND'
[FATAL ERROR] Unresolved reference: 'SYSETHERNETETHFRAMERECEIVE'
[FATAL ERROR] Unresolved reference: 'SYSETHERNETFRAMERELEASE'
[FATAL ERROR] Unresolved reference: 'GETIPETHFRAME'
[FATAL ERROR] Unresolved reference: 'SYSETHERNETIPFRAMESEND'
[FATAL ERROR] Unresolved reference: 'SYSETHERNETIPFRAMERECEIVE'
I also get I dialogue box stating:
"Error during download:
10 unserolved reference(s), 0 signature mismatch(es), 0 version mismatch(es) found
The device version on the hardware seems to be different from the device version used in the project. Try to up-/downgrade the device in the project to match the actual version of the hardware.
Please take a look in the messages view for further details".
This error message seems misleading because this is a new project on a new installed environment where both Codesys Development and the runtime both have exactly the same version and the project is therefore created for the right version of the runtime.
I had a look at the manual and I have to select the proper driver -> https://help.codesys.com/webapp/_cds_rtev3_startup_cifx_hil;product=core_codesys_control;version=3.5.17.0
At this point is when I find the problems:
According to the documentation I need to add the CmpHilscherCIFX component in the Component Manager Tab of the PLC Configuration which I did and then restarted the IPC.
Later on, the bootloader and correct firmware must be chosen by modifying the "CODESYSControl.cfg" file. This is a step I also do as you can see in the attachments, I simply add the Ethercat select the Ethercat firmware file according to "_cifX firmware.txt" which I found in "C:\Program Files\CODESYS\CODESYS Control RTE3\HilscherCIFX\Firmware":
[CmpHilscherCIFX]
TraceLevel=0xFFFFFFFF
InterruptMode=0
DMAMode=1
Device.0.BootloaderFilePath=$Firmware$\HilscherCIFX\Firmware\NETX100-BSL.bin
Device.0.Channel.0.FirmwareFile=$Firmware$\HilscherCIFX\Firmware\cifxecm.nxf
[SysFile]
|PlcLogicPrefix=1
PlaceholderFilePath=C:\Program Files\CODESYS\CODESYS Control RTE3, $Firmware$
After applying these changes, I restarted the IPC again. However, I was still getting this Unresolved reference errors, I noticed that there wasn´t any Ethercat firmware file (cifxecm.nxf) in "C:\Program Files\CODESYS\CODESYS Control RTE3\HilscherCIFX\Firmware":
The chosen NIC to run the Ethercat stack on the IPC is an Intel I211, so in theory the Chipset is supported.
How is this possible? I am not sure this is the cause of my problems, but it definitely seems something strange. Also the documentation does not seem to be up to date with the version I am using of the runtime, which I believe is onw of the latest.
I hope someone has some suggestion and if you need further clarification, I will provide more details.

It seems I was following the wrong part of the documentation, since I am not using a HilscherCIFX card.
The solution is explained in the section Available Dynamic Components.
Basically I had to:
Revert the changes I applied, those explained in my previous post.
Make sure secureboot is disabled in the BIOS settings, (this can be done during the installation of the RTE runtime).
I had to install the right Codesys Driver for the Intel I211 NIC which is "CmpEt1000Drv" as described in the documentation. The driver is in "C:\Program Files\CODESYS\CODESYS Control RTE3\Cmpet1000MPD". Personally, uninstalling the previous driver from the NIC I wanted to use for Ethercat from the Windows Device manager and installing the new one from there was enough for me.
Add the CmpEt1000Drv component to the component list (Component Manager tab) of RTE System Configuration.
Stop and then Restart the RTE environment.

Related

Tessarect implementation JAVA

I'm trying to implement OCR recognition through Tessarect.
But at the moment I'm stuck with this error.
This is what I've done so far:
Homebrew tessarect
Download the API
Link the Jar with my project (build path > Configure build path > Add external Jar's
But when I compile my code this is the error
Error opening data file D:/Tess4J/tessdata/eng.traineddata
Please make sure the TESSDATA_PREFIX environment variable is set to your "tessdata" directory.
Failed loading language 'eng'
Tesseract couldn't load any languages!
Warning: Invalid resolution 0 dpi. Using 70 instead.
I've downloaded the eng trained data and I've tried different stuff but I can't figure out how to solve this.
I'm running eclipse in macOS Catalina.
Thanks!
My situation
Set your datapath correctly.
Your location D:/Tess4J/tessdata/eng.traineddata is wrong

Pharo on RaspberryPi: Module not found at startup

I am on a raspbian stretch system with the spur32 VM for ARM and a Pharo 7 image. At Startup I always get an exception: Error - Module not found.
It seems to have to do with lgitlibrary. I really cannot figure out what this error is about.
Any ideas?
Thanks,
Henrik
I see. If you check #unixModuleName
unixModuleName
| pluginDir |
pluginDir := Smalltalk vm binary parent.
#('libgit2.so' 'libgit2.so.0')
detect: [ :each | (pluginDir / each) exists ]
ifFound: [ :libName | ^ libName ].
self error: 'Module not found.'
Here you have your error message: self error: 'Module not found.'
You probably have libgit2.so or libgit2.so.0 missing (or dependencies). You may suffer with similar problem as me: Getting error when adding OSSubprocess to my Pharo 6.1 on Centos 7.4x.
You should check the dependencies with ldd (check my question for details).
Edit Adding information due to comment:
I have yet to use IceBerg (the Pharo's git integration). My guess, would be to "(re-)initialize it": (Smalltalk at: #LGitLibrary) initialize.
For more information, I recommend reading these: pharo's iceberg and some Pharo project that uses git like pharo-contributor and checking blog pharoweekly (for some information about the pharo-contributor) - https://pharoweekly.wordpress.com/2018/04/24/pharo-contributor-to-contribute-to-pharo.
You may want to use some guide "How to use git and github with Pharo". Which was done by Peter Uhnak (you can find him on SO).
I had the similar problem and I needed to build libgit2 library from source using this instructions. The basic build didn't work because Pharo wasn't able to initialize the library. I compiled it again with parameter -DSTDCALL=ON an it works.

How to remedy error caused by guava: Program type already present: com.google.common.util.concurrent.internal.InternalFutures

An AAR library already uses com.google.guava.
If an app includes the following in its build.gradle:
api 'com.google.guava:guava:27.0-android'
Building the app generates the following error:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: ...
Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
Program type already present: com.google.common.util.concurrent.internal.InternalFutures
If I do not include "api 'com.google.guava:guava:27.0-android'", the app can be built, but it has runtime error of java.lang.NoClassDefFoundError when it reaches the point of using the Guava method: Iterables.find
I had to update to version 27.0.1, at the time of writing they still haven't updated the README with this new version.
implementation 'com.google.guava:guava:27.0.1-android'
Since Guava 27.0, ListenableFuture is located in separate artifact, see the announcement. You can try two things (one at a time):
Exclude "listenablefuture" module (group "com.google.guava") and build your project again.
I don't know the AAR specifics, but it could be that 27.0-android doesn't work with AAR, so you should try 26.0-android instead.

Error Mapping Shared Libraries with Eclipse CDT and GDB

I'm trying to debug a program using a Ubuntu 12.04 host and an ARM client with Eclipse Kepler, CDT, and GDB. The host is running GDB 7.4 and the client 7.0.1.
In my .gdbinit file I set sysroot /usr/local/arm-none-gnueabi/arm-none-linux-gnueabi/
However, when I try to debug I get the following error:
Warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.
The target endianness is set automatically (currently little endian)
Error while mapping shared library sections:
/usr//lib/libstdc++.so.6: No such file or directory.
Error while mapping shared library sections:
/lib/libm.so.6: No such file or directory.
Warning: .dynamic section for "/usr/local/arm-none-linux-gnueabi/arm-none-linux-gnueabi/lib/libgcc_s.so.1" is not at the expected address (wrong library or version mismatch?)
Error while mapping shared library sections:
/lib/libc.so.6: No such file or directyory.
Error while mapping shared library sections:
/lib/ld-linux.so.3: No such file or directory.
I've searched this problem to death and can't seem to resolve it. Any answers would be most appreciated!

Running SimpleOpenNI and leJOS in same project

We have a project in which we want to control a Lego Mindstorms robot with the Microsoft Kinect sensor. We decided to use SimpleOpenNI with Processing to read the sensor and leJOS to control the robot for a simple reason: since both is in Java, we can specifiy a kind of RoboHandler and call its methods from the sensor reading class.
In order to achieve that, we downloaded the leJOS plugin for eclipse, created a new leJOS NXT project and put the processing and SimpleOpenNI libraries in the build path. Note that to use SimpleOpenNI, it is required an old processing version without Java.
Now the problem is, that when installing leJOS, it strictly requires a 32-bit Java JDK, so I had to download this and point to it at installation.
At this point, following build paths are in the project:
LeJOS NXT Runtime (which has among others java.awt classes)
core.jar (used to run Processing in eclipse)
SimpleOpenNI.jar
Having all this, and setting up a first Processing sketch like
import processing.core.*;
public class Test extends PApplet{
(....)
}
results in following error code:
Multiple markers at this line
- The type java.awt.event.MouseMotionListener cannot be resolved. It is indirectly referenced from
required .class files
- The type java.applet.Applet cannot be resolved. It is indirectly referenced from required .class files
- The type java.awt.event.MouseListener cannot be resolved. It is indirectly referenced from required .class files
- The hierarchy of the type FirstTry is inconsistent
- The type java.awt.event.FocusListener cannot be resolved. It is indirectly referenced from required .class files
- The type java.awt.event.KeyListener cannot be resolved. It is indirectly referenced from required .class files
When I downloaded the Processing without Java version, I wasn't able to choose from 32bit- or 64bit version. The SimpleOpenNI is installed as 64bit-version.
When adding the 64bit-JDK (eclipse workspace default) as workspace too, the error disappears, but when trying to run a sketch, following error gets printed in the console:
Invalid layout of java.lang.Thread at name
#
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (javaClasses.cpp:128), pid=9176, tid=8740
# fatal error: Invalid layout of preloaded class
#
# JRE version: 7.0_04-b22
# Java VM: Java HotSpot(TM) 64-Bit Server VM (23.0-b21 mixed mode windows-amd64 compressed oops)
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# C:\Users\Valentino\Desktop\workspaces\workspace_processing\RoboZeugs\bin\hs_err_pid9176.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.sun.com/bugreport/crash.jsp
#
So in my oppinion there is a problem with the JDK versions (32 and 64 bit), but there must be a way to handle this. Has anyone experience on this specific topic, maybe even with Kinect -> Mindstorms? Can anybody tell me what this error exactly means?
You're mixing classes that are designed to run with the JVM on the NXT brick (i.e. everything in classes.jar) with classes that are designed to run with a fully fledged JVM on the PC.
Don't do that. If you want to remote control an NXT, use pccomms.jar and everything else in lib/pc. But never add classes.jar or anything else in lib/nxt to the classpath when you're starting a Java program on your PC.
The error message about java.lang.Thread is probably due to the fact, that java.lang.Thread in classes.jar in by no means compatible with java.lang.Thread that comes with the JVM on your PC.