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. EXO 3s sonde
Forum Updated to NodeBB v4.3 + New Features

EXO 3s sonde

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 4 Posters 445 Views 2 Watching
  • 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
    micheal15
    wrote on last edited by micheal15
    #1

    Hello ,
    I am working with EXO 3s sonde and I need to program it on qtcreator, but there is no SDK for communicating with an EXO sonde.

    In order to connect the sonde to any third party device you would have to use either the SDI-12 or RS232 interfaces which will give you ways to get data from the instrument.

    Data output over RS232 would show as strings of comma separated values.

    When data comes back using SDI-12 the string will always start with the SDI-12 address that the sonde is set to followed by the data. The values are separated by either a + or – depending on if the values is positive or negative.

    My question please : Has anyone worked with EXO 3s sonde on Qt creator and been able to recover the different data and parameters.

    Best regards

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

      Hi,

      I haven't worked with that particular device but since it can use RS232, you can use the QSerialPort class to communicate with it.

      Note that Qt Creator is just an IDE. It knows nothing about such devices, that is for your application to implement.

      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,

        I haven't worked with that particular device but since it can use RS232, you can use the QSerialPort class to communicate with it.

        Note that Qt Creator is just an IDE. It knows nothing about such devices, that is for your application to implement.

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

        @SGaist
        Thank you for your reply, i wrote this code but it dosen't work, can you help me please :

        #include "mainwindow.h"
        #include "ui_mainwindow.h"
        #include <QSerialPort>
        #include <QSerialPortInfo>
        #include <string>
        #include <QDebug>
        #include <QMessageBox>

        MainWindow::MainWindow(QWidget *parent)
        : QMainWindow(parent)
        , ui(new Ui::MainWindow)
        {
        ui->setupUi(this);
        sonde = new QSerialPort(this);
        serialBuffer = "";
        parsed_data = "";
        sonde_value = 0.0;
        bool sonde_is_available = false;
        QString sonde_uno_port_name;
        //
        // For each available serial port
        foreach(const QSerialPortInfo &serialPortInfo, QSerialPortInfo::availablePorts()){
        // check if the serialport has both a product identifier and a vendor identifier
        if(serialPortInfo.hasProductIdentifier() && serialPortInfo.hasVendorIdentifier()){
        // check if the product ID and the vendor ID match those of the sonde
        if((serialPortInfo.productIdentifier() == sonde_uno_product_id)
        && (serialPortInfo.vendorIdentifier() == sonde_uno_vendor_id)){
        sonde_is_available = true;
        sonde_uno_port_name = serialPortInfo.portName();
        }
        }
        }
        if(sonde_is_available){
        qDebug() << "Found the sonde port...\n";
        sonde->setPortName(sonde_uno_port_name);
        sonde->open(QSerialPort::ReadOnly);
        sonde->setBaudRate(QSerialPort::Baud9600);
        sonde->setDataBits(QSerialPort::Data8);
        sonde->setFlowControl(QSerialPort::NoFlowControl);
        sonde->setParity(QSerialPort::NoParity);
        sonde->setStopBits(QSerialPort::OneStop);
        QObject::connect(sonde, SIGNAL(readyRead()), this, SLOT(readSerial()));
        }else{
        qDebug() << "Couldn't find the correct port for the sonde.\n";
        QMessageBox::information(this, "Serial Port Error", "Couldn't open serial port to sonde.");
        }
        }

        MainWindow::~MainWindow()
        {
        if(sonde->isOpen()){
        sonde->close(); // Close the serial port if it's open.
        }
        delete ui;
        }
        void MainWindow::readSerial()
        {

        QStringList buffer_split = serialBuffer.split(","); //  split the serialBuffer string, parsing with ',' as the separator
        
            serialBuffer = "";
            qDebug() << buffer_split << "\n";
            parsed_data = buffer_split[1];
            sonde_value = parsed_data.toDouble(); 
            qDebug()  << sonde_value << "\n";
        }
        

        .h :
        QSerialPort *sonde;
        static const quint16 sonde_uno_vendor_id = 1027;
        static const quint16 sonde_uno_product_id = 24577;
        QByteArray serialData;
        QString serialBuffer;
        QString parsed_data;
        double sonde_value;

        Result :Found the sonde port...
        But there is no data

        jsulmJ 1 Reply Last reply
        0
        • M Offline
          M Offline
          mchinand
          wrote on last edited by mchinand
          #4

          You might have to set the connection parameters (baudrate, parity, etc.) before you open the port. Check the return value of the open() call to see if it succeeded. Like @SGaist, I'm not familiar with this device either, do you have to send a request to it to get data back? Should you be opening it ReadWrite mode instead of ReadOnly? Are you able to communicate with it with another terminal application?

          1 Reply Last reply
          0
          • M micheal15

            @SGaist
            Thank you for your reply, i wrote this code but it dosen't work, can you help me please :

            #include "mainwindow.h"
            #include "ui_mainwindow.h"
            #include <QSerialPort>
            #include <QSerialPortInfo>
            #include <string>
            #include <QDebug>
            #include <QMessageBox>

            MainWindow::MainWindow(QWidget *parent)
            : QMainWindow(parent)
            , ui(new Ui::MainWindow)
            {
            ui->setupUi(this);
            sonde = new QSerialPort(this);
            serialBuffer = "";
            parsed_data = "";
            sonde_value = 0.0;
            bool sonde_is_available = false;
            QString sonde_uno_port_name;
            //
            // For each available serial port
            foreach(const QSerialPortInfo &serialPortInfo, QSerialPortInfo::availablePorts()){
            // check if the serialport has both a product identifier and a vendor identifier
            if(serialPortInfo.hasProductIdentifier() && serialPortInfo.hasVendorIdentifier()){
            // check if the product ID and the vendor ID match those of the sonde
            if((serialPortInfo.productIdentifier() == sonde_uno_product_id)
            && (serialPortInfo.vendorIdentifier() == sonde_uno_vendor_id)){
            sonde_is_available = true;
            sonde_uno_port_name = serialPortInfo.portName();
            }
            }
            }
            if(sonde_is_available){
            qDebug() << "Found the sonde port...\n";
            sonde->setPortName(sonde_uno_port_name);
            sonde->open(QSerialPort::ReadOnly);
            sonde->setBaudRate(QSerialPort::Baud9600);
            sonde->setDataBits(QSerialPort::Data8);
            sonde->setFlowControl(QSerialPort::NoFlowControl);
            sonde->setParity(QSerialPort::NoParity);
            sonde->setStopBits(QSerialPort::OneStop);
            QObject::connect(sonde, SIGNAL(readyRead()), this, SLOT(readSerial()));
            }else{
            qDebug() << "Couldn't find the correct port for the sonde.\n";
            QMessageBox::information(this, "Serial Port Error", "Couldn't open serial port to sonde.");
            }
            }

            MainWindow::~MainWindow()
            {
            if(sonde->isOpen()){
            sonde->close(); // Close the serial port if it's open.
            }
            delete ui;
            }
            void MainWindow::readSerial()
            {

            QStringList buffer_split = serialBuffer.split(","); //  split the serialBuffer string, parsing with ',' as the separator
            
                serialBuffer = "";
                qDebug() << buffer_split << "\n";
                parsed_data = buffer_split[1];
                sonde_value = parsed_data.toDouble(); 
                qDebug()  << sonde_value << "\n";
            }
            

            .h :
            QSerialPort *sonde;
            static const quint16 sonde_uno_vendor_id = 1027;
            static const quint16 sonde_uno_product_id = 24577;
            QByteArray serialData;
            QString serialBuffer;
            QString parsed_data;
            double sonde_value;

            Result :Found the sonde port...
            But there is no data

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @micheal15 said in EXO 3s sonde:

            it dosen't work

            For the future: please take minute to specify what exactly does not work...

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            M 1 Reply Last reply
            0
            • jsulmJ jsulm

              @micheal15 said in EXO 3s sonde:

              it dosen't work

              For the future: please take minute to specify what exactly does not work...

              M Offline
              M Offline
              micheal15
              wrote on last edited by
              #6

              @jsulm hello and thank you for your reply.
              i don't receive data

              jsulmJ 1 Reply Last reply
              0
              • M micheal15

                @jsulm hello and thank you for your reply.
                i don't receive data

                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on last edited by
                #7

                @micheal15 So, start to debug your app.
                Does

                sonde->open(QSerialPort::ReadOnly);
                

                succeed? Please add error handling to your app and please use code tags - your code is hard to read.

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                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