Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt for plc
QtWS25 Last Chance

Qt for plc

Scheduled Pinned Locked Moved Unsolved General and Desktop
qt creatorsiemenswpf
13 Posts 5 Posters 12.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    markolino
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      How are you communicating currently with your PLC ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      M 1 Reply Last reply
      1
      • SGaistS SGaist

        Hi and welcome to devnet,

        How are you communicating currently with your PLC ?

        M Offline
        M Offline
        markolino
        wrote on last edited by
        #3

        @SGaist
        Hi thanks for the answer. Usually I communicate with my plc with a Windows form app using s7.net librery. All by profinet connection

        1 Reply Last reply
        0
        • VRoninV Offline
          VRoninV Offline
          VRonin
          wrote on last edited by
          #4

          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

          "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
          ~Napoleon Bonaparte

          On a crusade to banish setIndexWidget() from the holy land of Qt

          1 Reply Last reply
          4
          • kahlenbergK Offline
            kahlenbergK Offline
            kahlenberg
            wrote on last edited by
            #5

            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/

            Z 2 Replies Last reply
            3
            • kahlenbergK kahlenberg

              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/

              Z Offline
              Z Offline
              Zelas91
              wrote on last edited by
              #6
              This post is deleted!
              1 Reply Last reply
              0
              • kahlenbergK kahlenberg

                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/

                Z Offline
                Z Offline
                Zelas91
                wrote on last edited by
                #7

                @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?

                1 Reply Last reply
                0
                • VRoninV Offline
                  VRoninV Offline
                  VRonin
                  wrote on last edited by
                  #8

                  http://doc.qt.io/qtcreator/creator-project-qmake-libraries.html
                  http://doc.qt.io/qt-5/third-party-libraries.html

                  "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
                  ~Napoleon Bonaparte

                  On a crusade to banish setIndexWidget() from the holy land of Qt

                  Z 1 Reply Last reply
                  3
                  • VRoninV VRonin

                    http://doc.qt.io/qtcreator/creator-project-qmake-libraries.html
                    http://doc.qt.io/qt-5/third-party-libraries.html

                    Z Offline
                    Z Offline
                    Zelas91
                    wrote on last edited by
                    #9

                    @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.html

                    this is understandable, but I asked about the compilation of the library, since my compiled library does not work

                    VRoninV 1 Reply Last reply
                    0
                    • Z Zelas91

                      @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.html

                      this is understandable, but I asked about the compilation of the library, since my compiled library does not work

                      VRoninV Offline
                      VRoninV Offline
                      VRonin
                      wrote on last edited by
                      #10

                      @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.

                      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
                      ~Napoleon Bonaparte

                      On a crusade to banish setIndexWidget() from the holy land of Qt

                      Z 1 Reply Last reply
                      1
                      • VRoninV VRonin

                        @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.

                        Z Offline
                        Z Offline
                        Zelas91
                        wrote on last edited by
                        #11

                        @VRonin
                        did everything according to the instructions for the library but when compiling it turns out 3 files * .def, * .lib, * .dll

                        1 Reply Last reply
                        0
                        • VRoninV Offline
                          VRoninV Offline
                          VRonin
                          wrote on last edited by VRonin
                          #12

                          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 the INCLUDEPATH += part of the links above)

                          "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
                          ~Napoleon Bonaparte

                          On a crusade to banish setIndexWidget() from the holy land of Qt

                          Z 1 Reply Last reply
                          6
                          • VRoninV VRonin

                            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 the INCLUDEPATH += part of the links above)

                            Z Offline
                            Z Offline
                            Zelas91
                            wrote on last edited by
                            #13

                            @VRonin
                            Thanks, I will try

                            1 Reply Last reply
                            0

                            • Login

                            • Login or register to search.
                            • First post
                              Last post
                            0
                            • Categories
                            • Recent
                            • Tags
                            • Popular
                            • Users
                            • Groups
                            • Search
                            • Get Qt Extensions
                            • Unsolved