labpowerqt icon indicating copy to clipboard operation
labpowerqt copied to clipboard

Crashes with more than one channel

Open Comiter opened this issue 5 years ago • 4 comments

Using labpowerqt to connect to my RND LAB 320-KA3305P power supply. This is a dual channel power supply, but it crashes when trying to connect. It crashes just right after it has read device and serial number (see screenshot). If I configure a device with only one channel, it works like a charm.

LabPowerQt before Crash

I have tried with different settings regarding sampling time as well, with no luck. Does it support more than one channel at all?

Edit: Output from one sequence (Start to crash) from Log file with Debug Enabled:

2020-02-17 22:08:30 INFO [main.cpp:87] LabPowerQt 0.1.3 is starting 2020-02-17 22:08:30 DEBUG [plottingarea.cpp:322] Visibility is true for Set Voltage 2020-02-17 22:08:30 DEBUG [plottingarea.cpp:322] Visibility is true for Voltage 2020-02-17 22:08:30 DEBUG [plottingarea.cpp:322] Visibility is true for Current 2020-02-17 22:08:30 DEBUG [plottingarea.cpp:322] Visibility is true for Set Voltage 2020-02-17 22:08:30 DEBUG [plottingarea.cpp:322] Visibility is true for Voltage 2020-02-17 22:08:30 DEBUG [plottingarea.cpp:322] Visibility is true for Set Current 2020-02-17 22:08:30 DEBUG [plottingarea.cpp:322] Visibility is true for Current 2020-02-17 22:08:30 DEBUG [plottingarea.cpp:322] Visibility is true for Wattage 2020-02-17 22:08:34 DEBUG [koradscpi.cpp:313] Command string: *IDN? 2020-02-17 22:08:34 DEBUG [powersupplyscpi.cpp:140] Bytes written: 5 command length: 5 2020-02-17 22:08:34 DEBUG [koradscpi.cpp:163] Processing command 17 2020-02-17 22:08:34 DEBUG [koradscpi.cpp:165] Command valueRND 320-KA3305P V4.0 SN:10039332 2020-02-17 22:08:34 DEBUG [koradscpi.cpp:313] Command string: VSET1? 2020-02-17 22:08:34 DEBUG [powersupplyscpi.cpp:140] Bytes written: 6 command length: 6 2020-02-17 22:08:34 DEBUG [labpowercontroller.cpp:220] Sending command: RND 320-KA3305P V4.0 SN:10039332 2020-02-17 22:08:34 DEBUG [koradscpi.cpp:163] Processing command 4 2020-02-17 22:08:34 DEBUG [koradscpi.cpp:165] Command value13.80 2020-02-17 22:08:34 DEBUG [koradscpi.cpp:313] Command string: ISET1? 2020-02-17 22:08:34 DEBUG [powersupplyscpi.cpp:140] Bytes written: 6 command length: 6 2020-02-17 22:08:34 DEBUG [labpowercontroller.cpp:220] Sending command: 13.80 2020-02-17 22:08:34 DEBUG [koradscpi.cpp:163] Processing command 2 2020-02-17 22:08:34 DEBUG [koradscpi.cpp:165] Command value1.642 2020-02-17 22:08:34 DEBUG [koradscpi.cpp:313] Command string: VSET2? 2020-02-17 22:08:34 DEBUG [powersupplyscpi.cpp:140] Bytes written: 6 command length: 6 2020-02-17 22:08:34 DEBUG [labpowercontroller.cpp:220] Sending command: 1.642 2020-02-17 22:08:34 DEBUG [koradscpi.cpp:163] Processing command 4 2020-02-17 22:08:34 DEBUG [koradscpi.cpp:165] Command value11.16 2020-02-17 22:08:34 DEBUG [koradscpi.cpp:313] Command string: ISET2? 2020-02-17 22:08:34 DEBUG [powersupplyscpi.cpp:140] Bytes written: 6 command length: 6 2020-02-17 22:08:34 DEBUG [labpowercontroller.cpp:220] Sending command: 11.16 2020-02-17 22:08:34 DEBUG [koradscpi.cpp:163] Processing command 2 2020-02-17 22:08:34 DEBUG [koradscpi.cpp:165] Command value1.642 2020-02-17 22:08:34 DEBUG [koradscpi.cpp:313] Command string: VSET1:13.80 2020-02-17 22:08:34 DEBUG [labpowercontroller.cpp:220] Sending command: 1.642 2020-02-17 22:08:34 DEBUG [powersupplyscpi.cpp:140] Bytes written: 11 command length: 11 2020-02-17 22:08:34 DEBUG [koradscpi.cpp:313] Command string: ISET1:1.642 2020-02-17 22:08:34 DEBUG [labpowercontroller.cpp:220] Sending command: 13.80 2020-02-17 22:08:34 DEBUG [powersupplyscpi.cpp:140] Bytes written: 11 command length: 11 2020-02-17 22:08:34 DEBUG [koradscpi.cpp:313] Command string: VSET2:11.16 2020-02-17 22:08:34 DEBUG [labpowercontroller.cpp:220] Sending command: 1.642 2020-02-17 22:08:34 DEBUG [powersupplyscpi.cpp:140] Bytes written: 11 command length: 11 2020-02-17 22:08:34 DEBUG [koradscpi.cpp:313] Command string: ISET2:1.642 2020-02-17 22:08:34 DEBUG [labpowercontroller.cpp:220] Sending command: 11.16 2020-02-17 22:08:34 DEBUG [powersupplyscpi.cpp:140] Bytes written: 11 command length: 11 2020-02-17 22:08:34 DEBUG [labpowercontroller.cpp:220] Sending command: 1.642 2020-02-17 22:08:36 DEBUG [koradscpi.cpp:313] Command string: STATUS? 2020-02-17 22:08:36 DEBUG [powersupplyscpi.cpp:140] Bytes written: 7 command length: 7 2020-02-17 22:08:36 DEBUG [koradscpi.cpp:163] Processing command 16 2020-02-17 22:08:36 DEBUG [koradscpi.cpp:165] Command value� 2020-02-17 22:08:36 DEBUG [koradscpi.cpp:180] Korad Status byte: à 2020-02-17 22:08:36 DEBUG [koradscpi.cpp:313] Command string: IOUT2? 2020-02-17 22:08:36 DEBUG [powersupplyscpi.cpp:140] Bytes written: 6 command length: 6 2020-02-17 22:08:36 DEBUG [koradscpi.cpp:163] Processing command 5 2020-02-17 22:08:36 DEBUG [koradscpi.cpp:165] Command value0.000 2020-02-17 22:08:36 DEBUG [koradscpi.cpp:313] Command string: VOUT2? 2020-02-17 22:08:36 DEBUG [powersupplyscpi.cpp:140] Bytes written: 6 command length: 6 2020-02-17 22:08:36 DEBUG [koradscpi.cpp:163] Processing command 6

