Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. How can I transfer the Qt Signal Data to 3rd party Software Such as Labview?
QtWS25 Last Chance

How can I transfer the Qt Signal Data to 3rd party Software Such as Labview?

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
labviewdllqt 5.6.3c++signals & slots
17 Posts 5 Posters 3.4k 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.
  • Y Offline
    Y Offline
    Yash001
    wrote on 4 Dec 2018, 18:27 last edited by
    #1

    what is good way to transfer the Data to other Application from Qt. My application is Created in Qt. I am gone use the Qt dll in Labview Application. Qt dll is generate the datasignal. I would like to connect that data siganl to Labview Application.

    I may transfer the Data Signal value outside Qt-application through TCP/IP. or Is it better way to transfer data from Qt application to Labview Application GUI?

    Thank you

    J 1 Reply Last reply 5 Dec 2018, 04:59
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 4 Dec 2018, 18:31 last edited by
      #2

      Hi,

      Did you already check what Labview provides for interoperability ?

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

      Y 1 Reply Last reply 4 Dec 2018, 19:26
      0
      • D Offline
        D Offline
        dheerendra
        Qt Champions 2022
        wrote on 4 Dec 2018, 18:31 last edited by
        #3

        Signal/Slot is understood only by the Qt app. You are loading the your dll built using Qt in LabView app. You have no option other directly calling method in dll and get some return values from methods in dll.

        Dheerendra
        @Community Service
        Certified Qt Specialist
        http://www.pthinks.com

        Y 1 Reply Last reply 4 Dec 2018, 19:31
        2
        • S SGaist
          4 Dec 2018, 18:31

          Hi,

          Did you already check what Labview provides for interoperability ?

          Y Offline
          Y Offline
          Yash001
          wrote on 4 Dec 2018, 19:26 last edited by
          #4

          @SGaist Currently I am doing research on Lab view Side also. I found the common way to in between Qt and Lab view is Server Client (TCP/IP). But I am not sure It will work or not.

          Here the documents which is provide for making communication through other software in labview.
          http://www.ni.com/tutorial/10060/en/

          Here I describe My idea
          0_1543951463475_d7404e13-3d0c-4c7c-8e03-a56b7f141adc-image.png

          Any other good suggestion always Appreciable.

          1 Reply Last reply
          0
          • D dheerendra
            4 Dec 2018, 18:31

            Signal/Slot is understood only by the Qt app. You are loading the your dll built using Qt in LabView app. You have no option other directly calling method in dll and get some return values from methods in dll.

            Y Offline
            Y Offline
            Yash001
            wrote on 4 Dec 2018, 19:31 last edited by
            #5

            @dheerendra Yes, If I need some return Value in labview then I need to call the some function through CLF (Lab view Functionality) in Labview. It may missing some data because of Signal is Generated in Qt.

            1 Reply Last reply
            0
            • D Offline
              D Offline
              dheerendra
              Qt Champions 2022
              wrote on 4 Dec 2018, 19:35 last edited by
              #6

              Ok. If LabView provide the way to integrate the Qt Applicaiton library you can directly integrate and use it. If this is not possible then,
              If LabView provides a way for you to write TCP/IP connection, then you connect to Qt App using TCP/IP. Both the side you can have TCP/IP based sockets and start transferring the data.

              I'm not sure what kind of code you can write in a LabView.
              NO signals/slots across the process.

              Dheerendra
              @Community Service
              Certified Qt Specialist
              http://www.pthinks.com

              Y 1 Reply Last reply 4 Dec 2018, 19:55
              2
              • D dheerendra
                4 Dec 2018, 19:35

                Ok. If LabView provide the way to integrate the Qt Applicaiton library you can directly integrate and use it. If this is not possible then,
                If LabView provides a way for you to write TCP/IP connection, then you connect to Qt App using TCP/IP. Both the side you can have TCP/IP based sockets and start transferring the data.

                I'm not sure what kind of code you can write in a LabView.
                NO signals/slots across the process.

                Y Offline
                Y Offline
                Yash001
                wrote on 4 Dec 2018, 19:55 last edited by
                #7

                @dheerendra Let me try. Thank you for Direction.

                1 Reply Last reply
                0
                • Y Yash001
                  4 Dec 2018, 18:27

                  what is good way to transfer the Data to other Application from Qt. My application is Created in Qt. I am gone use the Qt dll in Labview Application. Qt dll is generate the datasignal. I would like to connect that data siganl to Labview Application.

                  I may transfer the Data Signal value outside Qt-application through TCP/IP. or Is it better way to transfer data from Qt application to Labview Application GUI?

                  Thank you

                  J Offline
                  J Offline
                  JKSH
                  Moderators
                  wrote on 5 Dec 2018, 04:59 last edited by
                  #8

                  @Yash001 said in How can I transfer the Qt Signal Data to 3rd party Software Such as Labview?:

                  what is good way to transfer the Data to other Application from Qt... Qt dll is generate the datasignal. I would like to connect that data siganl to Labview Application.

                  What type of data is it? How fast is the data being generated?

                  My application is Created in Qt. I am gone use the Qt dll in Labview Application.

                  ...

                  I need to call the some function through CLF

                  "CLF" is Call Library Function node. You can only use CLF on a Qt library (.dll); you cannot use CLF on a Qt application (.exe).

                  I may transfer the Data Signal value outside Qt-application through TCP/IP. or Is it better way to transfer data from Qt application to Labview Application GUI?

                  Choose either TCP/IP or CLF. Don't mix both.

                  For beginners, it is much easier to use TCP/IP than CLF.

                  With TCP/IP, you can create a regular Qt application (.exe) and communicate with LabVIEW. You don't need to use CLF to transfer anything -- just use a fixed TCP port.

                  Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                  Y 1 Reply Last reply 6 Dec 2018, 19:28
                  3
                  • J JKSH
                    5 Dec 2018, 04:59

                    @Yash001 said in How can I transfer the Qt Signal Data to 3rd party Software Such as Labview?:

                    what is good way to transfer the Data to other Application from Qt... Qt dll is generate the datasignal. I would like to connect that data siganl to Labview Application.

                    What type of data is it? How fast is the data being generated?

                    My application is Created in Qt. I am gone use the Qt dll in Labview Application.

                    ...

                    I need to call the some function through CLF

                    "CLF" is Call Library Function node. You can only use CLF on a Qt library (.dll); you cannot use CLF on a Qt application (.exe).

                    I may transfer the Data Signal value outside Qt-application through TCP/IP. or Is it better way to transfer data from Qt application to Labview Application GUI?

                    Choose either TCP/IP or CLF. Don't mix both.

                    For beginners, it is much easier to use TCP/IP than CLF.

                    With TCP/IP, you can create a regular Qt application (.exe) and communicate with LabVIEW. You don't need to use CLF to transfer anything -- just use a fixed TCP port.

                    Y Offline
                    Y Offline
                    Yash001
                    wrote on 6 Dec 2018, 19:28 last edited by Yash001 12 Jun 2018, 22:08
                    #9

                    @JKSH Thank you so much for exact information . I know CLF is only used for calling Library (.dll).

                    " What type of data is it? How fast is the data being generated? "

                    data is received in Qt dll through COM port. After that, i am doing manipulation on received data, and generate few readable value (double) (10 - 15 value). I wanted to represent readable value on Labview GUI.

                    I am receiving data through COM port on bud-rate 57600.

                    #include "Config.h"
                    
                    qint32 DefaultSerialPortSettings::Baudrate() {
                    	return QSerialPort::Baud57600;
                    }
                    QSerialPort::DataBits DefaultSerialPortSettings::DataBits() {
                    	return QSerialPort::Data8;
                    }
                    QSerialPort::FlowControl DefaultSerialPortSettings::FlowControl() {
                    	return QSerialPort::NoFlowControl;
                    }
                    QSerialPort::Parity DefaultSerialPortSettings::Parity() {
                    	return QSerialPort::NoParity;
                    }
                    QSerialPort::StopBits DefaultSerialPortSettings::StopBits() {
                    	return QSerialPort::OneStop;
                    }
                    
                    J 1 Reply Last reply 6 Dec 2018, 19:42
                    0
                    • Y Yash001
                      6 Dec 2018, 19:28

                      @JKSH Thank you so much for exact information . I know CLF is only used for calling Library (.dll).

                      " What type of data is it? How fast is the data being generated? "

                      data is received in Qt dll through COM port. After that, i am doing manipulation on received data, and generate few readable value (double) (10 - 15 value). I wanted to represent readable value on Labview GUI.

                      I am receiving data through COM port on bud-rate 57600.

                      #include "Config.h"
                      
                      qint32 DefaultSerialPortSettings::Baudrate() {
                      	return QSerialPort::Baud57600;
                      }
                      QSerialPort::DataBits DefaultSerialPortSettings::DataBits() {
                      	return QSerialPort::Data8;
                      }
                      QSerialPort::FlowControl DefaultSerialPortSettings::FlowControl() {
                      	return QSerialPort::NoFlowControl;
                      }
                      QSerialPort::Parity DefaultSerialPortSettings::Parity() {
                      	return QSerialPort::NoParity;
                      }
                      QSerialPort::StopBits DefaultSerialPortSettings::StopBits() {
                      	return QSerialPort::OneStop;
                      }
                      
                      J Offline
                      J Offline
                      JonB
                      wrote on 6 Dec 2018, 19:42 last edited by JonB 12 Jun 2018, 19:43
                      #10

                      @Yash001
                      I don't get it. You say your "application" will be a DLL file, and it will be included into a LabVIEW application. So where is any TCP/IP going to be? That's for communicating with another process.

                      If you're really producing a DLL which is directly accessible from a LabVIEW app, you'll just be in @dheerendra 's situation:

                      You have no option other directly calling method in dll and get some return values from methods in dll.

                      Y 1 Reply Last reply 6 Dec 2018, 20:45
                      0
                      • J JonB
                        6 Dec 2018, 19:42

                        @Yash001
                        I don't get it. You say your "application" will be a DLL file, and it will be included into a LabVIEW application. So where is any TCP/IP going to be? That's for communicating with another process.

                        If you're really producing a DLL which is directly accessible from a LabVIEW app, you'll just be in @dheerendra 's situation:

                        You have no option other directly calling method in dll and get some return values from methods in dll.

                        Y Offline
                        Y Offline
                        Yash001
                        wrote on 6 Dec 2018, 20:45 last edited by Yash001 12 Jun 2018, 21:05
                        #11

                        @JonB

                        Current Our GUI

                        Currently, I have application, which is created in Qt and C++. I am creating my application by just create the Object of Mainwidnow Class in main() function.

                        constructor of Mainwindow class is handle the remaining things. Such as create the serial thread, start Serial thread, create the GUI, connecting signals and slots, etc. Basically you can say it is initialized State.

                        on closing of Application, ~Mainwidnow() will release all the resource, and stop serial thread.

                        whenever the device is connected on COM port that time it is detected on serial thread and inform to GUI about new Device Connection.

                        On receiving data from the COM Port, serial thread will receive the data and and decode it. After that, Decode data is making Readable by many calculation.

                        Then readable data is display on GUI.

                        For Labview Software.

                        1. I copy whole project.

                        2. I remove the GUI Stuff from the code, and add functionality of TCP/IP (client). then I create the .dllfile instead of .exe . (Qt Library side)

                        3. I will create TCP/IP (server) on labview side.

                        4. I also remove the main() function while creating Qt Library (.dll). I am creating instance of MainWindow class by calling CLF node, from Labview.

                        5. Now constructor of Mainwindow is handling Serial thread, connecting to TCP client to TCP server, connecting to qt Signals.

                        6. depending on User Interface on Labview, I will send command through TCP/IP from Labviw to DLL.

                        7. Now if any raw data receive from the COM Port, then dll will make it readable data, and send back to Labview through TCP/IP.

                        By creating .dll instead of .exe, User will handle application completely in Labview.

                        I think advantage of TCP/IP is I am able to display real time value on Labview Application.

                        Thank you,

                        J J 2 Replies Last reply 7 Dec 2018, 08:46
                        0
                        • Y Yash001
                          6 Dec 2018, 20:45

                          @JonB

                          Current Our GUI

                          Currently, I have application, which is created in Qt and C++. I am creating my application by just create the Object of Mainwidnow Class in main() function.

                          constructor of Mainwindow class is handle the remaining things. Such as create the serial thread, start Serial thread, create the GUI, connecting signals and slots, etc. Basically you can say it is initialized State.

                          on closing of Application, ~Mainwidnow() will release all the resource, and stop serial thread.

                          whenever the device is connected on COM port that time it is detected on serial thread and inform to GUI about new Device Connection.

                          On receiving data from the COM Port, serial thread will receive the data and and decode it. After that, Decode data is making Readable by many calculation.

                          Then readable data is display on GUI.

                          For Labview Software.

                          1. I copy whole project.

                          2. I remove the GUI Stuff from the code, and add functionality of TCP/IP (client). then I create the .dllfile instead of .exe . (Qt Library side)

                          3. I will create TCP/IP (server) on labview side.

                          4. I also remove the main() function while creating Qt Library (.dll). I am creating instance of MainWindow class by calling CLF node, from Labview.

                          5. Now constructor of Mainwindow is handling Serial thread, connecting to TCP client to TCP server, connecting to qt Signals.

                          6. depending on User Interface on Labview, I will send command through TCP/IP from Labviw to DLL.

                          7. Now if any raw data receive from the COM Port, then dll will make it readable data, and send back to Labview through TCP/IP.

                          By creating .dll instead of .exe, User will handle application completely in Labview.

                          I think advantage of TCP/IP is I am able to display real time value on Labview Application.

                          Thank you,

                          J Offline
                          J Offline
                          JKSH
                          Moderators
                          wrote on 7 Dec 2018, 08:46 last edited by JKSH 12 Jul 2018, 08:50
                          #12

                          @Yash001 said in How can I transfer the Qt Signal Data to 3rd party Software Such as Labview?:

                          data is received in Qt dll through COM port. After that, i am doing manipulation on received data, and generate few readable value (double) (10 - 15 value). I wanted to represent readable value on Labview GUI.

                          I am receiving data through COM port on bud-rate 57600.

                          I meant: How many "packets" do you receive though the COM port each second? How many doubles do you generate each second?

                          The baud rate itself doesn't give us much useful information.

                          For Labview Software.

                          1. I copy whole project.
                          2. I remove the GUI Stuff from the code, and add functionality of TCP/IP (client). then I create the .dllfile instead of .exe . (Qt Library side)
                          3. I will create TCP/IP (server) on labview side.
                          4. I also remove the main() function while creating Qt Library (.dll). I am creating instance of MainWindow class by calling CLF node, from Labview.
                          5. Now constructor of Mainwindow is handling Serial thread, connecting to TCP client to TCP server, connecting to qt Signals.
                          6. depending on User Interface on Labview, I will send command through TCP/IP from Labviw to DLL.
                          7. Now if any raw data receive from the COM Port, then dll will make it readable data, and send back to Labview through TCP/IP.

                          By creating .dll instead of .exe, User will handle application completely in Labview.

                          This can work, but you must bear in mind:

                          • To use QTcpClient and QSerialPort, you need a "running" QCoreApplication (this means you need to call exec()). exec() blocks permanently, which means that the VI that calls the CLF node will also run permanently (until you tell QCoreApplication to quit).
                          • You must not run your QCoreApplication in LabVIEW's UI thread, or else LabVIEW might hang. You must run it in a secondary thread.

                          I think advantage of TCP/IP is I am able to display real time value on Labview Application.

                          There are other ways to send real-time data from your DLL to LabVIEW (such as posting a LabVIEW User Event from C++). However, TCP/IP is much easier.

                          Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                          Y 1 Reply Last reply 8 Dec 2018, 00:56
                          2
                          • Y Yash001
                            6 Dec 2018, 20:45

                            @JonB

                            Current Our GUI

                            Currently, I have application, which is created in Qt and C++. I am creating my application by just create the Object of Mainwidnow Class in main() function.

                            constructor of Mainwindow class is handle the remaining things. Such as create the serial thread, start Serial thread, create the GUI, connecting signals and slots, etc. Basically you can say it is initialized State.

                            on closing of Application, ~Mainwidnow() will release all the resource, and stop serial thread.

                            whenever the device is connected on COM port that time it is detected on serial thread and inform to GUI about new Device Connection.

                            On receiving data from the COM Port, serial thread will receive the data and and decode it. After that, Decode data is making Readable by many calculation.

                            Then readable data is display on GUI.

                            For Labview Software.

                            1. I copy whole project.

                            2. I remove the GUI Stuff from the code, and add functionality of TCP/IP (client). then I create the .dllfile instead of .exe . (Qt Library side)

                            3. I will create TCP/IP (server) on labview side.

                            4. I also remove the main() function while creating Qt Library (.dll). I am creating instance of MainWindow class by calling CLF node, from Labview.

                            5. Now constructor of Mainwindow is handling Serial thread, connecting to TCP client to TCP server, connecting to qt Signals.

                            6. depending on User Interface on Labview, I will send command through TCP/IP from Labviw to DLL.

                            7. Now if any raw data receive from the COM Port, then dll will make it readable data, and send back to Labview through TCP/IP.

                            By creating .dll instead of .exe, User will handle application completely in Labview.

                            I think advantage of TCP/IP is I am able to display real time value on Labview Application.

                            Thank you,

                            J Offline
                            J Offline
                            JonB
                            wrote on 7 Dec 2018, 09:52 last edited by
                            #13

                            @Yash001
                            You obviously know what you are doing. I find it pretty weird that you will be creating a DLL which runs inside LabVIEW, yet you will be communicating with LabVIEW (i.e. the same process) via TCP/IP, which 99.9% of the time is for communicating across/between different processes, whereas you have both client & server being the same process. But there you are....

                            J 1 Reply Last reply 7 Dec 2018, 10:45
                            1
                            • J JonB
                              7 Dec 2018, 09:52

                              @Yash001
                              You obviously know what you are doing. I find it pretty weird that you will be creating a DLL which runs inside LabVIEW, yet you will be communicating with LabVIEW (i.e. the same process) via TCP/IP, which 99.9% of the time is for communicating across/between different processes, whereas you have both client & server being the same process. But there you are....

                              J Offline
                              J Offline
                              JKSH
                              Moderators
                              wrote on 7 Dec 2018, 10:45 last edited by
                              #14

                              @JonB said in How can I transfer the Qt Signal Data to 3rd party Software Such as Labview?:

                              I find it pretty weird that you will be creating a DLL which runs inside LabVIEW, yet you will be communicating with LabVIEW (i.e. the same process) via TCP/IP

                              I understand the weirdness, but it has its benefits. For one thing, it allows the C++ code to remain relatively simple and self-contained.

                              One big barrier in LabVIEW-C++ interop is that LabVIEW is implicitly multithreaded -- When you make a function call in LabVIEW, you don't really know which thread runs the function. The only way to force a specific thread is if you tell LabVIEW to call the DLL from the UI thread. However, since QCoreApplication::exec() is blocking, this will freeze the LabVIEW UI so it's not an option.

                              Long story short, you need some gross wrapper code to drive Qt from LabVIEW: https://github.com/JKSH/LQWidgets/blob/master/src/Cpp/lqlibinterface.cpp

                              Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                              1 Reply Last reply
                              4
                              • J JKSH
                                7 Dec 2018, 08:46

                                @Yash001 said in How can I transfer the Qt Signal Data to 3rd party Software Such as Labview?:

                                data is received in Qt dll through COM port. After that, i am doing manipulation on received data, and generate few readable value (double) (10 - 15 value). I wanted to represent readable value on Labview GUI.

                                I am receiving data through COM port on bud-rate 57600.

                                I meant: How many "packets" do you receive though the COM port each second? How many doubles do you generate each second?

                                The baud rate itself doesn't give us much useful information.

                                For Labview Software.

                                1. I copy whole project.
                                2. I remove the GUI Stuff from the code, and add functionality of TCP/IP (client). then I create the .dllfile instead of .exe . (Qt Library side)
                                3. I will create TCP/IP (server) on labview side.
                                4. I also remove the main() function while creating Qt Library (.dll). I am creating instance of MainWindow class by calling CLF node, from Labview.
                                5. Now constructor of Mainwindow is handling Serial thread, connecting to TCP client to TCP server, connecting to qt Signals.
                                6. depending on User Interface on Labview, I will send command through TCP/IP from Labviw to DLL.
                                7. Now if any raw data receive from the COM Port, then dll will make it readable data, and send back to Labview through TCP/IP.

                                By creating .dll instead of .exe, User will handle application completely in Labview.

                                This can work, but you must bear in mind:

                                • To use QTcpClient and QSerialPort, you need a "running" QCoreApplication (this means you need to call exec()). exec() blocks permanently, which means that the VI that calls the CLF node will also run permanently (until you tell QCoreApplication to quit).
                                • You must not run your QCoreApplication in LabVIEW's UI thread, or else LabVIEW might hang. You must run it in a secondary thread.

                                I think advantage of TCP/IP is I am able to display real time value on Labview Application.

                                There are other ways to send real-time data from your DLL to LabVIEW (such as posting a LabVIEW User Event from C++). However, TCP/IP is much easier.

                                Y Offline
                                Y Offline
                                Yash001
                                wrote on 8 Dec 2018, 00:56 last edited by
                                #15

                                @JKSH said in How can I transfer the Qt Signal Data to 3rd party Software Such as Labview?:

                                How many "packets" do you receive though the COM port each second? How many doubles do you generate each second?

                                I am receiving near about 800 packet at com port. I am generating near about 20 - 30 double value.

                                To use QTcpClient and QSerialPort, you need a "running" QCoreApplication (this means you need to call exec()). exec() blocks permanently, which means that the VI that calls the CLF node will also run permanently (until you tell QCoreApplication to quit).
                                You must not run your QCoreApplication in LabVIEW's UI thread, or else LabVIEW might hang. You must run it in a secondary thread.

                                Thank you for pointing about exec() and thread.

                                1 Reply Last reply
                                0
                                • S Offline
                                  S Offline
                                  SGaist
                                  Lifetime Qt Champion
                                  wrote on 8 Dec 2018, 15:47 last edited by
                                  #16

                                  Hi,

                                  Out of curiosity, why not use Labview's serial port support ?

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

                                  Y 1 Reply Last reply 8 Dec 2018, 22:53
                                  2
                                  • S SGaist
                                    8 Dec 2018, 15:47

                                    Hi,

                                    Out of curiosity, why not use Labview's serial port support ?

                                    Y Offline
                                    Y Offline
                                    Yash001
                                    wrote on 8 Dec 2018, 22:53 last edited by Yash001 12 Aug 2018, 22:57
                                    #17

                                    @SGaist I am not using Labview's serial port directly because of my code contain many background functionalities. It will take time to implement all in Labview. We want to just give readable data and few User interface to Labview. So user can directly use readable value and interface in Labview.

                                    1 Reply Last reply
                                    0

                                    8/17

                                    5 Dec 2018, 04:59

                                    • Login

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