Qt for plc
-
Qt for plc communication
Hi i'm Mark and i'm writing from italy.
Usually i use visual studio to create desktop application that communicate with plc siemens, read and write data to them and set event in my gui by data from plc.
But i ma fascinated from qt. I've need to know if with qt and c++ is possibile to do the same, ora is better to use wpf. -
Hi and welcome to devnet,
How are you communicating currently with your PLC ?
-
S7 offers a C API (https://cache.industry.siemens.com/dl/files/203/13649203/att_38732/v1/mn_s7api_e.pdf) you can use that to communicate with the PLC
-
Hi,
I am exactly doing what you wanto to do. Qt doesn't have any possibility for the communication to PLC, by nature. However I communicate with PLC using SNAP7 library. This library is only for Siemens S7 PLCs, and it is really great and you can find pre-compilerd binaries as well, if you don't want to compile yourself. I downloaded and compiled source code and am using this library for reading and writing variables in PLC. You can easily integrate it in your Qt application.
SNAP7 source: http://snap7.sourceforge.net/ -
This post is deleted!
-
@kahlenberg said in Qt for plc:
Hi,
I am exactly doing what you wanto to do. Qt doesn't have any possibility for the communication to PLC, by nature. However I communicate with PLC using SNAP7 library. This library is only for Siemens S7 PLCs, and it is really great and you can find pre-compilerd binaries as well, if you don't want to compile yourself. I downloaded and compiled source code and am using this library for reading and writing variables in PLC. You can easily integrate it in your Qt application.
SNAP7 source: http://snap7.sourceforge.net/How did you do it for qtcreator?
-
@VRonin said in Qt for plc:
http://doc.qt.io/qtcreator/creator-project-qmake-libraries.html
http://doc.qt.io/qt-5/third-party-libraries.htmlthis is understandable, but I asked about the compilation of the library, since my compiled library does not work
-
@Zelas91 said in Qt for plc:
but I asked about the compilation of the library
Then this is the wrong place to ask. Try asking on the project page, they should have instructions on how to build
since my compiled library does not work
How does not work? it probably is due to incompatible compilers.
-
That's correct, the .dll is the compiled binary, the .lib is the library your linker will need (the
LIBS +=
part of the links above)The .def should not be necessary, it's a module definition file that only works with Microsoft compilers (as far as I'm aware) and is an alternative to the
_declspec( dllimport )
/__declspec( dllexport )
directives.You'll also need the .h files (or those in the
includes
folder) from the sources (this is theINCLUDEPATH +=
part of the links above)