Best Regards Vidar

Comiter avatar Feb 17 '20 21:02 Comiter

Hey Vidar,

thanks for reporting this.

Does it support more than one channel at all?

In theory? YES :) But I only have a single channel device and multichannel support was build in making best guesses. As it seems this was not enough...

So If I understand you correct it crashes after you press the connect button, right? I'd like to build in some more debugging to see if we can find out whats causing this. Did you compile LabPowerQt yourself?

I hope I find some time in the coming days but I will definitively have a look at it at the coming weekend.

Best Regards Christian

crapp avatar Feb 18 '20 12:02 crapp

Hi Christian, thanks for the reply! Yes, I build it myself on a Windows machine. Goes fine for release, but I was not able to build a debug version of it. Most likely since the ealogger fails to download during compilation. So I manually compile it as a library, and put in in the correct folder before compiling labpowerqt.

I'm most used to do microcontroller programming, but if you give me okay instructions I hope I can manage to give you whatever information you need.

Edit: Just for clarity, the same happens when using the pre-built 0.1.3 release as well :)

Best Regards Vidar

Comiter avatar Feb 18 '20 12:02 Comiter

Thanks Vidar. I started working on the development branch but it is not ready yet. I will let you know as soon as I have something for you...

crapp avatar Feb 25 '20 11:02 crapp

I had the same issue, it is because actual voltage and current are only read for 1 channel, but it is easy to fix:

*** koradscpi.cpp	2017-11-27 07:03:16.000000000 +0100
--- koradscpi.cpp	2021-06-27 14:54:56.000000000 +0200
***************
*** 326,339 ****
              for (int i = 1; i <= this->noOfChannels; i++) {
                  com = std::make_shared<SerialCommand>(
                      static_cast<int>(c), i, QVariant(), true,
                      korcon::SERIALCOMMANDBUFLENGTH.at(c));
              }
          } else {
              com = std::make_shared<SerialCommand>(
                  static_cast<int>(c), 1, QVariant(), true,
                  korcon::SERIALCOMMANDBUFLENGTH.at(c));
          }
-         comVec.push_back(com);
      }
      return comVec;
  }
--- 326,340 ----
              for (int i = 1; i <= this->noOfChannels; i++) {
                  com = std::make_shared<SerialCommand>(
                      static_cast<int>(c), i, QVariant(), true,
                      korcon::SERIALCOMMANDBUFLENGTH.at(c));
+ 		        comVec.push_back(com);
              }
          } else {
              com = std::make_shared<SerialCommand>(
                  static_cast<int>(c), 1, QVariant(), true,
                  korcon::SERIALCOMMANDBUFLENGTH.at(c));
+ 	        comVec.push_back(com);
          }
      }
      return comVec;
  }

aziemer avatar Jun 27 '21 13:06 aziemer