Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » 4DIAC - Framework for Distributed Industrial Automation and Control » Problems to compile FORTE+Modbus
Problems to compile FORTE+Modbus [message #1816300] Fri, 25 October 2019 15:24 Go to next message
herbert leitão is currently offline herbert leitãoFriend
Messages: 1
Registered: October 2019
Junior Member
Hello 4diac Team,

I have tried to compile FORTE+Modbus from forte-incubation_1.11.0 but the process stops and the log shows 2 errors (see log.txt attached).

Best Regards,

Herbert Leitão
  • Attachment: log.txt
    (Size: 16.31KB, Downloaded 13 times)
Re: Problems to compile FORTE+Modbus [message #1816471 is a reply to message #1816300] Tue, 29 October 2019 19:13 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 932
Registered: January 2014
Senior Member
Hi,

I haven't used modbus in a very long time. We are also working on replacing this implemetnation with a new one. Please see our gerrit [1] for the first patches. Regarding your problem have you seen the comment in the old issue tracker [2]?

[1] https://git.eclipse.org/r/#/q/status%3Aopen+project%3A4diac/org.eclipse.4diac.forte
[2] https://sourceforge.net/p/fordiac/issues/1081/
Re: Problems to compile FORTE+Modbus [message #1817295 is a reply to message #1816300] Wed, 20 November 2019 05:07 Go to previous messageGo to next message
jagadish kavalath is currently offline jagadish kavalathFriend
Messages: 2
Registered: November 2019
Junior Member
Hi ,

I am facing build errors with modbus enabled in FORTE. Please help if there is any update on this issue


=======================================================================
[ 95%] Building CXX object src/CMakeFiles/FORTE_LITE.dir/modules/modbus/modbuslayer.cpp.o
In file included from /home/user/4diac/forte/src/modules/modbus/modbusclientconnection.h:16:0,
from /home/user/4diac/forte/src/modules/modbus/modbuslayer.cpp:14:
/home/user/4diac/forte/src/modules/modbus/modbustimedevent.h:45:16: error: field 'm_oStartTime' has incomplete type 'SForteTime'
SForteTime m_oStartTime;
^~~~~~~~~~~~
In file included from /home/user/4diac/forte/src/core/../arch/../core/extevhan.h:17:0,
from /home/user/4diac/forte/src/core/../arch/timerha.h:17,
from /home/user/4diac/forte/src/core/monitoring.h:22,
from /home/user/4diac/forte/src/core/utils/../resource.h:21,
from /home/user/4diac/forte/src/core/utils/../device.h:16,
from /home/user/4diac/forte/src/core/utils/extevhandlerhelper.h:17,
from /home/user/4diac/forte/src/core/cominfra/comlayer.h:21,
from /home/user/4diac/forte/src/modules/modbus/modbuslayer.h:16,
from /home/user/4diac/forte/src/modules/modbus/modbuslayer.cpp:12:
/home/user/4diac/forte/src/core/../arch/../core/devexec.h:19:8: note: forward declaration of 'struct SForteTime'
struct SForteTime;
^~~~~~~~~~
In file included from /home/user/4diac/forte/src/modules/modbus/modbusclientconnection.h:16:0,
from /home/user/4diac/forte/src/modules/modbus/modbuslayer.cpp:14:
/home/user/4diac/forte/src/modules/modbus/modbustimedevent.h:46:16: error: field 'm_oUpdateInterval' has incomplete type 'SForteTime'
SForteTime m_oUpdateInterval;
^~~~~~~~~~~~~~~~~
In file included from /home/user/4diac/forte/src/core/../arch/../core/extevhan.h:17:0,
from /home/user/4diac/forte/src/core/../arch/timerha.h:17,
from /home/user/4diac/forte/src/core/monitoring.h:22,
from /home/user/4diac/forte/src/core/utils/../resource.h:21,
from /home/user/4diac/forte/src/core/utils/../device.h:16,
from /home/user/4diac/forte/src/core/utils/extevhandlerhelper.h:17,
from /home/user/4diac/forte/src/core/cominfra/comlayer.h:21,
from /home/user/4diac/forte/src/modules/modbus/modbuslayer.h:16,
from /home/user/4diac/forte/src/modules/modbus/modbuslayer.cpp:12:
/home/user/4diac/forte/src/core/../arch/../core/devexec.h:19:8: note: forward declaration of 'struct SForteTime'
struct SForteTime;
^~~~~~~~~~
/home/user/4diac/forte/src/modules/modbus/modbuslayer.cpp: In member function 'unsigned int forte::com_infra::CModbusComLayer::convertDataInput(void*, unsigned int, TForteUInt16*)':
/home/user/4diac/forte/src/modules/modbus/modbuslayer.cpp:67:45: warning: conversion to 'unsigned int' from 'long unsigned int' may alter its value [-Wconversion]
outLength += sizeof(TForteUInt16) / 2;
^
/home/user/4diac/forte/src/modules/modbus/modbuslayer.cpp:73:44: warning: conversion to 'unsigned int' from 'long unsigned int' may alter its value [-Wconversion]
outLength += sizeof(TForteInt16) / 2;
^
/home/user/4diac/forte/src/modules/modbus/modbuslayer.cpp:79:45: warning: conversion to 'unsigned int' from 'long unsigned int' may alter its value [-Wconversion]
outLength += sizeof(TForteUInt16) / 2;
^
/home/user/4diac/forte/src/modules/modbus/modbuslayer.cpp:85:45: warning: conversion to 'unsigned int' from 'long unsigned int' may alter its value [-Wconversion]
outLength += sizeof(TForteUInt16) / 2;
^
/home/user/4diac/forte/src/modules/modbus/modbuslayer.cpp:92:44: warning: conversion to 'unsigned int' from 'long unsigned int' may alter its value [-Wconversion]
outLength += sizeof(TForteInt16) / 2;
^
/home/user/4diac/forte/src/modules/modbus/modbuslayer.cpp:98:45: warning: conversion to 'unsigned int' from 'long unsigned int' may alter its value [-Wconversion]
outLength += sizeof(TForteUInt16) / 2;
^
/home/user/4diac/forte/src/modules/modbus/modbuslayer.cpp:104:43: warning: conversion to 'unsigned int' from 'long unsigned int' may alter its value [-Wconversion]
outLength += sizeof(TForteWord) / 2;
^
/home/user/4diac/forte/src/modules/modbus/modbuslayer.cpp:111:44: warning: conversion to 'unsigned int' from 'long unsigned int' may alter its value [-Wconversion]
outLength += sizeof(TForteInt32) / 2;
^
/home/user/4diac/forte/src/modules/modbus/modbuslayer.cpp:117:45: warning: conversion to 'unsigned int' from 'long unsigned int' may alter its value [-Wconversion]
outLength += sizeof(TForteUInt32) / 2;
^
/home/user/4diac/forte/src/modules/modbus/modbuslayer.cpp:123:44: warning: conversion to 'unsigned int' from 'long unsigned int' may alter its value [-Wconversion]
outLength += sizeof(TForteDWord) / 2;
^
/home/user/4diac/forte/src/modules/modbus/modbuslayer.cpp:129:44: warning: conversion to 'unsigned int' from 'long unsigned int' may alter its value [-Wconversion]
outLength += sizeof(TForteFloat) / 2;
^
/home/user/4diac/forte/src/modules/modbus/modbuslayer.cpp:136:44: warning: conversion to 'unsigned int' from 'long unsigned int' may alter its value [-Wconversion]
outLength += sizeof(TForteInt64) / 2;
^
/home/user/4diac/forte/src/modules/modbus/modbuslayer.cpp:142:45: warning: conversion to 'unsigned int' from 'long unsigned int' may alter its value [-Wconversion]
outLength += sizeof(TForteUInt64) / 2;
^
/home/user/4diac/forte/src/modules/modbus/modbuslayer.cpp:148:44: warning: conversion to 'unsigned int' from 'long unsigned int' may alter its value [-Wconversion]
outLength += sizeof(TForteLWord) / 2;
^
/home/user/4diac/forte/src/modules/modbus/modbuslayer.cpp:154:45: warning: conversion to 'unsigned int' from 'long unsigned int' may alter its value [-Wconversion]
outLength += sizeof(TForteDFloat) / 2;
^
/home/user/4diac/forte/src/modules/modbus/modbuslayer.cpp: In member function 'virtual forte::com_infra::EComResponse forte::com_infra::CModbusComLayer::processInterrupt()':
/home/user/4diac/forte/src/modules/modbus/modbuslayer.cpp:177:39: warning: conversion to 'unsigned int' from 'long unsigned int' may alter its value [-Wconversion]
dataIndex += sizeof(bool);
^
/home/user/4diac/forte/src/modules/modbus/modbuslayer.cpp:181:45: warning: conversion to 'unsigned int' from 'long unsigned int' may alter its value [-Wconversion]
dataIndex += sizeof(TForteInt8);
^
/home/user/4diac/forte/src/modules/modbus/modbuslayer.cpp:185:46: warning: conversion to 'unsigned int' from 'long unsigned int' may alter its value [-Wconversion]
dataIndex += sizeof(TForteInt16);
^
/home/user/4diac/forte/src/modules/modbus/modbuslayer.cpp:189:46: warning: conversion to 'unsigned int' from 'long unsigned int' may alter its value [-Wconversion]
dataIndex += sizeof(TForteInt32);
^
/home/user/4diac/forte/src/modules/modbus/modbuslayer.cpp:193:46: warning: conversion to 'unsigned int' from 'long unsigned int' may alter its value [-Wconversion]
dataIndex += sizeof(TForteInt64);
^
/home/user/4diac/forte/src/modules/modbus/modbuslayer.cpp:197:46: warning: conversion to 'unsigned int' from 'long unsigned int' may alter its value [-Wconversion]
dataIndex += sizeof(TForteUInt8);
^
/home/user/4diac/forte/src/modules/modbus/modbuslayer.cpp:201:47: warning: conversion to 'unsigned int' from 'long unsigned int' may alter its value [-Wconversion]
dataIndex += sizeof(TForteUInt16);
^
/home/user/4diac/forte/src/modules/modbus/modbuslayer.cpp:205:47: warning: conversion to 'unsigned int' from 'long unsigned int' may alter its value [-Wconversion]
dataIndex += sizeof(TForteUInt32);
^
/home/user/4diac/forte/src/modules/modbus/modbuslayer.cpp:209:47: warning: conversion to 'unsigned int' from 'long unsigned int' may alter its value [-Wconversion]
dataIndex += sizeof(TForteUInt64);
^
/home/user/4diac/forte/src/modules/modbus/modbuslayer.cpp:213:45: warning: conversion to 'unsigned int' from 'long unsigned int' may alter its value [-Wconversion]
dataIndex += sizeof(TForteByte);
^
/home/user/4diac/forte/src/modules/modbus/modbuslayer.cpp:217:45: warning: conversion to 'unsigned int' from 'long unsigned int' may alter its value [-Wconversion]
dataIndex += sizeof(TForteWord);
^
/home/user/4diac/forte/src/modules/modbus/modbuslayer.cpp:221:46: warning: conversion to 'unsigned int' from 'long unsigned int' may alter its value [-Wconversion]
dataIndex += sizeof(TForteDWord);
^
/home/user/4diac/forte/src/modules/modbus/modbuslayer.cpp:225:46: warning: conversion to 'unsigned int' from 'long unsigned int' may alter its value [-Wconversion]
dataIndex += sizeof(TForteLWord);
^
/home/user/4diac/forte/src/modules/modbus/modbuslayer.cpp:229:46: warning: conversion to 'unsigned int' from 'long unsigned int' may alter its value [-Wconversion]
dataIndex += sizeof(TForteFloat);
^
/home/user/4diac/forte/src/modules/modbus/modbuslayer.cpp:233:47: warning: conversion to 'unsigned int' from 'long unsigned int' may alter its value [-Wconversion]
dataIndex += sizeof(TForteDFloat);
^
/home/user/4diac/forte/src/modules/modbus/modbuslayer.cpp: In member function 'virtual forte::com_infra::EComResponse forte::com_infra::CModbusComLayer::openConnection(char*)':
/home/user/4diac/forte/src/modules/modbus/modbuslayer.cpp:363:92: error: no matching function for call to 'CModbusClientConnection::CModbusClientConnection(CModbusHandler&)'
m_pModbusConnection = new CModbusClientConnection(getExtEvHandler<CModbusHandler>());
^
In file included from /home/user/4diac/forte/src/modules/modbus/modbuslayer.cpp:14:0:
/home/user/4diac/forte/src/modules/modbus/modbusclientconnection.h:35:14: note: candidate: CModbusClientConnection::CModbusClientConnection(CModbusHandler*)
explicit CModbusClientConnection(CModbusHandler* pa_modbusHandler);
^~~~~~~~~~~~~~~~~~~~~~~
/home/user/4diac/forte/src/modules/modbus/modbusclientconnection.h:35:14: note: no known conversion for argument 1 from 'CModbusHandler' to 'CModbusHandler*'
/home/user/4diac/forte/src/modules/modbus/modbuslayer.cpp:382:95: warning: conversion to 'TForteUInt32 {aka unsigned int}' from 'long int' may alter its value [-Wconversion]
static_cast<CModbusClientConnection*>(m_pModbusConnection)->addNewPoll(commonParams.m_nPollFrequency, commonParams.m_nFuncCode, commonParams.m_nReadStartAddress[i], commonParams.m_nReadNrAddresses[i]);
~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
/home/user/4diac/forte/src/modules/modbus/modbuslayer.cpp: In member function 'int forte::com_infra::CModbusComLayer::processClientParams(char*, forte::com_infra::CModbusComLayer::STcpParams*, forte::com_infra::CModbusComLayer::SRtuParams*, forte::com_infra::CModbusComLayer::SCommonParams*)':
/home/user/4diac/forte/src/modules/modbus/modbuslayer.cpp:566:24: warning: conversion to 'int' from 'size_t {aka long unsigned int}' may alter its value [-Wconversion]
int paramLen = strlen(readAddresses);
~~~~~~^~~~~~~~~~~~~~~
/home/user/4diac/forte/src/modules/modbus/modbuslayer.cpp:589:20: warning: conversion to 'int' from 'size_t {aka long unsigned int}' may alter its value [-Wconversion]
paramLen = strlen(writeAddresses);
~~~~~~^~~~~~~~~~~~~~~~
/home/user/4diac/forte/src/modules/modbus/modbuslayer.cpp: In member function 'int forte::com_infra::CModbusComLayer::findNextStartAddress(const char*, int)':
/home/user/4diac/forte/src/modules/modbus/modbuslayer.cpp:647:25: warning: conversion to 'int' from 'size_t {aka long unsigned int}' may alter its value [-Wconversion]
int strLength = strlen(&pa_acParam[pa_nStartIndex]);
~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/user/4diac/forte/src/modules/modbus/modbuslayer.cpp:652:35: warning: conversion to 'int' from 'long int' may alter its value [-Wconversion]
return pch - &pa_acParam[0] + 1;
~~~~~~~~~~~~~~~~~~~~~^~~
/home/user/4diac/forte/src/modules/modbus/modbuslayer.cpp: In member function 'int forte::com_infra::CModbusComLayer::findNextStopAddress(const char*, int)':
/home/user/4diac/forte/src/modules/modbus/modbuslayer.cpp:661:25: warning: conversion to 'int' from 'size_t {aka long unsigned int}' may alter its value [-Wconversion]
int strLength = strlen(&pa_acParam[pa_nStartIndex]);
~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/user/4diac/forte/src/modules/modbus/modbuslayer.cpp:667:38: warning: conversion to 'int' from 'long int' may alter its value [-Wconversion]
return pchDot - &pa_acParam[0] + 2;
~~~~~~~~~~~~~~~~~~~~~~~~^~~
/home/user/4diac/forte/src/modules/modbus/modbuslayer.cpp:671:38: warning: conversion to 'int' from 'long int' may alter its value [-Wconversion]
return pchDot - &pa_acParam[0] + 2;
~~~~~~~~~~~~~~~~~~~~~~~~^~~
src/CMakeFiles/FORTE_LITE.dir/build.make:11390: recipe for target 'src/CMakeFiles/FORTE_LITE.dir/modules/modbus/modbuslayer.cpp.o' failed
make[2]: *** [src/CMakeFiles/FORTE_LITE.dir/modules/modbus/modbuslayer.cpp.o] Error 1
CMakeFiles/Makefile2:177: recipe for target 'src/CMakeFiles/FORTE_LITE.dir/all' failed
make[1]: *** [src/CMakeFiles/FORTE_LITE.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
user@user-OptiPlex-3050:~/4diac/forte/bin/posix$
Re: Problems to compile FORTE+Modbus [message #1818052 is a reply to message #1817295] Wed, 04 December 2019 20:34 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 932
Registered: January 2014
Senior Member
It looks like that the modbus module has not been used in a long time. I also think that with one of the next release we will remove this implementation and replace it with the new one which currently sits in Gerrit [1]. Unfortunately I havent found time to do all the paper work and review needed. Also there exist an example based on the new modbus module showing how it can be used to access Festo drives via modbus with the new modular IO concept [2].

[1] https://git.eclipse.org/r/139743
[2] https://git.eclipse.org/r/139744
Re: Problems to compile FORTE+Modbus [message #1818066 is a reply to message #1818052] Thu, 05 December 2019 05:44 Go to previous messageGo to next message
jagadish kavalath is currently offline jagadish kavalathFriend
Messages: 2
Registered: November 2019
Junior Member
Hi Alois Zoitl,

I have tried to apply the patch and build, Looks like there are build issues in modbus-ng.

Applied the following patches on the head branch and enabled FORTE_IO_MODBUS.

[1] git fetch https://git.eclipse.org/r/4diac/org.eclipse.4diac.forte refs/changes/43/139743/3 && git checkout FETCH_HEAD
[2] git fetch https://git.eclipse.org/r/4diac/org.eclipse.4diac.forte refs/changes/44/139744/2 && git checkout FETCH_HEAD

======================================
[ 61%] Building CXX object src/CMakeFiles/FORTE_LITE.dir/modules/modbus-ng/slave/slave.cpp.o
cd /home/user/4diac/forte-patch3/forte/bin/posix/src && /usr/bin/c++ -DFORTE_COMPILATION -DFORTE_ENABLE_GENERATED_SOURCE_CPP -DFORTE_SUPPORT_ARRAYS -DFORTE_SUPPORT_BOOT_FILE -DFORTE_SUPPORT_CUSTOM_SERIALIZABLE_DATATYPES -DFORTE_SUPPORT_MONITORING -DFORTE_SUPPORT_QUERY_CMD -DFORTE_UNICODE_SUPPORT -DFORTE_USE_64BIT_DATATYPES -DFORTE_USE_LREAL_DATATYPE -DFORTE_USE_REAL_DATATYPE -DFORTE_USE_WSTRING_DATATYPE -DLOGDEBUG -I/home/user/4diac/forte-patch3/forte/bin/posix/src_gen -I/home/user/4diac/forte-patch3/forte/bin/posix -I/home/user/4diac/forte-patch3/forte/src/. -I/home/user/4diac/forte-patch3/forte/src/stdfblib/events -I/home/user/4diac/forte-patch3/forte/src/stdfblib -I/home/user/4diac/forte-patch3/forte/src/modules/opc_ua -I/home/user/4diac/forte-patch3/forte/src/modules/modbus-ng -I/home/user/4diac/forte-patch3/forte/src/modules/mqtt_paho -I/home/user/4diac/forte-patch3/forte/src/core/utils -I/home/user/4diac/forte-patch3/forte/src/core/datatypes -I/home/user/4diac/forte-patch3/forte/src/core/cominfra -I/home/user/4diac/forte-patch3/forte/src/core -I/home/user/4diac/forte-patch3/forte/src/arch/posix -I/home/user/4diac/forte-patch3/forte/src/arch -g -W -Wall -Wextra -Woverloaded-virtual -Wconversion -Wshadow -DFORTE_LITTLE_ENDIAN -fno-rtti -fno-exceptions -std=c++11 -o CMakeFiles/FORTE_LITE.dir/modules/modbus-ng/slave/slave.cpp.o -c /home/user/4diac/forte-patch3/forte/src/modules/modbus-ng/slave/slave.cpp
/home/user/4diac/forte-patch3/forte/src/modules/modbus-ng/slave/slave.cpp:15:30: fatal error: processinterface.h: No such file or directory
#include "processinterface.h"
^
compilation terminated.
src/CMakeFiles/FORTE_LITE.dir/build.make:2681: recipe for target 'src/CMakeFiles/FORTE_LITE.dir/modules/modbus-ng/slave/slave.cpp.o' failed
make[2]: *** [src/CMakeFiles/FORTE_LITE.dir/modules/modbus-ng/slave/slave.cpp.o] Error 1
make[2]: Leaving directory '/home/user/4diac/forte-patch3/forte/bin/posix'
CMakeFiles/Makefile2:181: recipe for target 'src/CMakeFiles/FORTE_LITE.dir/all' failed
make[1]: *** [src/CMakeFiles/FORTE_LITE.dir/all] Error 2
make[1]: Leaving directory '/home/user/4diac/forte-patch3/forte/bin/posix'
Makefile:130: recipe for target 'all' failed
make: *** [all] Error 2
===================================================================

Is there something I am missing?

Thanks
Re: Problems to compile FORTE+Modbus [message #1818609 is a reply to message #1818066] Fri, 20 December 2019 14:11 Go to previous messageGo to next message
joy woo is currently offline joy wooFriend
Messages: 79
Registered: May 2019
Member
I have the same problem as yours
Re: Problems to compile FORTE+Modbus [message #1818642 is a reply to message #1818609] Sat, 21 December 2019 11:56 Go to previous messageGo to next message
joy woo is currently offline joy wooFriend
Messages: 79
Registered: May 2019
Member
I fixed it by setting FORTE_IO enabled
Re: Problems to compile FORTE+Modbus [message #1818656 is a reply to message #1818642] Sun, 22 December 2019 08:47 Go to previous messageGo to next message
joy woo is currently offline joy wooFriend
Messages: 79
Registered: May 2019
Member
but we can't find the FBs of ModuleBus, and ModuleBusAdapter
Re: Problems to compile FORTE+Modbus [message #1818714 is a reply to message #1818656] Tue, 24 December 2019 11:55 Go to previous message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 932
Registered: January 2014
Senior Member
Thanks for the hint. I'll try to fix that in the cmake setup for modbus_ng in the near future. As this is work in progress and an early stage I fear we don't have that fbs yet. However with the information given in the cpp files you can reconsruct the FBs and adapters for 4diac IDE as SIFB rather easily.
Previous Topic:custom UDP messages
Next Topic:Raspberry forte 's debugging problem
Goto Forum:
  


Current Time: Sun Jan 26 12:49:58 GMT 2020

Powered by FUDForum. Page generated in 0.02114 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top